

Out.mp4 (which should be identical to in.mp4) contains only 2 streams:įFmpeg does appear to correctly identify all 3 streams, but doesn't copy all of them over. After hours of searching online, it appears this should copy all streams ( as shown in example 4 here): ffmpeg -i in.mp4 -map 0 -c copy out.mp4 If you want full audio in video remove -shortest from the cmd.I'm having trouble getting ffmpeg to copy all audio streams from a. If audio length is greater than video length it will cut the audio to video length. FFmpeg mux video and audio from another video.FFmpeg Wiki: Audio Channel Manipulation.

ffmpeg -i video.mp4 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 \ The filter allows you to choose the desired channel layout (mono, stereo, 5.1, etc) and the sample rate.

You can use the anullsrc filter to make a silent audio stream. See FFmpeg Wiki: Audio Channels for more info. Mix audio from video.mkv and audio.m4a using the amerge filter: ffmpeg -i video.mkv -i audio.m4a -filter_complex "amerge=inputs=2" -map 0:v -map "" -c:v copy -ac 2 -shortest output.mkv Mixing/combining two audio inputs into one

Quality is preserved and the process is fast. This example uses -c:v copy to stream copy (mux) the video.The -map option allows you to manually select streams / tracks.Ffmpeg -i video.mp4 -i audio.wav -map 0:v -map 1:a -c:v copy -shortest output.mp4
