Skip to content

Commit 7c549ec

Browse files
authored
Support manually requesting reencode (#1411)
Signed-off-by: Max Holland <max@livepeer.org>
1 parent 2ada4e7 commit 7c549ec

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

handlers/schemas/UploadVOD.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ properties:
124124
additionalProperties: false
125125
required:
126126
- "name"
127+
reencode_segmentation:
128+
type: "boolean"
127129
required:
128130
- "url"
129131
- "callback_url"

handlers/upload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ type UploadVODRequest struct {
5656

5757
// Forwarded to clipping stage:
5858
ClipStrategy video.ClipStrategy `json:"clip_strategy"`
59+
60+
ReencodeSegmentation bool `json:"reencode_segmentation"`
5961
}
6062

6163
type UploadVODResponse struct {
@@ -314,6 +316,7 @@ func (d *CatalystAPIHandlersCollection) handleUploadVOD(w http.ResponseWriter, r
314316
SourceCopy: uploadVODRequest.getSourceCopyEnabled(),
315317
ClipStrategy: uploadVODRequest.ClipStrategy,
316318
C2PA: uploadVODRequest.C2PA,
319+
ReencodeSegmentation: uploadVODRequest.ReencodeSegmentation,
317320
})
318321

319322
respBytes, err := json.Marshal(UploadVODResponse{RequestID: requestID})

pipeline/ffmpeg.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ func (f *ffmpeg) Name() string {
5050
}
5151

5252
func (f *ffmpeg) HandleStartUploadJob(job *JobInfo) (*HandlerOutput, error) {
53+
if job.ReencodeSegmentation {
54+
return f.handleStartUploadJob(job, true)
55+
}
56+
5357
// First attempt: try cheap "copy" based segmenting.
5458
out, err := f.handleStartUploadJob(job, false)
5559
if err != nil && errors.Is(err, ErrKeyframe) {

0 commit comments

Comments
 (0)