Tuesday 18 October 2016

ffmpeg merge audio video

ffmpeg merge audio video:

Input file : song.mp3 , video.mp4
Output file : output.mp4


ffmpeg -i song.mp3 -i video.mp4 -acodec copy -vcodec copy -f mp4 output.mp4


If your audio or video stream is longer, you can add the -shortest option so that ffmpeg will stop encoding once one file ends.

ffmpeg -i song.mp3 -i video.mp4 -acodec copy -vcodec copy -f mp4 -shortest output.mp4