This is, what the -map option is for. In the simplest form you just select one after another stream from the sources with the form <file>:<stream>
. So for example to select the first stream from the first input file, use 0:0
.
Archives
How to recode audio by leaving video as is?
$ ffmpeg -i input.mp4 -c:v copy -c:a libfdk_aac -b:a 384k output.mp4
How to recode audio?
$ ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3
A table with options mapped to lame can be found at https://trac.ffmpeg.org/wiki/Encode/MP3.
How to simply convert video files i.e. MKV to MP4?
$ ffmpeg -i LostInTranslation.mkv -vcodec copy -acodec copy LostInTranslation.mp4