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

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


Hi,

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

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 
bbb-1080p.m3u8

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

https://dev.edman007.com/~edman007/pub/hls-bug/ff/h264-test/bbb-1080p.m3u8

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

     https://dev.edman007.com/~edman007/pub/hls-bug/vids/prog_index.m3u8

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

https://dev.edman007.com/~edman007/pub/hls-bug/ff/h264-no-audio-full/bbb-1080p.m3u8

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



More information about the ffmpeg-user mailing list