The following briefly describes how to use the MainConcept MPEG-2 TS Broadcast Delivery plug-in for FFmpeg. The plug-in can also be used in combination with other MainConcept Video Encoder plug-ins for FFmpeg.
Supported video formats | Supported audio formats | Supported subtitles formats |
- AVC/H.264
- HEVC/H.265
- MPEG-2
|
|
|
The command line format should follow the structure below, depending on which operating system you are using.
On Windows
ffmpeg <ffmpeg-params> \
-f omx_ts_mux \
-omx_core omxil_core.dll -omx_name OMX.MainConcept.mux_mp2.other \
-omx_format_param "<mc-general-params>" \
[MP2M Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>
Below is a basic command-line example:
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other ffmpeg_omx_res.ts -y
The following is a command line using a configuration file:
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other -omx_format_param "cfg_file_path=mp2m_config.ini" ffmpeg_omx_res.ts -y
On Linux
- Note
- The modified FFmpeg executable is installed in
/opt/mainconcept/ffmpeg-omx/bin/
. Ensure this folder is in your search path for the following examples.
ffmpeg <ffmpeg-params> \
-f omx_ts_mux \
-omx_core libomxil_core.so -omx_name OMX.MainConcept.mux_mp2.other \
-omx_format_param "<mc-general-params>" \
[MP2M Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>
Below is a basic command-line example:
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other ffmpeg_omx_res.ts -y
Here is a command-line example using a configuration file:
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other -omx_format_param "cfg_file_path=mp2m_config.ini" ffmpeg_omx_res.ts -y
omx_format_param parameters (mc-general-params)
All settings below are optional parameters for omx_format_param (mc-general-params):
Function | Description |
cfg_file_path | Specifies the path to the MPEG-2 TS Multiplexer configuration file containing all parameters for encoding.
-omx_format_param "cfg_file_path=mp2m_config.ini" |
[MP2M Settings] | This option is not yet supported. All MainConcept MPEG-2 TS Multiplexer settings (see Parameters) can only be modified via a configuration file. Some MPEG-2 TS Multiplexer configuration files come with the installer as an example. |
Command line examples
- Note
- The command line examples below are Windows specific. To run examples on Linux, you must slightly modify them. Instead of
-omx_core omxil_core.dll
, you need to specify -omx_core libomxil_core.so
on Linux.
ffmpeg -i source_avia.mp4 -t 10 -map 0:a:0 -c:a:0 aac -map 0:v:0 -c:v:0 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other 438724183_output.ts -y
ffmpeg -i avc_es.h264 -i aac_es.aac -c copy -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other ffmpeg_omx_res.ts
ffmpeg -t 10 -i sources/EXTREMED002_12Mbps_1920x1080.mkv -c:v omx_enc_avc -c:a ac3 -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1.5M -b:a 192k -omx_param:v "[AVC Settings]:hrd_maintain=1" -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other 438914786_output.ts -y
ffmpeg -t 10 -i EXTREMED002_12Mbps_1920x1080.mkv -c:v omx_enc_avc -c:a aac -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1.5M -b:a 192k -omx_param:v "[AVC Settings]:hrd_maintain=1" -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other 438914786_output.ts -y
ffmpeg -i source.mp4 -t 10 -map 0:a:0 -c:a:0 aac -map 0:v:0 -c:v:0 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other 438724183_output.ts -y
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other ffmpeg_omx_res.ts -y
ffmpeg -i source.mkv -c:v omx_enc_avc -an -omx_name:v OMX.MainConcept.enc_avc.video -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other output.ts -y
ffmpeg -i source.mkv -c:v omx_enc_avc -an -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1.5M -omx_param:v "[AVC Settings]:hrd_maintain=1" -f omx_ts_mux -omx_core libomxil_core.so -omx_format_name OMX.MainConcept.mux_mp2.other output.ts -y
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other ffmpeg_omx_res.ts -y
ffmpeg -i input.mp4 -c:v omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1M -omx_param:v "[AVC Settings]:hrd_maintain=0" -c:a aac -b:a 192k -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other res.ts -y
ffmpeg -i input.mp4 -c:v omx_enc_avc -c:a aac -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1.5M -b:a 192k -omx_param:v "[AVC Settings]:hrd_maintain=0" -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other -omx_format_param "cfg_file_path=D:\mp2m_conf.ini" res.ts -y
ffmpeg -i avc_es.h264 -i ac3_es.ac3 -c copy -c:v omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -b:v 1.5M -omx_param:v "[AVC Settings]:hrd_maintain=0" -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other -omx_format_param "cfg_file_path=D:\mp2m_conf.ini" res.ts -y
ffmpeg -i source_avia.mp4 -c copy -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other -omx_format_param "cfg_file_path=Test1.ini:mapping=[v:0]=[video]:[a:0]=[audio]" output.ts -y
Map two video and two audio tracks
ffmpeg -i input.mp4 -t 10 -map 0:a:0 -c:a:0 aac -map 0:a:0 -c:a:1 aac -map 0:v:0 -c:v:0 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -map 0:v:0 -c:v:1 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other res.ts -y
ffmpeg -i input.mp4 -map 0:a:0 -c:a:0 aac -map 0:a:0 -c:a:1 aac -map 0:v:0 -c:v:0 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -map 0:v:0 -c:v:1 omx_enc_avc -omx_name:v OMX.MainConcept.enc_avc.video -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other res.ts -y
ffmpeg -i source.mp4 -i sub.idx -c:v copy -c:a copy -c:s dvbsub -f omx_ts_mux -omx_core omxil_core.dll -omx_format_name OMX.MainConcept.mux_mp2.other -metadata:s:s:0 language=GER -omx_format_param "cfg_file_path=cfg.ini:mapping=[v:0]=[Stream 0]:[a:0]=[Stream 1]:[s:0]=[Stream 2]" output.ts -y
Parameters
The MainConcept MPEG-2 TS Broadcast Delivery plug-in for FFmpeg comes with some sample configuration (*.ini) files that cover the following encoder settings and parameters. You can modify them manually in a normal text editor and pass them to FFmpeg via -omx_format_param "cfg_file_path=<...>"
.
- Note
- It is also possible to create additional MPEG-2 TS Multiplexer configuration files using TotalCode Studio (https://www.mainconcept.com/products/for-professionals/vod-transcoding/totalcode-studio.html). In the application, select a desired AVC/H.264 preset and then export the settings within the configuration file. Navigate to File > Export > Target Settings and specify a name for the *.ini file. The
"<...>.video.ini"
file can now be used in the FFmpeg plug-in.
[MP2M Settings]
MP2M settings are covered under the following:
mp2muxer_set_struct
mplex_type
- Specifies the output stream type.
- 2: Generic MPEG-2 Transport Stream
- 8: DVB
- 11: ATSC Terrestrial
- 12: ATSC High Terrestrial (high data rate)
sectors_delay
- Timestamp of the first MPEG pack. Specifies the starting value of the SCR/PCR in milliseconds. The default value is 0 which automatically computes a value.
video_delay_ms
- Deprecated. Use the
delay_ms
parameter under mp2mux_stream_set_struct
.
audio_delay_ms
- Deprecated. Use the
delay_ms
parameter under mp2mux_stream_set_struct
.
sector_size
- Specifies the size in bytes for the Transport Stream packets. For Transport Streams the default value is 188 or 192 depending on the profile.
packets_per_pack
- Deprecated. Do not use this parameter anymore.
extra_padding_packs
- Specifies the number of extra padding packets per second to add to a transport stream. The default value is 0.
user_mux_rate_bps
- Specifies the required bitrate of the multiplexed output stream (in bits per second units). If this field is 0, the mux rate is determined depending on the bitrate values of the input streams. For some profiles, the defaults for this field will have a value, for other profiles it will be 0.
vcd_audio_pad
- Specifies whether VCD audio sectors are zero padded to 2324 bytes or left at 2304 bytes. Some VCD authoring software expects the padding to be present and some do not. If an authoring program does not accept files made with this option enabled, disable it and they should be accepted.
- 0: Do not pad VCD audio sectors
- 1: Pad VCD audio sectors (default in the VCD profile)
align_sequence_headers
- Deprecated. Do not use this parameter anymore.
put_private2
- Specifies whether the DVD navigation packs contain the DVD PCI and DSI information or whether they contain two padding packets. This field should be set to 1 for DVD compliant multiplexing. It is ignored when multiplexing MPEG-2 to Transport Streams.
- 0: Use padding packets (default in all non-DVD profiles)
- 1: Private 2 packets (default for the DVD profiles)
frame_timestamps
- Specifies which frames will have PTS/DTS timestamps.
- 0: All frames (default for non-DVD profiles)
- 1: IP frames only
- 2: I frame only (default for DVD profiles)
VBR_multiplex
- Specifies whether the multiplexer operates in variable or constant mux rate mode. This parameter enables or disables the generation of 0x1FFF padding packets for TS and 0xBE padding packets for PS. In constant mux rate mode, padding packets are generated (if needed) to keep the mux rate constant; in variable mux rate mode, no padding packets are generated.
- 0: Constant mux rate (default)
- 1: Variable mux rate
- Note
- Disabling padding can affect the STD modelling by receiver. The streams generated in VBR mode will likely fail the STD verification procedure.
mux_SVCD_scan_offsets
- Compute SVCD scan offsets.
max_file_size
- Split the output after every specified size in MB. The default is 0 (no splitting) in all profiles.
feature_flags
- The bit mask of several feature flags. Flags used with
mp2muxer_set_struct::feature_flags
field. The feature_flags
are integer values. You can calculate them by obtaining the hex sum and converting it to a decimal value, e.g.:
MUX_FEATURE_TS_ATS + MUX_FEATURE_TS_AU_INFO + MUX_FEATURE_DISABLE_THREADING =
0x00000001 + 0x00000004 + 0x00000020 = 0x00000025
feature_flags = dec(0x00000025) = 37
- The
feature_flags
are:
MUX_FEATURE_TS_ATS
(0x00000001): Add 4-byte arrival timestamp prefix to all transport stream packets. Only the lower 30 bits of the 4 bytes are used; only the lower 30 bits of the 4 bytes are used the upper 2 bits are set to 0.
MUX_FEATURE_TS_NO_PSI
(0x00000002): No transport stream Program Specific Information (PAT, PMT, etc.) is placed in the transport stream.
MUX_FEATURE_TS_AU_INFO
(0x00000004): AU_information private data as defined by ETSI TS 101 154 V1.7.1 is placed in the transport stream.
MUX_FEATURE_TS_PCR_IFRAMES
(0x00000008): PCR is placed in transport stream packets that contain the start of an I or IDR frame.
MUX_FEATURE_TS_PCR_ALL_FRAMES
(0x00000010): PCR is placed in transport stream packets that contain the start of any frame.
MUX_FEATURE_DISABLE_THREADING
(0x00000020): Do not create a thread for muxing. Muxing is done on input stream threads.
MUX_FEATURE_SPLIT_ON_I_FRAMES
(0x00000040): Split output at an I-frame of the primary video stream.
MUX_FEATURE_SPLIT_START_PSI
(0x00000080): Start split segment with PSI information.
MUX_FEATURE_PACKET_RATE_SMOOTHING
(0x00000100): Enable packet rate smoothing. The feature can be used only if input audio and video streams are CBR.
MUX_FEATURE_TS_PCR_IDR_FRAMES
(0x00000200): PCR is placed in transport stream packets that contain the start of IDR frame only.
reset_clocks
- Not implemented. Do not use this parameter.
write_pec
- Specifies whether a program end code is written at the end of the Program Stream. This field is ignored when muxing into MPEG-2 Transport Stream.
- 0: Do not write program end code (default in DVD and TS profiles)
- 1: Write program end code (default in all non-DVD PS profiles)
write_end_codes
- Not implemented. Do not use this parameter.
set_broken_link
- Not implemented. Do not use this parameter.
ts_write_PSI_only_once
- Write the PSI (PAT, PMT, etc) only once at the beginning of the stream.
- 1: Force the multiplexer to write PAT / PMT only once at the beginning of the stream. This option allows to save output bandwidth.
- 0: Do not write PAT / PMT once at the beginning of the stream. Default in all profiles.
ts_set_disc_indicator
- Sets
discontinuity_indicator
flag at the first TS packet of the generated stream. Valid for TS profiles only.
- 0: Do not set the 'discontinuity_indicator'. Default is 0 in all profiles.
- 1: Sets the 'discontinuity_indicator' of the first TS packet.
deny_missing_streams
- Deny multiplexing if some input does not receive data.
- 0: Do not allow muxing of data when the input buffer is full.
- 1: Allow multiplexing of data when the input buffer is full. This can only be done if EOS is received.
ts_discon_threshold
- Generates a discontinuity if the PCR/DTS difference for all streams is larger than this value (in ms). Use this field to have the multiplexer detect time discontinuities in the input streams. The default is 0 in all profiles, i.e. discontinuity checking is disabled. Otherwise, the value must be > 10s (10000).
initial_delay
- Sets the initial delay (in ms) between the first PCR/SCR and the lowest DTS/PTS. The default 0 means that the multiplexer computes a value.
ignore_std
- Specifies to not use P-STD or T-STD model.
- 0: Do not use P-STD or T-STD model (default is 0 in all profiles)
- 1: Use P-STD or T-STD model
- Note
- Disabling the STD will affect the STD modelling by receiver. The streams generated in this mode will likely fail the STD verification procedure.
max_file_duration
- Splits the output after every specified seconds. The default is 0 (do not split) in all profiles.
ts_write_splice_info
- Enables writing of Splice Points for MPEG-2 Transport Streams (SMPTE 312M).
- 0: Disable writing of Splice Points (default)
- 1: Enable writing of Splice Points
ts_splice_type
- Specifies a splice point type. Should be a value in the range of 0-15 as described in SMPTE 312M-2001 Table 1. Default value is 15 (1111b) - Non-seamless.
mp2muxer_ext_set_struct
This section lists flags for the mp2mux_ext_set_struct.flags
field. The flags are integer values. You can calculate them by obtaining the hex sum and converting it to a decimal value, e.g.:
EXT_PAD_PES_EXTENSION + EXT_PTS_START_OFFSETS =
0x00000080 + 0x00000200 = 0x00000280
flags = dec(0x00000280) = 640
One or more of the EXT_FLAG_
defines:
EXT_OUTPUT_DATA_FOR_XML
(0x00000002): Output video_seq_info_xml
and video_au_info_xml
data.
EXT_PAD_PES_EXTENSION
(0x00000080): Add 3 PES padding bytes to reserve space for a PES extension in the first packet of each stream in a VOBU mplex_type
must be one of the DVD types.
EXT_PTS_START_OFFSETS
(0x00000200): Streaming input PTS start with offset; adjust SCR start accordingly and leave audio PTS untouched.
NIT_PID
- Specifies the network information section PID. Set to 0, the multiplexer computes a value. The value is assigned according to
mplex_type
.
SDT_PID
- Specifies the service description section PID. Set to 0, the multiplexer computes a value. The value is assigned according to
mplex_type
.
EIT_PID
- Specifies the event information section PID. Set to 0, the multiplexer computes a value. The value is assigned according to
mplex_type
. Set it to -1 to disable insertion of EIT tables.
TDT_PID
- Deprecated. Do not use this parameter anymore.
PSI_LIMIT
- Specifies the maximum time interval (in ms) before the PSI other tables are repeated. Set it to 0 to have the multiplexer compute a value. The specified value can be overwritten with the internally assigned value for the output profiles which have strict limitations for PSI repetition rate.
PCR_LIMIT
- Specifies the maximum time interval (in ms) before a new PCR is written. Set it to 0 to have the multiplexer compute a value. The specified value can be overwritten with the internally assigned value for the output profiles which have strict limitations for PCR repetition rate.
network_id
- Specifies the transport stream network ID. If it is set to 0, the multiplexer will compute a value. It corresponds to the
network_ID
field in the Network Information Table (NIT).
transport_id
- Specifies the transport stream ID. If it is set to 0, the multiplexer will compute a value. It corresponds to the
transport_stream_id
field in the Program Association Table (PAT). This is simply a number to identify the transport stream. Some formats require a specific value.
dash_vr_set_struct
atsc_num_of_extra_EITs
- Specifies the number of EXTRA EIT tables to be used (in addition to four default tables automatically generated by the multiplexer). The maximum value is 124 (128 - 4), any greater value will be clamped to 124. The PIDs of these EITs are derived as:
EIT_PID + 4 + 1, EIT_PID + 4 + 2, ..., EIT_PID + 4 + atsc_num_of_extra_EITs
time_offset_struct
num_of_time_offsets
- Count of entries for descriptors of the TimeOffsetTable (TOT).
SDT_repetition_rate
- Specifies the maximum time interval (in ms) before the SDT table is repeated. Set it to 0 to have the multiplexer compute a value.
NIT_repetition_rate
- Specifies the maximum time interval (in ms) before the NIT table is repeated. Set it to 0 to have the multiplexer compute a value.
TOT_repetition_rate
- Specifies the maximum time interval (in ms) before the TOT table is repeated. Set it to 0 to have the multiplexer compute a value.
TDT_repetition_rate
- Specifies the maximum time interval (in ms) before the TDT table is repeated. Set it to 0 to have the multiplexer compute a value.
[Stream 0]
Specify the stream number where the settings below should be applied to.
mp2mux_stream_set_struct
stream_fifo_size
- Specifies the size in bytes of the FIFO being passed to the multiplexer. If the FIFO size is passed, the multiplexer can compute a sufficiently large and more efficient internal FIFO. If the input FIFO size is greater than 1.5MB, it is recommended to set this value to the FIFO size. When setting it to 0, the multiplexer uses a default value.
stream_rate_bps
- If the input media type is private or does not contain any headers (e.g. PCM, subpicture), the bitrate must be specified using this parameter. It is also effective for 'parse-able' video/audio: this parameter is applied with higher priority than the bitrate specified in the bitstream. This is an optional parameter.
delay_ms
- Specifies the stream delay in milliseconds relative to other streams. If set to 0, the stream delay is computed automatically.
id
- Specifies the MPEG stream ID of this stream placed in the PES packet headers. If set to 0, the multiplexer assigns a value. The assigned values start with the lowest available stream number for the given stream type (video streams = 0xE0, MPEG audio = 0xC0). For non-MPEG streams (LPCM, AC-3 or subpicture) this value must be set to 0xBD if it is non-zero.
PES_length
- This option is only available for Transport Stream. If this parameter is enabled, the multiplexer writes a certain value of video PES packet length, instead of writing a zero value. This field is ignored if the
sector_size
field is > 0.
parent_program_PID
- Specifies the PID of the program to which the stream belongs to. The fields value must match the value in the
program_PID
field that is passed to the multiplexer.
flags
- The best way to specify the media type is to use
format_struct
. If this is not possible or format_struct
is not filled at all, this parameter must contain only one of the following:
STREAM_FLAG_VIDEO_STREAM
(0x00010000): The stream is a video stream
STREAM_FLAG_AUDIO_STREAM
(0x00020000): The stream is an audio stream
STREAM_FLAG_SUBPIC_STREAM
(0x00040000): The stream is a subpicture stream
- The flags are integer values. You can calculate them by getting the hex sum and convert it to a decimal value, e.g.:
STREAM_FLAG_VIDEO_STREAM + STREAM_FLAG_AUDIO_STREAM =
0x00010000
flags = dec(0x00010000) = 65536
still_picture_duration
- Specifies the duration of still pictures if the
STREAM_FLAG_STILL_PICTURES
flag is present. The value is the number of frames to display each picture.
PID
- The PID value as defined in 2.4.3.7 of ISO 13818-1. For profiles which restrict the PID values (e.g. AVCHD, Blu-ray), this value is assigned internally by the multiplexer to fit the profile requirements. For such profiles, any incorrectly specified value is replaced with the value regulated by the profile. For the profiles which allow free PID assignment, the default value is 0x3E9 for the first input stream, increasing by 1 for each subsequent stream. If set to 0, the multiplexer computes a value. This is for Transport Streams only.
PSTD_buffer_size
- Specifies the P-STD buffer size of the stream in KB. Set to 0, the multiplexer computes a value. This is for Program Streams only.
sub_id
- Specifies the substream ID of this stream, i.e. the ID of an MPEG PRIVATE stream PES packet. If set to 0, the multiplexer assigns a value. It assigns values starting with the lowest available stream number for the given stream type (LPCM = 0xA0, AC3 = 0x80 and subpicture = 0x20).
shared_mpts_stream_flag
- Set it to 1 to indicate that the stream is shared among all the programs being multiplexed.
cpb_size_bits
- Used to indicate the CPB/VBV size (in bits) of a stream if known. This parameter will override any detected size.
align_in_flag
- Set it to 1 to indicate that the access units for this stream will come in as complete units.
opt_packing_flag
- Set this to 1 to enable packing multiple access units in a single PES packet in Transport Streams or Program Streams with fixed size packets. Use the
opt_packing_count
field to specify the amount of access units in one PES packet.
enhanced_parsing_flag
- Set this to 1 to enable parsing of input stream data when the new data has a valid timestamp.
max_stream_delay
- Specifies the maximum delay (in milliseconds) between the PCR/SCR and PTS/DTS of the stream. The default max delay for audio streams is usually <= 250ms; the default for video streams other than AVC is 1s. The default value for other stream types is 1s.
- The default for AVC streams depends on the CPB size/bitrate ratio. If the CPB size = (max or cbr) bitrate, the max delay will be 1s. If the CPB size is 2x the bitrate, the max delay will be 2s, etc., up to a maximum of 10s. Set this to 0 to have the multiplexer compute a value. Note that if the value is too low, there may be underflows in the stream while multiplexing.
aes_frame_rate_code
- Specifies the frame rate code for AES-302M audio streams. If a video stream is not being multiplexed, or the multiplexer cannot determine a frame rate value for the video stream, a value must be specified in this field. If set to 0, the multiplexer uses the detected value from the video stream.
au_queue_size
- Specifies the parsed access unit queue size. If the stream will potentially have many small access units, it may be necessary to increase this value (start at a value of 1000 and increase from there as needed). Set this to 0 to have the multiplexer automatically compute a value.
overflow_timeout
- Specifies how long an input stream will block for when overflowing and waiting for data from other streams.
- -1: Do not block, return an error
- 0: Use computed value, otherwise the number of seconds to wait
stream_type
- Specifies the
stream_type
that is placed in the PMT or PSM. Set this to 0 to have the multiplexer automatically compute a value.
wrap_field_in_pes
- Specifies whether to wrap each video field in a separate PES packet. This is currently only supported for AVC streams and is not used if the
align_in_flag
setting is enabled.
- 0: The entire video frame is placed in a pes packet
- 1: Each video field is placed in its own PES packet
dd_mainid
- The
mainid
value is placed in the Dolby Digital or Dolby Digital Plus audio descriptors. It is only used with Dolby Digital audio streams. If multiple DD main service audio streams are present in a program, each should be given a unique value (0..7). If this stream is an associated audio stream (flags field contains STREAM_FLAG_ASSOCIATED_AUDIO
), then the field is used to specify the mainid
of the main service audio stream this stream is associated with.
heartbeat_interval
- If set to > 0, this specifies a minimal interval between packets for this PID (in milliseconds). If there is no real data during this period, an empty packet (heartbeat) is inserted.
opt_packing_count
- Specifies the number of access units in a single PES packet if
opt_packing_flag
is specified. For backward compatibility purposes, 0 value will be interpreted as 3.
[Program Settings 0]
Specify the program number where the settings below should be applied to.
mp2mux_ts_program_set_struct
PCR_PID
- Specifies the Transport Stream PID that carries the PCR timestamps for the program. Only the PIDs of streams belonging to the program are allowed. Set this to 0 to have the multiplexer compute a value.
independent_PCR_PID
- This parameter makes it possible to share a PCR PID between programs in Multi-Program Transport Stream. Additionally, to indicate that the PID of a stream belongs to this program, this field can also be used to specify a PID from a stream in other programs in the multiplexer, or any desired user-defined PID which is dedicated to carry the PCR. The
independent_PCR_PID_flag
field must be set to 1 for this field to be used. The valid range is 1 .. 65535 (but not PIDs used for SI tables).
independent_PCR_PID_flag
- A value of 1 indicates that the field
independent_PCR_PID
is valid.
program_number
- Specifies the program_number of this program as defined in ISO 13818-1, 2.4.4.5. Set this to 0 to have the multiplexer compute a value.
program_PID
- Specifies the PID of the Program Map Table (PMT) for this program in the Transport Stream. Set this to 0 to have the multiplexer compute a value.
atsc_source_id
- Specifies the ATSC programming source associated with the virtual channel. In this context, a source is one specific source of video, text, data or audio programming. The source ID value zero is reserved. Source ID values in the range 0x0001 to 0x0FFF should be unique within the Transport Stream that carries the VCT, while values 0x1000 to 0xFFFF should be unique at the regional level. Values for
source_ids
0x1000 and above shall be issued and administered by a Registration Authority designated by the ATSC.
atsc_major_channel
- Specifies the ATSC major channel for this program. The valid range is 0 .. 99. If set to 0, a default value of 1 will be used.
atsc_minor_channel
- Specifies the ATSC minor channel for this program. The valid range is 0 .. 99. If set to 0, a default value of 1 will be used.
atsc_service_type
- Specifies the ATSC service type according to ATSC Table 6.7 a_65b for this program.
atsc_modulation_mode
- Specifies the ATSC modulation mode according to ATSC Table 6.5 a_65b for this program.
DVB_num_of_extra_EITs
- Specifies the number of actual TS, event schedule information EIT tables (table_id's 0x50-0x5F) to be added to the multiplexer for this program. The maximum value is 16; greater values will be clamped to 16. Note that the 'actual TS, present/following event information' table (table_id 0x4E) is automatically added to the multiplexer.