Operation merge-streams
The merge-stream operation allows for the merging of multiple multimedia streams, such as audio, video, and subtitle files, into a single multimedia file.
It offers a range of options for customizing the resulting merged file, making it a versatile tool for working with multimedia content.
Available Options
Option Name | Type | Possible Values | Description |
---|---|---|---|
video_format | string | avi, flv, mkv, mov, mp4, mpg, ogv, webm, wmv | Allows the specification of the format of the merged file. |
keep_original_audio | boolean | true, false | If set to true, this option will keep the audio streams from the original video. |
input_filters | array of objects | see details later in this page | This option allows for the application of filters to the merged result, such as modifying the volume of individual streams. |
metadata | array of objects | see details later in this page | This option allows the specification of metadata for each stream, such as the language of an audio stream or the subtitle language of a subtitle stream. |
audio_channels | string | layout, back_center, back_left, back_right, front_center, front_left, front_left_of_center, front_right, front_right_of_center, low_frequency, side_left, side_right, top_center, top_front_center, top_front_left, top_front_right, top_back_center, top_back_left, top_back_right, wide_left, wide_right | This option allows the specification of the audio layout of the final merged file. See details later in this page. |
allow_multiple_outputs | boolean | true, false | If the comparison produces more than one output file, by default all of them are compressed in just one file. Set this option to true if you want a download link for each file. |
Options Details
- input_filters: it requires an array of objects where each object contains the following fields:
Property Name Type Possible Values Description input_id string pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ Specifies the input_id of the file for which the desired filter will be set. filter_name string volume The filter to apply the selected filter to the input_id filter_value string The value(s) to use with the selected filter as a comma separated list E.g. for the volume filter allows you to control the loudness of the stream.
A value of 0 mutes the stream, 0.50 reduces it to half, 1 leaves it as is in the original file, and 1.50 increases it by 50%. - metadata: it requires an array of objects where each object contains the following fields:
Property Name Type Possible Values Description input_id string pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ Specifies the input_id of the file for which the desired properties will be set. language string pattern: ^[a-z]{3}$ The language (using ISO 639-2/T standard) of the stream contained within the input file, as specified by the input_id field - audio_channels: This option allows the specification of the audio layout of the final merged file.
The option layout allows you to predefine the layout of sound sources. Possible values are described in the next table.
Option Value Description mono A single channel, with all audio being played through a single speaker or set of speakers. stereo 2 channels, typically played through a pair of left and right speakers. 2.1 2 channels for left and right audio, plus a separate channel for low-frequency effects (LFE) played through a subwoofer. 3.0 3 channels, with left, right, and center audio played through separate speakers. 3.0-back This audio layout is similar to 3.0, but includes an additional back channel for rear audio. 3.1 3 channels for left, right, and center audio, plus a separate channel for LFE played through a subwoofer. 4.0 4 channels, with left, right, left-surround, and right-surround audio played through separate speakers. 4.1 4 channels for left, right, left-surround, and right-surround audio, plus a separate channel for LFE played through a subwoofer. quad This audio layout is similar to 4.0, but with the addition of a separate channel for rear audio. quad-side This audio layout is similar to quad, but with the addition of side channels for left-side and right-side audio. 5.0 5 channels, with left, right, center, left-surround, and right-surround audio played through separate speakers. 5.0-side This audio layout is similar to 5.0, but with the addition of side channels for left-side and right-side audio. 5.1 5 channels for left, right, center, left-surround, and right-surround audio, plus a separate channel for LFE played through a subwoofer. 5.1-side This audio layout is similar to 5.1, but with the addition of side channels for left-side and right-side audio. 6.0 6 channels, with left, right, center, left-surround, right-surround, and back audio played through separate speakers. 6.0-front This audio layout is similar to 6.0, but with the addition of front channels for left-front and right-front audio. hexagonal 6 channels, with left, right, left-surround, right-surround, left-back, and right-back audio played through separate speakers. 6.1 6 channels for left, right, center, left-surround, right-surround, and back audio, plus a separate channel for LFE played through a subwoofer. 6.1-back This audio layout is similar to 6.1, but with the back channel replaced by left-back and right-back channels. 6.1-front This audio layout is similar to 6.1, but with the back channel replaced by left-front and right-front channels. 7.0 7 channels, with left, right, center, left-surround, right-surround, left-back, and right-back audio played through separate speakers. 7.0-front This audio layout is similar to 7.0, but with the addition of front channels for left-front and right-front audio. 7.1 7 channels for left, right, center, left-surround, right-surround, left-back, and right-back audio, plus a separate channel for LFE played through a subwoofer. 7.1-wide This audio layout is similar to 7.1, but with the addition of wide channels for left-wide and right-wide audio. 7.1-wide-side This audio layout is similar to 7.1-wide, but with the addition of side channels for left-side and right-side audio. octagonal 8 channels, with left, right, left-surround, right-surround, left-back, right-back, left-side, and right-side audio played through separate speakers hexadecagonal 16 channels, with left, right, center, left-surround, right-surround, left-back, right-back, left-side, right-side, left-front, right-front, left-wide, right-wide, top-front-center, top-back-center, and bottom-center audio played through separate speakers.
Furthermore, the option audio_channels allows to specify the single channels of the above layouts.
The value is the input_id of the file to use as a source for the specified channel.
The available values of the audio_channels option are: back_center, back_left, back_right, front_center, front_left, front_left_of_center, front_right, front_right_of_center, low_frequency, side_left, side_right, top_center, top_front_center, top_front_left, top_front_right, top_back_center, top_back_left, top_back_right, wide_left, wide_right
Example
{ "conversion": [{ "category": "operation", "target": "merge-streams", "options": { "audio_channels": { "layout": "3.0", "front_left": "{input_file_id_1}", "front_right": "{input_file_id_2}", "front_center": "{input_file_id_3}" } } }], }