Skip to content

Prepare a DVB-compatible stream for a single TV channel

Flussonic Media Server can prepare a constant bitrate (CBR) SPTS from any input stream for DVB networks.

Flussonic transcodes the stream on the CPU by default.

Warning

To get a CBR stream at the output of the transcoder, transcode on the CPU rather than on the GPU. Otherwise, due to the limitations of the algorithms embedded in the GPU, you won't get a CBR stream.

Suppose you need to output an SD stream. Here, you will learn how to configure the Flussonic Media Server in the web interface and configuration file.

In the web interface

Step 1. Configure the stream transcoding to CBR

1) At the Streams page, open the stream settings by clicking on the stream name.

2) Move to the Transcoder tab and click Enable Transcoder.

3) In the Audio section, specify the audio track bitrate as 128k and the audio codec as mp2a.

4) In the Video > Track 1, specify the following parameters:

  • GOP size as 28 for 25 FPS
  • bitrate as 2613k, calculated using the following formula: 0.95 × (total stream bitrate − 250)
  • height as 1048 and width as 576 of a playback window for a player
  • resize strategy as scale
  • encoding speed Preset as fast
  • buffer size. In the Extended, add the bufsize key and assign the 2475000 to it. The buffer size is calculated using the following formula: 900 × (total stream bitrate − 250)

5) Apply the settings by clicking Save.

SPTS CBR transcoder settings

Step 2. Send the stream to a multicast group

1) In the stream settings, go to the Output tab in the Push live video to certain URLs section and specify the multicast group address as follows: udp://239.172.0.1:1234.

2) Go to the output stream settings by clicking Options. Specify the average bitrate of the video track, including headers and encapsulation (Video bitrate) and the total stream bitrate (TS Bitrate). The average bitrate of the video track is calculated using the following formula: total stream bitrate − 250.

3) Apply the settings by clicking Save:

SPTS CBR push udp settings

Step 3. Ensure that everything works

Use a tool, such as DVB Inspector (see Checking the stream quality in the DVB Inspector) or any other analyzer that checks the stream for compliance with the ETSI TR 101 290 standard.

In the configuration file

1) In the stream settings, add transcoder and configure it as follows:

stream spts-cbr {
  input file://vod/bunny.mp4;
  transcoder gop=28 vb=2613k bufsize=2475000 preset=fast size=1048x576:scale ab=128k acodec=mp2a;
}

Here:

  • gop=28 is the GOP size for 25 FPS;
  • vb=2613k is the video bitrate, calculated using the following formula: 0.95 × (total stream bitrate − 250);
  • bufsize=2475000 is the buffer size in bits calculated using the following formula: 900 × (total stream bitrate − 250);
  • preset=fast is an encoding speed;
  • size=1048x576:scale is the size of a playback window for a player, and scale is the strategy for resizing frames, where the image is fitted into the specified size without maintaining proportions.
  • ab=128k is the audio bitrate;
  • acodec=mp2a is the audio codec.

2) In the stream settings, add push and specify the multicast group address (udp://239.172.0.1:1234), the total stream bitrate (bitrate), and the average video bitrate, including headers and encapsulation (vb): push udp://239.172.0.1:1234 bitrate=3000 vb=2750. The average video bitrate is calculated using the following formula: (total stream bitrate − 250).

3) Ensure that everything works. To do this, use a tool, such as DVB Inspector (see Checking the stream quality in the DVB Inspector) or any other analyzer that checks the stream for compliance with the ETSI TR 101 290 standard.

Checking the stream quality in the DVB Inspector

1) Record a couple of minutes of a stream using the following command on the terminal: /opt/flussonic/contrib/multicast_capture.erl udp://239.172.0.1:1234 spts-cbr-output.ts. Finish recording by pressing Ctrl+C.

2) Download the resulting segment spts-cbr-output.ts to the local machine.

3) Check the stream segment quality in the в DVB Inspector.

DVB Inspector SPTS CBR BitRate View

DVB Inspector SPTS CBR BitRate View bad ex

As a result, you get the CBR SPTS, which can be transmitted to a QAM modulator and sent over cable, terrestrial, or satellite networks.

Note

The default step value in DVB Inspector (View > Filter > Steps) smooths out the bitrate of separate PIDs over long durations of segments. It means that the longer the duration of the recorded stream segment, the smoother becomes the bitrate of separate PIDs. For instance, if you record 10 minutes of a stream and open it in the DVB Inspector, you will see a smooth graph with consistent bitrates for separate PIDs. If you set the step to 500 on the same segment, you will notice slight fluctuations in the bitrates of separate PIDs. These minor fluctuations (around one Kbps) don't affect the outcome, and the stream remains CBR.