lundi 2 février 2015

FFmpeg encoding an audio file which consists of 2 concatenated clips from Quicktime loses audio sync

I have 2 small 20 second video clips which I concatenate into one mp4 file using Quicktime. The result plays fine in VLC with the audio in sync.


Now I want to encode this using ffmpeg into some other format. When I do this, the result plays fine, but as soon as the playback reaches the 20th second, the audio and video go out of sync.



ffmpeg -i in.mp4 -r 25 -map 0 -map -0\:d -map -0\:s -f mp4 -codec:a libfdk\_aac -ar 44100 -b:a 128000 -codec:v libx264 -b:v 512000 -maxrate 512000 -bufsize 512000 -bt 1200000 -async 2 -coder 0 -g 30 -level 30 -partitions \+parti4x4\+partp8x8\+partb8x8 -qmax 51 -qmin 10 -rc_eq blurCplx\^\(1-qComp\) -trellis 1 -preset veryfast -threads 3 -vf \[in\]\ scale\=iw\*min\(320\/iw\\\,180\/ih\)\:ih\*min\(320\/iw\\\,180\/ih\)\,pad\=320\:180\:\(320-iw\)\/2\:\(180-ih\)\/2\:0x00000000\ \[out\] -metadata:s:v:0 rotate\=0 out.mp4


Has anybody experienced anything similar and has a few pointers?


I have also tried ffmpeg's async: 1, -coptyts, asyncts: compensate options and a couple more and they all don't help.


Thank you in advance for any pointers.


Aucun commentaire:

Enregistrer un commentaire