matroska


Matroska container muxer.

This muxer implements the matroska and webm container specs.

The recognized metadata settings in this muxer are:

'title'

Set title name provided to a single track.

'language'

Specify the language of the track in the Matroska languages form.

The language can be either the 3 letters bibliographic ISO-639-2 (ISO 639-2/B) form (like "fre" for French), or a language code mixed with a country code for specialities in languages (like "fre-ca" for Canadian French).

'stereo_mode'

Set stereo 3D video layout of two views in a single video track.

The following values are recognized:

'mono'

video is not stereo

'left_right'

Both views are arranged side by side, Left-eye view is on the left

'bottom_top'

Both views are arranged in top-bottom orientation, Left-eye view is at bottom

'top_bottom'

Both views are arranged in top-bottom orientation, Left-eye view is on top

'checkerboard_rl'

Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first

'checkerboard_lr'

Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first

'row_interleaved_rl'

Each view is constituted by a row based interleaving, Right-eye view is first row

'row_interleaved_lr'

Each view is constituted by a row based interleaving, Left-eye view is first row

'col_interleaved_rl'

Both views are arranged in a column based interleaving manner, Right-eye view is first column

'col_interleaved_lr'

Both views are arranged in a column based interleaving manner, Left-eye view is first column

'anaglyph_cyan_red'

All frames are in anaglyph format viewable through red-cyan filters

'right_left'

Both views are arranged side by side, Right-eye view is on the left

'anaglyph_green_magenta'

All frames are in anaglyph format viewable through green-magenta filters

'block_lr'

Both eyes laced in one Block, Left-eye view is first

'block_rl'

Both eyes laced in one Block, Right-eye view is first

For example a 3D WebM clip can be created using the following command line:

ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm

This muxer supports the following options:

'reserve_index_space'

By default, this muxer writes the index for seeking (called cues in Matroska terms) at the end of the file, because it cannot know in advance how much space to leave for the index at the beginning of the file. However for some use cases - e.g. streaming where seeking is possible but slow - it is useful to put the index at the beginning of the file.

If this option is set to a non-zero value, the muxer will reserve a given amount of space in the file header and then try to write the cues there when the muxing finishes. If the available space does not suffice, muxing will fail. A safe size for most use cases should be about 50kB per hour of video.

Note that cues are only written if the output is seekable and this option will have no effect if it is not.