Reputation: 397
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?
Upvotes: 2
Views: 3745
Reputation: 11
this problem can be solved by concat protocol
first turn input m3u8 file to a ts list file
grep -e '^http.*.ts$' input.m3u8 | awk '{print "file", $1}' > all.ts
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
Upvotes: 1
Reputation: 945
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
Upvotes: 1