title: FFMpeg - convert all audio streams from MKV to MP4
body: <p>I have MKV file which contains:</p>
  
  <pre><code>Stream #0:0(eng): Video: h264 (High)
  Stream #0:1(pol): Audio: ac3
  Stream #0:2(eng): Audio: dts (DTS)
  Stream #0:3(pol): Subtitle: subrip
  Stream #0:4(eng): Subtitle:  hdmv_pgs_subtitle
  </code></pre>
  
  <p>I would like to omit subtitles (<code>-sn</code> option), copy video and encode audio streams to AAC.</p>
  
  <p>I tried few various command and output file is always the same (2 audio streams but in both sound from first audio stream).</p>
  
  <p>Here are my commands:</p>
  
  <pre><code>ffmpeg -i input.mkv -sn -map 0:a? -map 0:v -c:v copy -c:a? aac output.mp4 
  ffmpeg -i input.mkv -sn -map 0 -c:v copy -c:a aac output.mp4 
  ffmpeg -i input.mkv -sn -map 0:? -c:v copy -c:a aac output.mp4
  </code></pre>
  
  <p>Everything almost work but in output file I have 2 audio streams with name (pol) and (eng) but in both is sound from (pol) stream0:1.</p>
  
  <p>What command should I use to convert audio streams in order to achieve two a audio streams where will be pol and eng sound (not pol in both of them). Sometimes input file has only 1 audio stream so to command line should be universal, I guess ffmpeg map with <code>?</code> character.</p>