3

I have an avi and a wav file. Let's suppose the video file is one hour long, and the audio file 30 minutes long and it's associated with the last 30 minutes of the video file.

Is there a way to create a new video file with the video and audio combined but audio starting after the first 30 minutes of the video?

8

You can simply append a silent audio to the beginning of the audio file using aevalsrc filter. To create a 30 sec of silent audio,

aevalsrc=0:d=30

To do this you can use filter_complex with map options. Following is the FFmpeg command I'm suggesting.

ffmpeg -i input_video -i input_audio -filter_complex "
aevalsrc=0:d=30[s1];
[s1][1:a]concat=n=2:v=0:a=1[aout]" -c:v copy -map 0:v -map [aout] output_video

Else you can try amerge and adelay where doc itself has a clear explanation.

Hope this helps you!

1
  • After spending the whole day on this yesterday I ended up with the same idea and it works. I tried any possible way by using -itsoffset , but that only works with video, not audio. Even if I already ended up with the same solution, I will mark yours as resolved. Thanks for taking the time to help.
    – LEM
    Jun 24 '15 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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