Preparing Content for Streaming
End-user devices vary in the supported content formats they can handle. Below are guidelines to help you prepare content for the following devices:
- STB SmartLabs
- Tablets with iOS 9.0 and later
- Tablets with Android 5 and later
- Smart TV LG WebOS 3.0 and later
- Smart TV Samsung Tizen
- Chrome Browser
Due to potential limitations in content support across devices, we offer two sets of requirements and profiles below: High-quality settings and Universal settings.
Common Requirements
- Media must have keyframes (note: not all I-frames can be keyframes).
- Closed GOP (frames of one GOP should not refer to frames of another GOP).
- Aligned GOP between bitrates of one channel (i.e. I-frames must be at the same position in the stream for all bitrates of one channel).
- Maximum number of reference frames (ref frames) — 4 (for streams with B-frames — 2).
- The bitrate within one GOP should not exceed the average bitrate (in ffmpeg terminology, bitrate == maxrate with a buffer size of one GOP).
- Progressive scan.
HD Content
High Quality Settings
(will not be supported on some LG SmartTV models)
- bitrate — up to 6Mbps
- frame rate — 50Hz
- Progressive scan
- I-frame repetition rate — 100 frames
- VBV buffer — up to 12Mbit
Example of FFmpeg Launch String (50p with 2 profiles)
Bash (Unix Shell) |
#!/bin/bash INPUT=”udp://@10.65.0.1:5500″ OUTPUT1=”10.65.0.2:1234″ OUTPUT2=”10.65.0.3:1234″ AUDIOOPTS=”-strict experimental -dts_delta_threshold 1000 -acodec aac -ac 2 -isync -af aresample=async=100 -ab 192k” ffmpeg -threads 2 -y -re -i “$INPUT?fifo_size=5120000&buffer_size=10485760&overrun_nonfatal=1” -filter_complex “[0:v]yadif=1,split=2[vout1][s2]; [s2]scale=-2:720[vout2]” -map 0:a -map “[vout1]” $AUDIOOPTS -c:v libx264 -g 100 -keyint_min 100 -sc_threshold 0 -b:v 5500k -maxrate 5500k -preset fast -bufsize 11000k -f mpegts “udp://@${OUTPUT1}pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” -map 0:a -map “[vout2]” $AUDIOOPTS -c:v libx264 -g 100 -keyint_min 100 -sc_threshold 0 -b:v 3300k -maxrate 3300k -preset fast -bufsize 6600k -f mpegts “udp://@${OUTPUT2}?pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” |
Universal Settings
- Bitrate — up to 4.5Mbps
- Frame rate — 25Hz
- Progressive scan
- I-frame repetition rate — 50 frames
- VBV buffer — 9Mbit
Example of FFmpeg Launch String (25p with 2 profiles)
Bash (Unix Shell) |
#!/bin/bash INPUT=”udp://@10.65.0.1:5500″ OUTPUT1=”10.65.0.2:1234″ OUTPUT2=”10.65.0.3:1234″ AUDIOOPTS=”-strict experimental -dts_delta_threshold 1000 -acodec aac -ac 2 -isync -af aresample=async=100 -ab 192k” ffmpeg -threads 2 -y -re -i “$INPUT?fifo_size=5120000&buffer_size=10485760&overrun_nonfatal=1” -filter_complex “[0:v]yadif=0,split=2[vout1][s2]; [s2]scale=-2:720[vout2]” -map 0:a -map “[vout1]” $AUDIOOPTS -c:v libx264 -g 50 -keyint_min 50 -sc_threshold 0 -b:v 4500k -maxrate 4500k -preset fast -bufsize 9000k -f mpegts “udp://@${OUTPUT1}pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” -map 0:a -map “[vout2]” $AUDIOOPTS -c:v libx264 -g 50 -keyint_min 50 -sc_threshold 0 -b:v 3000k -maxrate 3000k -preset fast -bufsize 6000k -f mpegts “udp://@${OUTPUT2}?pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” |
SD Content
High Quality Settings
(will not be supported on some LG SmartTV models)
- Bit rate — up to 3.5Mbps
- Frame rate — 50Hz
- Progressive scan
- I-frame repetition rate — 100 frames
- VBV buffer — up to 7Mbit
Example of FFmpeg Launch String (50p with 2 profiles)
Bash (Unix Shell) |
#!/bin/bash INPUT=”udp://@10.65.0.45:5500″ OUTPUT1=”10.65.0.31:1234″ OUTPUT2=”10.65.0.96:1234″ AUDIOOPTS=”-strict experimental -dts_delta_threshold 1000 -acodec aac -ac 2 -isync -af aresample=async=100 -ab 192k” ffmpeg -threads 2 -y -re -i “$INPUT?fifo_size=5120000&buffer_size=10485760&overrun_nonfatal=1” -filter_complex “[0:v]yadif=1,split=2[vout1][s2]; [s2]scale=-2:480[vout2]” -map 0:a -map “[vout1]” $AUDIOOPTS -c:v libx264 -g 100 -keyint_min 100 -sc_threshold 0 -b:v 3300k -maxrate 3300k -preset fast -bufsize 6600k -f mpegts “udp://@${OUTPUT1}pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” -map 0:a -map “[vout2]” $AUDIOOPTS -c:v libx264 -g 100 -keyint_min 100 -sc_threshold 0 -b:v 1800k -maxrate 1800k -preset fast -bufsize 3600k -f mpegts “udp://@${OUTPUT2}?pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” |
Universal Settings
- Bit rate — up to 2Mbps
- Frame rate — 25Hz
- Progressive scan
- I-frame repetition rate — 50 frames
- VBV buffer — 4Mbit
Example of FFmpeg Launch String (25p with 2 profiles)
Bash (Unix Shell) |
#!/bin/bash INPUT=”udp://@10.65.0.45:5500″ OUTPUT1=”10.65.0.2:1234″ OUTPUT2=”10.65.0.3:1234″ AUDIOOPTS=”-strict experimental -dts_delta_threshold 1000 -acodec aac -ac 2 -isync -af aresample=async=100 -ab 192k” ffmpeg -threads 2 -y -re -i “$INPUT?fifo_size=5120000&buffer_size=10485760&overrun_nonfatal=1” -filter_complex “[0:v]yadif=0,split=2[vout1][s2]; [s2]scale=-2:480[vout2]” -map 0:a -map “[vout1]” $AUDIOOPTS -c:v libx264 -g 50 -keyint_min 50 -sc_threshold 0 -b:v 2800k -maxrate 2800k -preset fast -bufsize 5600k -f mpegts “udp://@${OUTPUT1}pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” -map 0:a -map “[vout2]” $AUDIOOPTS -c:v libx264 -g 50 -keyint_min 50 -sc_threshold 0 -b:v 1200k -maxrate 1200k -preset fast -bufsize 2400k -f mpegts “udp://@${OUTPUT2}?pkt_size=1316&buffer_size=131070&reuse=1&ttl=32” |
High quality streams and streams with universal settings can be combined in one channel (playlist) as adaptive bitrate streams. Streaming of different profiles depending on the type/model of the client device (for example, stream both profiles on STB and stream only the universal profile on LG) will be implemented in future versions of SmartLabs software.