
For example "-b:v 2M" and "-b:a 192k" for video and audio respectively. The obvious first thing to try for me was to define some bit rates for FFMPEG to work with. For my purpose the maximum bit rate per channel is 5Mbit/sec in order to not overload the muxes/modulators. The command is simplified and since for example no bit rates are defined the resulting stream will be of low quality using the pre-compiled default values of FFMPEG. The size of an MPEG-TS packet is 188 Bytes and 7 of them will fit into an Ethernet frame, 7*188=1316. This will generate an MPEG-TS file but sending the material over UDP requires just replacing "outfile.ts" with "udp://239.253.253.4:1234?pkt_size=1316". # ffmpeg -re -i -vcodec mpeg2video -s 720x576 -r 25 -acodec mp2 -ac 2 -f mpegts outfile.ts Creating a basic PAL MPEG2 TS stream using FFMPEG is quite straight forward. My experiments are based on the latest release of FFMPEG (at the time of writing 0.11.1 "Happiness"). Now let's look into how FFMPEG fits into this picture. Using a buffer in this way is quite common. Similarly a buffer is used on the receiving end to decode the MPEG2 stream. In order to generate a CBR stream a buffer is used to "even out" the variable bit rate into a somewhat constant bit rate. MPEG2 in its initial form will always be a stream with variable bit rate, VBR. But why are people in the TV biz talking about CBR MPEG2? This needed some research and I discovered that my assumption was not totally wrong.

This is a bit odd to begin with since as far as I know there is no such thing as a CBR MPEG2. In the same time the material transferred is in most cases MPEG2 video (at least here in Sweden). I won't go into the details of DVB-T modulation but this is quite reasonable since it is most likely the only way of keeping it in sync and locked. Generating a stable stream without errors and dropouts was definitely harder than I initially thought.ĭVB muxers (or shall we call them modulators?) need to run at a constant bit rate, CBR.

These streams are to be received by Telesté Luminato boxes equipped with DVB-T muxes. The streams are to be created in real-time and encapsulated in MPEG-TS and sent over an Ethernet network using multicast UDP. I have been trying to generate MPEG2 streams using FFMPEG for a cable TV project I'm working on.
