48
32
I've got a bunch of ts segments described by a single index.m3u8 file:
index.m3u8
segment1_0_av.ts
segment2_0_av.ts
segment3_0_av.ts
segment4_0_av.ts
segment5_0_av.ts
I know they are all encoded the same way. ffprobe gives me the following:
Input #0, mpegts, from 'segment1_0_av.ts':
Duration: 00:00:10.00, start: 0.100511, bitrate: 1251 kb/s
Program 1
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 12.50 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1[0x101]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 105 kb/s
Stream #0:2[0x102]: Unknown: none ([21][0][0][0] / 0x0015)
I'd like to combine them into a single mp4 container. But when I try commands like:
ffmpeg -f concat -i filelist.txt -c copy output.mp4
where the generate the filelist.txt from the index.m3u8 file, it complains about not being able to read various files. But converting the ts files themselves seem to work fine. I think I'm not using ffmpeg properly.
How do I use ffmpeg to combine the ts files described by index.m3u8 into a single mp4 container using the copy codec?
12You may also need
-bsf:a aac_adtstoasc
. – Camilo Martin – 2016-07-03T20:38:22.3431interesting to note that the command is NOT
ffmpeg copy ...
, it iscopy ...
(under Windows) – Ronnie Royston – 2018-04-04T18:07:41.083