From 4452fcc56f5973acb58f015b0b4eb944d96f4758 Mon Sep 17 00:00:00 2001 From: Victor Elias Date: Thu, 13 Jun 2024 17:12:19 +0100 Subject: [PATCH] api: Add profiles field to asset (#2217) * api/schema: Add profiles field to assets * api/cannon: Propagate recording profiles to asset --- packages/api/src/schema/api-schema.yaml | 9 +++++++++ packages/api/src/webhooks/cannon.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/packages/api/src/schema/api-schema.yaml b/packages/api/src/schema/api-schema.yaml index c97340448..9862f664e 100644 --- a/packages/api/src/schema/api-schema.yaml +++ b/packages/api/src/schema/api-schema.yaml @@ -1112,6 +1112,15 @@ components: ID of the asset from which this asset was created. creatorId: $ref: "#/components/schemas/creator-id" + profiles: + type: array + description: | + Requested profiles for the asset to be transcoded into. Currently + only supported for livestream recording assets, configured through + the `stream.recordingSpec` field. If this is not present it means + that default profiles were derived from the input metadata. + items: + $ref: "#/components/schemas/ffmpeg-profile" storage: additionalProperties: false properties: diff --git a/packages/api/src/webhooks/cannon.ts b/packages/api/src/webhooks/cannon.ts index ace867305..9f08c39d2 100644 --- a/packages/api/src/webhooks/cannon.ts +++ b/packages/api/src/webhooks/cannon.ts @@ -567,6 +567,7 @@ export default class WebhookCannon { projectId: session.projectId, createdAt: session.createdAt, source: { type: "recording", sessionId: session.id }, + profiles: session.recordingSpec?.profiles, status: { phase: "waiting", updatedAt: Date.now() }, name: `live-${startedAt}`, objectStoreId: