Advanced Source Mapping

Media Source can be specified as complex set o parameters such as several URLs and audio streams mapping.

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required -->
    <userkey><<key>></userkey> <!-- required -->
    <action>AddMedia</action> <!-- required -->
    <source>[SourceFile1]</source> <!-- required -->
    <source>
        <url>[SourceFile2]</url>
        <url>[AdditionalSourceFile2]</url>
        <audio_stream>
            <use_stream_id>[SourceMediaAudioStreamID]</use_stream_id>
            <natural_order>[yes|no]</natural_order>
            <language>[Language]</language>
            <channel>
                <id>[OutputChannelID]</id>
                <in>
                    <id>[SourceTrackID:SourceChannelID]</id>
                    <gain>[ChannelGainLevel]</gain>
                </in>
                <in>
                    <!-- Input channel params -->
                </in>
            </channel>
            <channel>
                <!-- Audio channel params -->
            </channel>
            <normalize>[yes|no]</normalize>
            <layout>[AudioLayoutName]</layout>
            <start>[StartTimecode]</start>
            <finish>[FinishTimecode]</finish>
            <duration>[Duration]</duration>
        </audio_stream>
        <!-- Multiple audio streams -->
        <audio_stream>
            <!-- Audio stream params -->
        </audio_stream>
    </source>
    <source>
        <url>[SourceFile3]</url>
        <!-- Source params -->
    </source>
    <format> <!-- required -->
        <!-- Format params --> 
    </format>
</query>
{
    "query": {
        "userid": "<<id>>", // required
        "userkey": "<<key>>", // required
        "action": "AddMedia",  // required
        "source": [ // required
            "[SourceFile1]", 
            {
                "url": [
                    "[SourceFile2]",
                    "[AdditionalSourceFile2]"
                ],
                "audio_stream": [
                    {
                        "use_stream_id": "[SourceMediaAudioStreamID]",
                        "natural_order": "[yes|no]",
                        "language": "[Language]",
                        "channel": [
                            {
                                "id": "[OutputChannelID]",
                                "in": [
                                    {
                                        "id": "[SourceTrackID:SourceChannelID]",
                                        "gain": "[ChannelGainLevel]"
                                    },
                                    {
                                        // Input channel params
                                    }
                                ]
                            },
                            {
                                // Audio channel params
                            }
                        ],
                        "normalize": "[yes|no]",
                        "layout": "[AudioLayoutName]",
                        "start": "[StartTimecode]",
                        "finish": "[FinishTimecode]",
                        "duration": "[Duration]"
                    }, 
                    {
                        //Audio stream params
                    }
                ]
            },
            {
                "url": "[SourceFile3]"
                // Source params
            }
        ],
        "format": { // required
            // Format params
        }
    }
}

Parameter

Description

Allowed Values

Default Values

use_stream_id

Specify the source media stream ID.

Set of 2 non-negative integer numbers separated by colon sign
e.g. F:S
Where

  • F – File index (index of <url /> param in <source /> block)
  • S – Stream index in source file

none

natural_order

If set to yes then value of <use_stream_id /> will mean number of source's audio stream, not number of stream in all type streams list.

yes, no

no

language

Specify the track language.

A language code in 3 lowercase letters according to ISO639-2.

none

Mapping Parameters

normalize

Enable the renormalization output track to avoid clipping noise.

yes, no

none

layout

Specify the output channels layout.

One of these channel layouts:
mono — FC
stereo — FL+FR
2.1 — FL+FR+LFE
3.0 — FL+FR+FC
3.0-back — FL+FR+BC
4.0 — FL+FR+FC+BC
quad — FL+FR+BL+BR
quad-side — FL+FR+SL+SR
3.1 — FL+FR+FC+LFE
5.0 — FL+FR+FC+BL+BR
5.0-side — FL+FR+FC+SL+SR
4.1 — FL+FR+FC+LFE+BC
5.1 — FL+FR+FC+LFE+BL+BR
5.1-side — FL+FR+FC+LFE+SL+SR
6.0 — FL+FR+FC+BC+SL+SR
6.0-front — FL+FR+FLC+FRC+SL+SR
hexagonal — FL+FR+FC+BL+BR+BC
6.1 — FL+FR+FC+LFE+BC+SL+SR
6.1 — FL+FR+FC+LFE+BL+BR+BC
6.1-front — FL+FR+LFE+FLC+FRC+SL+SR
7.0 — FL+FR+FC+BL+BR+SL+SR
7.0-front — FL+FR+FC+FLC+FRC+SL+SR
7.1 — FL+FR+FC+LFE+BL+BR+SL+SR
7.1-wide — FL+FR+FC+LFE+BL+BR+FLC+FRC
7.1-wide-side — FL+FR+FC+LFE+FLC+FRC+SL+SR
octagonal — FL+FR+FC+BL+BR+BC+SL+SR
downmix — DL+DR

none

Clipping Parameters

start

Specify where the video clip should start.

Non-negative float or timecode

none

finish

Specify where the video clip should end.

Non-negative float or timecode

none

duration

Specify the duration of the video clip.

Positive integer

none

Output Audio Channel Parameters

id

Specify the output channel ID.

Channel number or one of these channel names:
FL — front left
FR — front right
FC — front center
LFE — low frequency
BL — back left
BR — back right
FLC — front left-of-center
FRC — front right-of-center
BC — back center
SL — side left
SR — side right
TC — top center
TFL — top front left
TFC — top front center
TFR — top front right
TBL — top back left
TBC — top back center
TBR — top back right
DL — downmix left
DR — downmix right
WL — wide left
WR — wide right
SDL — surround direct left
SDR — surround direct right
LFE2 — low frequency 2

none

Input Audio Channel Parameters

id

Specify input audio channel ID.

Set of 3 non-negative integer numbers separated by colon sign
e.g. F:S:C
Where

  • F – File index (index of <url /> param in <source /> block)
  • S – Stream index in source file
  • C – Channel index in audio stream

none

gain

Sepcify the input audio channel gain level.

Float positive number from 0 to 1

none