r/ffmpeg • • 2h ago

Best H.264 encoder settings for TV broadcast contribution vs. YouTube?

2 Upvotes

I'm configuring a H.264 encoder for two workflows: 20 Mbps TS over SRT for TV broadcast contribution and 4.5 Mbps for YouTube streaming (Same TS, but rewrapped in RTMP)

What settings would you recommend for each use case?

  • GOP structure: i.e.: I, IP, IBP or IBBP
  • GOP size: i.e.:120 frames
  • H.264 profile/level: Baseline, Main or High; Level 3, 3.2 or 4
  • B-frames: Enable for better compression efficiency, or disable for compatibility?
  • Entropy coding: CABAC vs. CAVLC
  • Intra-partitioning: Enable or disable?
  • AAC-LC audio: MPEG-2 ADTS vs. MPEG-4 LOAS/LATM

For broadcast contribution, maximum quality and decoder compatibility are important. Some high-end decoders can be very picky about settings like "true" CBR Transport Stream and other settings.

On the other hand, YouTube takes almost everything and don't really need to push high bitrate or a high profile encoder.

Would you use different encoding settings for each destination, and why?

Note: H.264 is mandatory, can't do HEVC or other codecs.