Stream Operators
The following operators can be applied to a video, audio or subtitle stream.
| Property | Type | Description |
|---|---|---|
select | object | Maps an input track to a media stream. |
route | object | Routes a stream from an input to an output. |
decode | object | Decodes the media stream samples. |
resample | object | Converts the stream to a different sample rate. |
filter | array | Lists the filters applied to the media stream samples. |
encode | object | Encodes the media stream samples. |
layout | object | Maps a media stream to an output track. |
select
selectMaps input container tracks to a video, audio or subtitle stream. For audios stream the operator can select specific audio channels.
| Property | Type | Description |
|---|---|---|
track | integer | Identifies a specific track by number (1-based). |
pid | integer | MPEG-2 transport stream packet identifier that selects a specific elementary stream. |
format | string | Four character code that identifies the media sample format. |
language | string | Two or three character code that identifies the stream language. |
channel | array | Identifies each audio channel. The input stream channels property determines the dimension of the array. The array items are either the input channel number (1 based) or a channel object as described below. |
The channel object identifies a specific input channel. The object supports the following properties:
| Property | Type | Description |
|---|---|---|
label | string | Identifies an audio channel by speaker label. |
program | integer | Identifies an audio channel by program number. |
For example the following composition selects audio channels by channel number:
---
input:
container:
- name: input1
video:
- name: v1
audio:
- name: surround
channels: 6
select:
channel:
- 1
- 2
- 3
- 4
- 5
- 6
- name: stereo
channels: 2
select:
channel:
- 7
- 8{
"input": {
"container": [
{
"name": "input1",
"video": [
{
"name": "v1"
}
],
"audio": [
{
"name": "surround",
"channels": 6,
"select": {
"channel": [
1,
2,
3,
4,
5,
6
]
}
},
{
"name": "stereo",
"channels": 2,
"select": {
"channel": [
7,
8
]
}
}
]
}
]
}
}route
routeThe route operator routes a video, audio or subtitle stream from an input container to an output container. For an audio stream the operator may route specific input channels.
| Property | Type | Description |
|---|---|---|
name | string | Identifies the input stream. |
channel | array | Lists the input channels routed to each output channel. The output stream The array items are either the input channel number (1 based) or a channel object as described below. |
The channel object allows input channels from different streams to be routed to the output. The channel object supports the following properties:
resample
resampleResamples a media stream to the target sample rate.
| Property | Type | Description |
|---|---|---|
speed | object | Speed adjustment expressed as a rational number. |
decode
decodeDecodes the media stream samples using a specific decompressor type.
| Property | Type | Description |
|---|---|---|
type | string | Four character code that identifies the decompressor implementation. |
properties | object | Decompressor configuration properties. |
filter
filterProcesses the stream media samples using a specific filter type.
| Property | Type | Description |
|---|---|---|
type | string | Four character code that identifies the filter implementation. |
properties | object | Filter configuration properties. |
encode
encodeEncodes the media stream samples using a specific compressor type.
| Property | Type | Description |
|---|---|---|
type | string | Four character code that identifies the compressor implementation. |
properties | object | Compressor configuration properties. |
layout
layoutMaps a video, audio or subtitle stream to an output container track. For audio streams the operator can layout each audio channel.
| Property | Type | |
|---|---|---|
track | integer | Specifies the output track (1 based) for this stream. |
channel | array | Specifies the output channel number (1 based) for each audio channel. The output stream channels property determines the dimension of the array. |
Updated 11 days ago
