Limitations of HLS Sources for Broadcasting Networks

A common issue faced when retransmitting HLS streams to broadcasting networks, such as satellite, cable, terrestrial, or UDP multicast, is the occurrence of various artifacts like pixelation, sound drifts, and clicks. Interestingly, these streams perform well when played on a PC. Often, engineers place the blame on the headend manufacturer; however, to truly understand the root of the problem, it is essential to examine the characteristics of video encoding.

Video Encoding

Video Encoding is the process of compressing video data for efficient storage and transmission. Video streams are split into frames:

  • Keyframe (I-frame) - contains the entire picture
  • Subsequent frames (P-frames and B-frames) - only changes relative to the previous frame

Stream Bitrate

The delivery of each frame within a specific timeframe is crucial for ensuring smooth playback and proper synchronization of audio and video in broadcasting networks. To achieve this, video streams must be encoded with a higher average bitrate to maintain a predictable and uniform bitrate. Balancing the GOP size and encoding quality is essential for maintaining a consistent bitrate and achieving optimal visual quality in video streams intended for broadcasting purposes.

Stream encoded for Broadcasting

In contrast to broadcasting networks, HLS (HTTP Live Streaming) handles variable bitrates more effectively, as data is transmitted in segments containing multiple seconds of video (typically 3 seconds or more). As a result, HLS can handle larger GOP sizes, achieving better video quality with a lower average bitrate.

Stream encoded for HLS

The chart illustrates that the Stream encoded for HLS has a low average bitrate of only 2 Mbps, but it also has peaks reaching up to 6 Mbps.

HLS flexibility does not translate well to broadcasting networks, which require a consistent and predictable bandwidth for stable transmission and playback. Thus, when working with HLS streams and broadcasting systems, it is essential to consider the differences in bitrate requirements and adjust encoding parameters accordingly to ensure stable transmission and playback.

Bitrate Peaks and UDP Broadcasting

Bitrate peaks can also pose problems for UDP broadcasting. Most consumer devices, such as set-top boxes (STBs) and TVs, have limited network buffers for receiving UDP packets. When many packets arrive in a short time due to bitrate peaks, the device's network buffer may become overwhelmed, resulting in packet loss.

Solution

For streams with moderate bitrate deviation, you can enable the CBR (Constant Bitrate) feature in Astra's output settings. This feature helps distribute large keyframes over time and appends empty TS packets to maintain a consistent bitrate.

However, for some streams, transcoding may be necessary to adapt them for broadcasting. Consider the following adjustments to ensure better compatibility with broadcasting networks:

  • Reducing the GOP size: Opt for a smaller GOP size (around 30 frames) to achieve better quality in motion scenes and minimize the difference between average and peak bitrates
  • Lowering the picture quality: While this may result in a slight decrease in overall video quality, it helps to reduce the bitrate and maintain a more consistent streaming experience
  • Enabling video interlacing: Interlaced video can provide smoother motion scenes and better overall image quality compared to progressive video, especially in a broadcasting context