[FFmpeg-user] Automatically crop longer file when merging

Ramit Bhalla ramitbhalla at gmail.com
Thu Jan 23 07:47:30 CET 2014


You can tell ffmpeg to use only part of the audio input file like:

ffmpeg -i video -i audio -t <x> ....

the x would be 1 second less than the length of the video in seconds, this
will take the first x seconds (or you can skip 1 second initially by using
-ss 1 instead of -t <x>)


On Wed, Jan 22, 2014 at 5:23 AM, Samir <joeindien at gmail.com> wrote:

> Hello,
>
> I have recorded separatly two files for the same sequence: an mp4 file for
> the video part and a wav for the audio part. I can mix them easily with
> ffmpeg.
>
> My problem is that the audio file is longer than the video file, about 1
> second only but it produces an out of sync video...
>
> I know I can crop my audio file but I need first to get the duration for
> my files to known how many time i need to cut.
>
> Is there a way to tell ffmpeg to automatically crop the audio file to fit
> the duration of my video file?
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list