Skip to content

Prepare a DVB-compliant CBR stream for a single TV channel

Taking any Flussonic-supported source, Flussonic Media Server can prepare the SPTS to send to DVB network that requires video signal to fit into the constant bitrate bandwidth. The stream is transcoded on the CPU and packaged in MPEG-TS in compliance with ETSI TR 101 290.

Warning

NVENC transcoding doesn't output stable bitrate (CBR) sufficient for DVB standard requirements. We only offer encoding on the CPU.

Suppose you need to prepare SPTS with Full HD resolution and a total bitrate of 6 700 Kbps, the audio PID — 192 Kbps and the video — 6 100 Kbps from an HLS stream. Here, kilobit is 1000 bits, not 1024. You can configure the Flussonic Media Server via web interface or 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 192k 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 6100k, calculated using the following formula: 0.95 × (total stream bitrate − 250)
  • height as 1920 and width as 1080 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 5805000 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=6100k bufsize=5805000 preset=fast size=1920x1080:scale ab=192k acodec=mp2a;
}

Here:

  • gop=28 is the GOP size for 25 FPS;
  • vb=6100k is the video bitrate, calculated using the following formula: 0.95 × (total stream bitrate − 250);
  • bufsize=5805000 is the buffer size in bits calculated using the following formula: 900 × (total stream bitrate − 250);
  • preset=fast is an encoding speed;
  • size=1920x1080: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=192k 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=6700 vb=6450. 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

You will get the SPTS at a constant bit rate (CBR) that can be transmitted:

  • to a QAM modulator or scrambler to further be sent to the cable network
  • to a multiplexer to prepare MPTS

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.