2
votes

I'm trying to concat all chunks in HLS, into a single mp4 file, using ffmpeg. I tried the command: ffmpeg -i -vcodec copy -acodec copy -bsf:a aac_adtstoasc

However, I noticed that if m3u8 contains discontinuity tag, then the concatenation is not work well, i.e. the video stops during all the missing chunks.

Any idea, how to convert so the video play continuously, namely, ignoring the missing chunks?

2
Its discontinuity not disconnectivityszatmary

2 Answers

1
votes

Looks like this is a known issue.

https://trac.ffmpeg.org/ticket/5419

FFMPEG Trac ticket #5419 HLS EXT-X-DISCONTINUITY tag is not supported

1
votes

this problem can be solved by concat protocol

  1. first turn input m3u8 file to a ts list file

    grep -e '^http.*.ts$' input.m3u8 | awk '{print "file", $1}' > all.ts

  2. second use all.ts as input to concat into a mp4 file

    ffmpeg -protocol_whitelist 'http,file,tcp' -nostdin -f concat -safe 0 -i all.ts -c copy -movflags faststart -y output.mp4