[FFmpeg-user] Struggling to convert mp4 to HLS with Constant Bit Rate and Constant Frame Rate

andrei ka andrei.k.gml at gmail.com
Sat Oct 31 21:10:23 EET 2020


1) use 30 fps, who cares about ntsc fps in web universe today ? u'd
set segment_time = N*hls_time and not ask to do crazy 6.06 & 6 at the
same time ;

2) use more understandable -force_key_frames
"expr:eq(mod(n,CHUNK_SIZE_IN_FRAMES),0)" (you seem to segment to 2s
chunks = > CHUNK_SIZE_IN_FRAMES = 6),

with this opt you can use scenecut !=0, as you control idr placement,
scenecut will only add i frames ;

3) set audio bitrate ;

4) strict -2 is useless (imho) ;

5) ffmpeg is lame in respecting cbr... for cbr on ts add -x264-params
"nal-hrd=cbr" for it (as you're not using mp4 segments)

6) ffmpeg 4+ has nicer opts for hls segmenting...

&rei


More information about the ffmpeg-user mailing list