Skip to content

Commit

Permalink
Only require bitrate for transcode API profile
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 committed Aug 18, 2023
1 parent 134637a commit 5face8c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/api/src/controllers/transcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ app.post(
if (outputs.mp4?.path != null && !outputs.mp4.path.startsWith("/")) {
outputs.mp4.path = "/" + outputs.mp4.path;
}
if (outputs.fmp4?.path != null && !outputs.fmp4.path.startsWith("/")) {
outputs.fmp4.path = "/" + outputs.fmp4.path;
}

const task = await req.taskScheduler.createAndScheduleTask(
"transcode-file",
Expand Down
58 changes: 56 additions & 2 deletions packages/api/src/schema/api-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,49 @@ components:
- hevc
- vp8
- vp9
transcode-profile:
type: object
description: Transcode API profile
additionalProperties: false
required:
- bitrate
properties:
width:
type: integer
minimum: 128
name:
type: string
minLength: 1
maxLength: 500
example: 720p
height:
type: integer
minimum: 128
bitrate:
type: integer
minimum: 400
fps:
type: integer
minimum: 0
fpsDen:
type: integer
minimum: 1
gop:
type: string
profile:
type: string
enum:
- H264Baseline
- H264Main
- H264High
- H264ConstrainedHigh
encoder:
type: string
enum:
- h264
- hevc
- vp8
- vp9
webhook:
type: object
required:
Expand Down Expand Up @@ -1299,10 +1342,21 @@ components:
type: string
description: Path for the MP4 output
example: /samplevideo/mp4
fmp4:
type: object
additionalProperties: false
required:
- path
description: FMP4 output format
properties:
path:
type: string
description: Path for the FMP4 output
example: /samplevideo/fmp4
profiles:
type: array
items:
$ref: "#/components/schemas/ffmpeg-profile"
$ref: "#/components/schemas/transcode-profile"
targetSegmentSizeSecs:
type: number
description:
Expand Down Expand Up @@ -1451,7 +1505,7 @@ components:
profiles:
type: array
items:
$ref: "#/components/schemas/ffmpeg-profile"
$ref: "#/components/schemas/transcode-profile"
targetSegmentSizeSecs:
type: number
description: |
Expand Down

0 comments on commit 5face8c

Please sign in to comment.