[FFmpeg-user] How can I concat a video and audio to a long video?

Jeff darkmoon at verizon.net
Fri May 23 11:09:48 CEST 2014


As seen from lists.FFmpeg-user,
On Wed, 21 May 2014 13:17:13 +0800, "v" <dferererer at qq.com> wrote:

>I need to concat a video and audio to get a longer video,I have try -i 
>concat:"v.mp4|a.m4a' and -f concat -i concat.lst,but the result video 
>is not ok.
>  
> Any help?Thank you very much!

Based on your sample file names, I am going to take a shot in near 
darkness and guess that what you really want to do is mux separate 
video and audio streams together into a (complete) video. This 
assumes that v.mp4 contains a video stream, a.m4a contains an audio 
stream, and that the two streams are the same duration so that the A/V 
will come out in sync:

$ ffmpeg -i v.mp4 -i a.m4a -c copy video.mp4

Alternatively, v.mp4 may already be a complete video, and what you want 
to do is replace the existing audio stream with the audio contained in 
'a.m4a '. In that case:

$ ffmpeg -i v.mp4 -i a.m4a -map 0:v -map 1:a -c copy video.mp4

Hope that helps.

Jeff


More information about the ffmpeg-user mailing list