Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Please show your complete ffmpeg console output from your ffmpeg command and the contents of filelist.txt. –  LordNeckbeard Dec 25 '13 at 21:25

1 Answer 1

I'm not sure why ffmpeg is giving you an error. However ts is one of the few formats that can simply be concatenated. Then, once you have a single ts, transmux to mp4.

Under windows:

copy \b segment1_0_av.ts+segment2_0_av.ts+segment3_0_av.ts all.ts
ffmpeg -i all.ts -acodec copy -vcodec copy all.mp4

Under bash:

cat segment1_0_av.ts segment2_0_av.ts segment3_0_av.ts > all.ts
ffmpeg -i all.ts -acodec copy -vcodec copy all.mp4
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.