One file, many streams
A media container holds streams: typically one video, one audio, sometimes a subtitle track, occasionally a 'data' stream (timecode, metadata). A Blu-ray rip might have 1 video + 4 audio (different languages) + 8 subtitle streams.
FFmpeg uses stream specifiers to point at specific streams. The grammar is small but you'll hit it constantly.
The grammar
v= video,a= audio,s= subtitle,d= data,t= attachment.v:0= the first video stream.a:1= the second audio stream.0:v:0= the first video stream of input #0 (when you have multiple inputs).-map 0:a:1= take audio stream #1 from input #0 and put it in the output.-c:v libx264= use libx264 for all video streams in the output.-c:a:0 copy -c:a:1 aac= copy the first audio stream, re-encode the second to AAC.
By default if you don't -map anything, FFmpeg picks the 'best' video and 'best' audio (highest bitrate / preferred language). When you have multi-track files, be explicit — auto-pick is the source of half the 'wrong audio language' bugs in the world.