1

i have multiple mp4 file (i already converted it into .ts) and while concat i am missing the audio synch. I mean it just push the audio track together.

say i have four .mp4 file where 2 of them doesn't have audio track (because those are image based video clip). when i try to concat using below code, the output is totally different where the audio of 4.ts starts playing when video of 2.ts start or in other words the audio files are left-aligning and i guess there is something i need to play with -map but not sure how to fix it.

ffmpeg -i "concat:1.ts|2.ts|3.ts|4.ts" -c copy -bsf:a aac_adtstoasc output.mp4

concat issue

2
  • feels like a bug in the concat demuxer, maybe report it as an ffmpeg trac...
    – rogerdpack
    Commented Jan 25, 2016 at 16:42
  • 1
    @rogerdpack This is the concat protocol, not the concat demuxer.</nitpicker>
    – llogan
    Commented Jan 26, 2016 at 17:50

1 Answer 1

2

Recreate your MP4s without audio to a TS with dummy audio

ffmpeg -i 2.mp4 -f lavfi -i anullsrc -c:v copy -c:a aac -shortest 2.ts
3
  • Thanks this works 95%. But i have other issue where the audio is not synch to the video. I mean the 4th video audio starts little bit earlier. I guess there is some bitrate issue or something which cause this and i guess i need to first create all the mp4 with same bitrate and need your help
    – Balajee
    Commented Jan 22, 2016 at 5:32
  • For the videos with pre-existing audio, run ffmpeg -i input.ts -c:v copy -af apad -shortest output.ts and then do concat.
    – Gyan
    Commented Jan 22, 2016 at 11:20
  • 1
    @user961190 Also making sure the filler audio has the same audio sample rate as the others may be worth trying, such as anullsrc=r=44100.
    – llogan
    Commented Jan 26, 2016 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .