Use format='dvb' to produce DVB-compatible MPEG transport streams with output bitrate smoothing. Both SDKs support this workflow: MPlatform connects a source to MWriter; MFormats submits frames to MFWriter. Configure the destination, transport and encoding options before starting media delivery.
Streaming over UDP
Pass the destination URL separately from the encoding configuration. For example, use udp://239.1.2.3:12345 with:
format='dvb' protocol='udp://' muxrate='7M' video::codec='mpeg2video' video::b='5M' audio::codec='aac' audio::b='128K'Replace the address and port with those required by your receiver. Both multicast and unicast destinations can be used.
DVB-compatible MPEG-TS over RTP
DVB-compatible MPEG-TS over RTP was added in SDK version 2.12.0.14909, as recorded in the MFormats release notes and MPlatform release notes.
Use a destination such as rtp://239.1.2.3:12345 with:
format='dvb' protocol='rtp://' muxrate='7M' video::codec='mpeg2video' video::b='5M' audio::codec='aac' audio::b='128K'This combination applies DVB settings and bitrate smoothing while carrying MPEG-TS inside RTP packets. The ordinary format='rtp_mpegts' mode is described in RTP Streaming.
MPlatform: connect a source to MWriter
This C# setup fragment assumes that m_objWriter is an existing MWriter instance and pSource is a configured source already supplying media, such as a playing MFile or MPlaylist. Configure the writer before connecting it:
string destination = "rtp://239.1.2.3:12345";
string configuration = "format='dvb' protocol='rtp://' muxrate='7M' video::codec='mpeg2video' video::b='5M' audio::codec='aac' audio::b='128K'";
m_objWriter.WriterNameSet(destination, configuration);
m_objWriter.ObjectStart(pSource);MWriter receives media through the connected source. Keep the source and writer alive for the streaming duration. When finished, call m_objWriter.ObjectClose(), then close any source owned by this operation and release the owned COM references.
MFormats: submit frames to MFWriter
This C# setup fragment assumes an existing MFWriter instance. Configure it before submitting the first frame:
string destination = "rtp://239.1.2.3:12345";
string configuration = "format='dvb' protocol='rtp://' muxrate='7M' video::codec='mpeg2video' video::b='5M' audio::codec='aac' audio::b='128K'";
m_objWriter.WriterSet(destination, 1, configuration);In the application-owned frame loop, obtain a frame from the source and submit it to the writer. The following fragment assumes that pFrame is a non-null MFFrame acquired by the caller and that this code owns its COM reference. It requires System.Runtime.InteropServices:
try
{
m_objWriter.ReceiverFramePut(pFrame, 0, "");
}
finally
{
Marshal.ReleaseComObject(pFrame);
}If the frame also goes to other receivers, finish those operations before releasing it. Stop frame submission before calling m_objWriter.WriterClose(0). Close the source and release the writer and source COM references when their owner is finished with them.
Audio PES packetization
A Packetized Elementary Stream (PES) packet carries encoded audio inside the transport stream. pes_payload_size controls the minimum payload used when grouping audio frames into PES packets.
For format='dvb', the default is pes_payload_size='0': each encoded audio frame is sent in its own PES packet. This default applies to the UDP, RTP and SRT DVB profiles. It reduces the delay caused by collecting several audio frames before writing a PES packet.
For example, at 48 kHz an AC-3 frame represents 32 ms of audio, while a typical 1024-sample AAC frame represents approximately 21.3 ms. These are audio frame durations, not guaranteed network packet intervals.
To make the per-frame setting explicit, add this top-level writer option:
pes_payload_size='0'To restore the larger audio grouping used previously, specify:
pes_payload_size='2930'The value is in bytes, not milliseconds. Larger grouping can reduce transport overhead but makes audio delivery more bursty. This DVB default does not change the ordinary format='mpegts' profiles.
Per-frame PES packets add headers and TS packet padding for every audio track. The overhead depends on the codec, bitrate, sample rate and number of tracks; do not budget it as a fixed number of kilobits per second.
Configure the audio tracks actually required
split_channels determines how input channels become output audio tracks. For example, four input channels with split_channels='2' produce two stereo tracks. Adding audio.1::codec configures the second track; it does not create extra input channels.
This configuration fragment assumes four input channels and uses AC-3 for the first stereo track and AAC for the second:
format='dvb' protocol='udp://' muxrate='7M' split_channels='2' pes_payload_size='0' video::codec='mpeg2video' video::b='5M' audio::codec='ac3' audio::b='192K' audio::sample_rate='48000' audio.1::codec='aac' audio.1::b='128K' audio.1::sample_rate='48000'A numbered track without its own codec inherits the base audio settings, while preserving its explicitly supplied attributes. A track with its own codec needs its own codec-specific settings, including sample_rate when a particular rate is required. For DVB output, a track with its own codec but no bitrate receives the base audio bitrate.
Prefer the b spelling consistently. The bitrate synonym takes precedence over b; an inherited audio::bitrate can therefore override a numbered track's b when that track inherits the base codec.
| Option | Type / units | Meaning |
|---|---|---|
split_channels |
Integer: 0, 1, 2, 4, 6 or 8; default 0 | Channels per output track. Zero preserves input track boundaries unless track merging is enabled. The compatibility value true means 1. |
merge_tracks |
Boolean | Combine source audio tracks when an explicit supported channel split is not selected. |
audio::codec, audio.N::codec
|
Codec name | Base audio codec and numbered-track override. The DVB base default is mp2. Use audio::codec='null' to disable audio. |
audio::b, audio.N::b
|
Integer bitrate, bits/s; K and M suffixes accepted | Encoded audio bitrate per track. The DVB base default is 128K. |
audio::bitrate, audio.N::bitrate
|
Bitrate, bits/s | Synonym with precedence over b. Avoid mixing the two spellings. |
audio::sample_rate, audio.N::sample_rate
|
Integer, Hz | Requested encoder sample rate. Without an explicit rate, the encoder selects a supported rate from the input format. |
Bitrate and network timing
muxrate is the MPEG-TS transport-stream bitrate, including media, TS overhead and null-packet padding. It is not simply the sum of the elementary video and audio bitrates.
If no explicit rate is supplied, the DVB writer estimates a rate from the configured video bitrate, every output audio track's estimated PES/TS cost, subtitle allowance and table/PCR allowance. The audio estimate accounts for the selected codec, encoder sample rate, track split and pes_payload_size. Disabled or absent input audio does not contribute an audio budget.
An explicit muxrate can be raised to the calculated minimum if it is too small. It is therefore not a hard upper limit on the resulting stream. Leave room for encoder bitrate variation and your receiver's requirements; a single percentage added to nominal video and audio rates is not a reliable budget for every track layout.
Smaller audio PES packets reduce audio accumulation, but they do not guarantee a maximum audio-PID gap. A large video PES packet can still occupy the output for a substantial interval, and encoder bitrate overshoot can exhaust the available transport capacity. Check audio-PID spacing, PCR timing and receiver behavior with representative content, including transitions and large video frames.
For RTP output, muxrate measures the MPEG-TS payload rate and excludes the RTP header. RTP, UDP, IP and link-layer overhead increase the total network bitrate, so muxrate='7M' does not mean a total network bitrate of exactly 7 Mbit/s.
Keep delivery between the encoder and receiver stable. Network delivery problems can cause PCR and other timing errors at the receiver. Program Clock Reference (PCR) supplies timing information used to synchronize the stream; its required repetition interval depends on the applicable standard and configuration. See ETSI TS 101 154 for further information. Assess timing at the receiver as well as at the encoder, particularly when they are on different networks.
EIT Schedule settings
Use these format-level settings for FFmpeg-backed DVB output with format='dvb'. Enable EIT with a non-negative eit_period. In MPlatform, include the settings in MWriter.WriterNameSet before connecting the source with ObjectStart. In MFormats, include them in MFWriter.WriterSet before submitting frames with ReceiverFramePut. For protocol='rtp://', the settings are forwarded to the nested MPEG-TS muxer.
| Parameter | Default | Description |
|---|---|---|
eit_schedule_period |
10 seconds | Target time for a complete EIT Schedule transmission cycle. This sets the cycle target for the schedule, rather than the Present/Following retransmission interval controlled by eit_period. |
eit_schedule_max_events |
8192 | Maximum number of input Schedule events per service. Accepts integers from 1 to 65536. DVB section capacity still limits the schedule that can be transmitted. |
eit_schedule_max_bytes |
8388608 bytes (8 MiB) | Maximum packed metadata size for a live Schedule update, including accompanying packet metadata. Accepts a positive integer. An oversized live update is rejected and the previous schedule remains in place. This limit does not apply to initial writer metadata and does not bound memory used to prepare the update. |
For initial event fields, live replacement and clearing the schedule, see Insert EPG data into DVB streams.
DVB streaming attributes
The following tables cover the built-in UDP and RTP DVB format options. These are configurable inputs supplied in the writer configuration string, not read-only statistics. Unprefixed names are top-level options; preserve the punctuation in names such as audio::b and muxer.buffer_min. The defaults below describe the built-in profiles; muxrate is subsequently calculated as explained above. SRT connection options are outside these tables.
Transport and packetization
| Name | Type / default | Meaning |
|---|---|---|
muxrate |
Integer, bits/s; 1 selects automatic calculation | Transport-stream bitrate. K and M suffixes can be used, for example 7M. |
pes_payload_size |
Nonnegative integer, bytes; 0 | Minimum audio PES payload. Zero sends each encoded audio frame in its own PES packet. |
mpegts_flags |
Flags; +system_b
|
system_b: DVB System B signaling; resend_headers: reemit PAT/PMT before the next packet; pat_pmt_at_frames: reemit PAT/PMT at each video frame; latm: LATM packetization for AAC. For example, +system_b+pat_pmt_at_frames. |
flush_packets |
Integer: -1, 0 or 1; -1 | I/O flushing after packets: automatic, disabled or enabled respectively. |
Service identification and optional data
| Name | Type / default | Meaning |
|---|---|---|
service_name |
String; MService001
|
Service name. |
service_provider |
String; Medialooks
|
Service provider name. |
transport_stream_id |
Integer, at least 1; 1 | Transport-stream identifier. |
original_network_id |
Integer, at least 1; 1 | Original network identifier. |
service_id |
Integer, at least 1; 1 | Service identifier. |
service_type |
Option; digital_tv
|
Values: digital_tv, mpeg2_digital_hdtv, advanced_codec_digital_sdtv, advanced_codec_digital_hdtv, hevc_digital_hdtv. |
pmt_start_pid |
Integer, 16–7936; 192 | First Program Map Table PID. |
start_pid |
Integer, 256–3840; 1024 | First automatically assigned elementary-stream PID. |
tables_version |
Integer, 0–31; 0 | Version of PAT, PMT, SDT and NIT tables. |
embed_cc |
Boolean; false | Request embedding supplied Closed Captions into supported elementary video streams: MPEG-2 Video, MPEG-4 Part 2, H.264 or HEVC. The option does not generate caption content. |
embed_scte35 |
Boolean; false | For MPEG-TS over UDP, request embedding supplied SCTE-35 triggers. SCTE-35 insertion over RTP is outside the workflow described here. |
scte35_pid |
Integer; -1 | UDP profile: SCTE-35 PID; -1 selects automatic assignment. Explicit assignment applies when there is one SCTE-35 program; multiple SCTE-35 programs use automatic PIDs. |
start_timecode |
Option/string; auto
|
Starting encoding timecode: auto, disabled, local_time, or a value such as 10:00:00:00. |
Timing and output buffering
| Name | Type / default | Meaning |
|---|---|---|
rc_buffers |
Integer; 8 | Buffer-count setting used by the DVB output rate-control queue. It is not a delay in milliseconds. |
rc_sync_msec |
Integer, milliseconds; 1 | Output rate-control timing precision; minimum 1 ms. |
rc_max_underflow_msec |
Integer, milliseconds; 30 | Underflow interval used for output clock correction when the output queue is empty. |
max_delay |
Nonnegative integer, microseconds; 700000 | Maximum multiplexing PTS/PCR delay setting. |
pcr_period |
Integer, milliseconds; 20 | PCR retransmission interval. |
pat_period |
Number, seconds; 0.1 | PAT/PMT retransmission time limit. |
sdt_period |
Number, seconds; 0.5 | SDT retransmission time limit; -1 disables transmission. |
nit_period |
Number, seconds; 9 | NIT retransmission time limit; -1 disables transmission. |
tdt_period |
Number, seconds; 25 | TDT retransmission time limit. Transmission requires DVB mode and a non-negative period. Set tdt_period='-1' to disable TDT independently of EIT. |
eit_period |
Number, seconds; 1.5 | EIT present/following retransmission time limit. With DVB mode enabled and a non-negative period, EIT contains section 0 for Present and section 1 for Following; without configured EPG events both sections contain no event records, and no placeholder event is inserted. The SDT EIT_present_following_flag is 1. Set eit_period='-1' to disable EIT transmission; the SDT EIT flags are then 0. |
dvb |
0 or 1; 1 for format='dvb'
|
DVB mode. format='dvb' supplies dvb='1', also with protocol='rtp://', where it is forwarded to the nested MPEG-TS muxer. An explicit dvb='0' disables EIT and TDT transmission even when their periods are non-negative. |
start_pcr |
Nonnegative number, seconds; 0 | Initial PCR value. |
Additional entries in the writer option list
The UDP/RTP option lists also contain the following queue entries. Their listed sizes do not establish an end-to-end latency. Use the rate-control settings above when configuring DVB output pacing.
| Name | Listed type / default | Listed purpose |
|---|---|---|
muxer.buffer_min |
Nonnegative integer, packets; 5 | Minimum multiplexer queue size before processing. |
muxer.buffer_max |
Nonnegative integer, packets; 10 | Maximum multiplexer queue size. |
resend_headers |
UDP only: integer; 0 | Legacy option-list entry for PAT/PMT repetition. Use the resend_headers flag inside mpegts_flags in the configurations described here, including RTP. |
Still have questions?
Tell us what didn’t work or what you’d like clarified.