The -map option is used to choose which streams from the input/inputs to be included in the output/outputs. If your video file already contains one or more audio stream and you want to replace the default audio with another (external) audio file, you need to use FFmpeg’s -map option. In case you don’t want any audio conversion, just drop the aac part in the command and replace it with copy, so it would look like this ffmpeg -i INPUT_FILE.mp4 -i AUDIO.aac -c:v copy -c:a copy OUTPUT_FILE.mp4 Extract video from file and combine with another audio file using FFmpeg c:a aac means select all the audio stream from source files, then encode it with AAC encoder. c:v copy is a short form of -codec:v copy which means copy the video stream from the source files to the destination file. Similarly, -i AUDIO.wav tells FFmpeg to take AUDIO.wav as an input source.
![ffmpeg concat videos ffmpeg concat videos](http://johnriselvato.com/wp-content/uploads/2020/04/FFmpeg-How-to-Concatenate-Multiple-Videos.png)
i INPUT_FILE.mp4 specify INPUT_FILE.mp4 as an input source If you want to combine them AND re-encode the audio to AAC format, you can use this command : ffmpeg -i INPUT_FILE.mp4 -i AUDIO.wav -c:v copy -c:a aac OUTPUT_FILE.mp4 Let’s suppose our video file name is INPUT_FILE.mp4 and the audio file name is AUDIO.wav.
![ffmpeg concat videos ffmpeg concat videos](https://res.cloudinary.com/hl8zoliad/raw/upload/npm/@yaron24/ffmpeg-concat.png)
#Ffmpeg concat videos mp4
To ensure compatibility, we recommend using MP4 or MKV as the container. Please do note that the container (file extension) must accept the video and audio codec.
![ffmpeg concat videos ffmpeg concat videos](https://i.stack.imgur.com/1PsSQ.png)
If you have separate audio and video file, and the video file contains no audio, you can use this command to combine them into one video file. 6 Conclusion Combine separate video and audio using FFmpeg