

It works with audio, images, and video in basically any codec In streamcomponentclose(), it will abort and. h264 video and aac audio compression: ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest -c:v mpeg4 -c:a aac output.mp4 Advantages of Live Streaming using FFmpeg.
Ffmpeg map video and audio mp4#
If you want to convert (and compress) the file in one operation, you can use this one-liner to export an MP4 file with. Note that this is a lossless (and fast) procedure, it will just copy the content from the source files.

The output.avi file will have the same video content as input2.avi, but with audio from input1.mp4. Then you can use this one-liner to copy the audio from one file to the other: ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest output.avi

Open command promt (windows+R -> Cmd+Enter). So I need to add the audio track by copying either from the source video file or from a separate audio file. The -map option makes ffmpeg only use the first video stream from the first input and the first audio stream from the second input for the output file. When working with various types of video analysis, I often end up with video files without audio.
