Quantum

Segmented exporter

In 12.1 we also implemented a new transcoder that allows arbitrary sequences to be transcoded using FFmpeg, by saving intermediate segments and building up a complete sequence by concatenating them, including elements such as slates, burnt in text, etc.

This allows burnt in event marker text and complex sequences to be transcoded because each segment of each source file can be transcoded separately to the required

output format, with a much simpler FFmpeg command line, and then simply concatenated.

When doing an intermediate transcode it will directly write .yuv files from the native decoders and pass those to FFmpeg, avoiding any extra compression losses and delays from going via JPEG. To avoid using up excessive disk space it renders intermediate sequences in segments of no more than around 10 seconds.

Each segment of each audio track is written out and then concatenated separately, with silent filler inserted as required. Splitting out the decode and then the final encode allows us to go from any source audio configuration (eg. one stereo or 8 mono or one 5.1 surround sound track) to any required target (eg. two mono tracks).

The intention is that the segmented exporter will be the main exporter going forwards, though currently it doesn’t understand all the options that the FFmpeg exporter supports (for example, to change the font of burnt in text, or do hardware accelerated transcodes).

Example

In this example the video to be rendered might be defined by three segments, and the audio by two segments:

Video: Slate (3s) + Clip1 MOV (15s) + Clip2 R3D (25s) Audio: Silence (3s) + Clip3 MP3 (40s)

This would be rendered out to separate files, each with a separate invocation of ffmpeg but to the same output frame size and format:

V1-seg001.mp4 (3s) – via uncompressed rgb bitmaps written by java V1-seg002.mp4 (15s) – direct from the source file

V1-seg003.mp4 (10s) – via a yuv file written in 10s chunks by native player V1-seg004.mp4 (10s) – via yuv

V1-seg005.mp4 (5s) – via yuv

These are then concatenated (again, using ffmpeg) to produce:

V1.mp4 (43s)

The audio is handled similarly, each segment is rendered out using ffmpeg:

A1-seg001.wav (3s) – silence is created via an ffmpeg filter

A1-seg002.wav (40s) – direct from file or via intermediate wav from helper

And then concatenated to produce:

A1.wav (43s)

Finally, V1.mp4 and A1.wav are combined into a single file, again using ffmpeg. The video is copied without reencoding, while the audio might be compressed at this stage:

Final Output.mp4 (43s)