Raheel Khan
Raheel Khan

Reputation: 14787

Combining video and audio from multiple sources using ffmpeg

I am trying to add an audio file to a video file using ffmpeg.

ffmpeg.exe -i "Video.avi" -i "Wave.wav" -map 0:0 -map 1:0 -vcodec copy -acodec copy "Output.mp4"

The above parameters work but the output file length is the greater of the two input lengths. How can I specify using the video's length instead?

Upvotes: 1

Views: 866

Answers (1)

Zombo
Zombo

Reputation: 1

As has been noted [1][2], in many cases FFmpeg cannot accurately set the duration, or will not set duration as would be expected. Use -t to set desired duration.

Upvotes: 1

Related Questions