Akhil Sekharan
Akhil Sekharan

Reputation: 12693

FFMpeg : Falied to combine two MPEG TS files into a Single MP4 File

I'm trying to combine 2 .ts files in to a single .mp4 file here using FFMpeg. I need to make the concat dumuxer method working in order to use it in my Android App. In my android app the concat protocol is not recognized. So I'm trying the concat demuxer method.

The concat protocol works fine in my windows pc :

ffmpeg -i "concat:s1.ts|s2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

But, the concat demuxer is not working in my windows pc :

ffmpeg -f concat -i s1.ts -i s2.ts -c copy -bsf:a aac_adtstoasc output2.mp4

Error : 
[concat @ 0000000000516e00] Line 1: unknown keyword 'G@'
s1.ts: Invalid data found when processing input

enter image description here

There are the files used for the testing: http://fourbigbrothers.com/s1.ts And http://fourbigbrothers.com/s2.ts

Pls help. I've been chewing my brains lately.

Upvotes: 1

Views: 1699

Answers (1)

Gyan
Gyan

Reputation: 93309

The concat demuxer requires a text file as input, which contains the names of the videos in the following format:

file 's1.ts'
file 's2.ts'

And the command will be

ffmpeg -f concat -i list.txt -c copy -bsf:a aac_adtstoasc output2.mp4

Upvotes: 4

Related Questions