[FFmpeg-user] HLS with byterange fMP4 and muxed audio/video

Ed Martin lists at edman007.com
Mon May 31 02:04:36 EEST 2021


     Does anyone have any examples of generating a HLS stream using fMP4 
and byteranges with audio/video muxed into the same file (not separate 

I'm specifically trying to make it work with hls.js, a javascript 
library using the media extensions

Doing some testing, I tried this:

     ffmpeg -i $SRC -c:v h264        -hls_playlist_type vod -hls_flags 
single_file  -hls_segment_type fmp4  \

          -c:a aac -ar 48000 -b:a 192k -crf 20 -g 48 -keyint_min 4 -b:v 
2500k -maxrate 7400k -bufsize 3750k -sc_threshold 0 -hls_time 4 

That works with ffplay, but it still doesn't actually play with hls.js, 
here is that stream:


But note, the apple reference implementation seems to play just fine, I 
can't figure out what I did different:


And just some background, my target goal is to write a program that 
manages security camera streams (an NVR), and does so with an HLS 
interface, so I am actually planning on using libav* to make the audio 
and generate the m3u8 myself. I'm actually getting the same results as 
ffmpeg command (as shown above), so this is really to just identify the 
problem and options I need to generate an appropriate mp4 to play in 
this specific mode.

But no audio (as the Apple ref has it), and full length does work


So what is going on that is messing things up when I add audio?

More information about the ffmpeg-user mailing list