UDP Multicast with Constant Bitrate
Flussonic Media Server offers a feature of sending video by multicast with a constant video bitrate.
- Flussonic can keep a constant bitrate in an output video stream and also to adjust the bitrate automatically
- Flussonic can prepare the MPTS output (multi-program transport stream).
Flussonic supports advanced MPTS settings:
How to configure UDP multicast push
Sending a stream to UDP multicast is configured as follows:
stream tvchannel {
input udp://239.171.0.1:1234;
push udp://239.172.0.1:1234 bitrate=3200 vb=2720;
}
A constant bitrate will occur also without bitrate
and vb
:
stream tvchannel {
input udp://239.171.0.1:1234;
push udp://239.172.0.1:1234;
}
The bitrate
and vb
are optional parameters. If you don't specify them, Flussonic will calculate a suitable bitrate automatically and send a stream with the calculated constant video bitrate. You may want to specify them in order to get a constant bitrate immediately when starting a stream, then Flussonic will check the optimality of the specified values. If you specify non-optimal bitrate
andvb
, Flussonic will adjust them for the real video stream itself.
The option vb
(video bitrate) is the average bitrate per second that you can send of a video stream, including all the headers and encapsulation in the transport stream. So, for example, the value of vb=2720
approximately corresponds to the bitrate 2600 specified in the transcoder settings.
Before sending a stream to client devices (TV), the input stream is transcoded and then pushed to UDP with a constant bitrate.
A reference example of the transcoder configuration:
stream tvchannel {
input udp://239.171.0.1:1234;
transcoder vb=2600k bf=3 open_gop=true rc_method=cbr vui_video_params=0:0:5:5:5 fps=25 g=28 interlace=tff_separated level=3 refs=4 sar=16:11 size=1048x576:scale external=false hw=qsv ab=192k acodec=mp2a;
push udp://239.172.0.1:1234 bitrate=3200 vb=2720;
}
The transcoding options are described in transcoder settings reference.
Results
The resulting stream with a constant bitrate is represented as follows on the graphs of the DVB analyzer:
Most importantly, the buffer graph looks perfect:
What is this buffer? It is CPB, coded picture buffer, that is, this is a frame buffer. It is replenished when frames come from the transport stream and is deleted when PCR >= DTS occurs. That is, each frame has a DTS and this frame will be kept in the buffer until the time comes to send it to the decoder. The time comes when the corresponding PCR arrives.
Also pay attention to the good quality of packets distribution:
The more evenly the distribution, the more stable the PCR and the overall bitrate will be when one of the PIDs is removed from the stream.
That is not all. We have achieved the challenging goal — creating an output MPTS stream (multiprogram transport stream).