Skip to content

Commit

Permalink
Merge branch 'master' into feat/queue-based-retry-policy
Browse files Browse the repository at this point in the history
# Conflicts:
#	workflows/handle_multitrack.go
  • Loading branch information
fredrikvedvik committed Jan 11, 2024
2 parents cf4b657 + 7c35c1d commit 9d69400
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ var workerWorkflows = []any{
workflows.TranscribeFile,
workflows.TranscribeVX,
workflows.WatchFolderTranscode,
workflows.HandleMultitrackFile,
export.VXExport,
export.VXExportToVOD,
export.VXExportToPlayout,
Expand Down
24 changes: 23 additions & 1 deletion services/vidispine/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func getEmbeddedAudio(client Client, clip *Clip, languagesToExport []string) (*C
}

shape := shapes.GetShape("original")
if len(shape.AudioComponent) != 16 && len(shape.AudioComponent) > 2 {
if len(shape.AudioComponent) != 16 && len(shape.AudioComponent) != 8 && len(shape.AudioComponent) > 2 {
return clip, fmt.Errorf("found %d audio components, expected 1, 2 or 16", len(shape.AudioComponent))
}

Expand Down Expand Up @@ -241,6 +241,28 @@ func getEmbeddedAudio(client Client, clip *Clip, languagesToExport []string) (*C
}
}

if len(shape.AudioComponent) == 8 {
if len(languagesToExport) > 1 {
return clip, fmt.Errorf("found 8 audio components, expected 16")
}

var streams []int
for _, c := range shape.AudioComponent[:2] {
streams = append(streams, c.EssenceStreamID)
if c.ChannelCount != 1 {
return clip, fmt.Errorf("found %d channels in audio component, expected 1", c.ChannelCount)
}
}

for _, lang := range languagesToExport {
clip.AudioFiles[lang] = &AudioFile{
VXID: clip.VXID,
File: shape.GetPath(),
Streams: streams,
}
}
}

for _, lang := range languagesToExport {
// We have an actual 16 channel audio file, so we need to figure out which channels to use
// and assign them to the correct language
Expand Down
2 changes: 1 addition & 1 deletion workflows/handle_multitrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func HandleMultitrackFile(

lucidPath = lucidPath.Append(path.Base()).Prepend("01 Liveopptak fra Brunstad/01 RAW")

err = wfutils.ExecuteWithQueue(ctx, activities.CopyFile, activities.MoveFileInput{
err = wfutils.ExecuteWithQueue(ctx, activities.RcloneCopyFile, activities.RcloneFileInput{
Source: path,
Destination: lucidPath,
}).Get(ctx, nil)
Expand Down

0 comments on commit 9d69400

Please sign in to comment.