Answers.Body: <p>Your &quot;mp&quot; codec would be the reason why only one track may be in the output file; there's no &quot;mp&quot; codec (looks like a typo).</p>
  <p>If stream mapping is showing both audio tracks are present in the output file, then you should be able to select which track to play in the video player. By default, the best or first supported audio will play.</p>
  <p>If you want both audio tracks to play (&quot;<em>mux them together so they both play</em>&quot;), then <a href="https://trac.ffmpeg.org/wiki/AudioChannelManipulation" rel="nofollow noreferrer">mix the audio</a> into one track.</p>
  <p>Here's how <code>-c</code> (select codecs) &amp; <code>-map</code> (select streams) options work:</p>
  <pre><code>-c:a -&gt; select best supported audio (transcoded)
  -c:a copy -&gt; best supported audio (copied)
  -map 0:a -&gt; all audio from 1st input file (transcoded)
  -map 0:0 -&gt; 1st stream from 1st input file (transcoded)
  -map 1:a:0 -&gt; 1st audio stream from 2nd input file (transcoded)
  -map 1:a:1 -c:a copy -&gt; 2nd audio stream from 2nd input file (copied)
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T08:40:00.023Z
Answers.LastActivityDate: 2021-02-11T08:40:00.023Z
Answers.UserDisplayName: Zimba
Answers.Body: <p>If you copied your command there then your issue is probably <code>-acodec:0 mp</code>. That should be <code>-acodec:0 mp3</code>.</p>
  
  <p>You can just use <code>-c:a mp3</code> to apply the encoding options to all audio tracks at once, no need to apply them for each individually.</p>
  
  <p>Other than that your mapping is correct and shouldn't be the issue.</p>
  
  <p>Edit: To conclude the discussion in the comments regarding the actual reason behind the question: When it comes to editing it is no problem to just transcode the video stream if the source codec makes problems and import the audio from the source file by either muxing the audio into a new container with the transcoded video stream or just importing the transcoded video and audio streams separately (by demuxing the source) into your editing program and skip on the container format.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-30T15:31:29.370Z
Answers.Text: Is it possible that its a playback problem inside of wmp?
Answers.UserDisplayName: Kyle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-30T16:23:44.290Z
Answers.Text: definitely, Windows Media Player is bad, really really bad when it comes to format compatibility.
  Try VLC or Media Player Classic Home Cinema.
Answers.UserDisplayName: timonsku
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-30T16:35:56.013Z
Answers.Text: Ok I will give that a shot when I get home later. If it does work there, is it safe to assume it would import correctly into Premiere?
Answers.UserDisplayName: Kyle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-30T17:12:40.213Z
Answers.Text: Not necessarily when it comes to codecs but in the case of several audio tracks, yes it should.
  Though if you just want to edit it, you can just import the file like it is into Premiere, h264 is really not suitable for editing and degrades quality if you recorded with dxtory's lossless codec (h264 is highly lossy compressed). The codec should integrate into the Windows AVI codecs so Premiere would be able to use it.
  Edit: It does, you can just import the recordings without transcoding.
Answers.UserDisplayName: timonsku
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-30T19:13:20.567Z
Answers.Text: Really? That is interesting. But, the file size is definitely a problem. 60 GB video file is not so easy to transfer, but I can probably give it a shot.
Answers.UserDisplayName: Kyle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-01T14:27:51.163Z
Answers.Text: Then I recommend you just transcode the video to mjpeg, which is much more edit friendly and retains a lot of visual quality. Then mux the mjpeg only video file (without audio) into a new avi together with the original audio tracks. You can do this with Avi-Mux http://www.alexander-noe.com/video/amg/#download. Just import the transcoded video and the original file (then click the "generate.." button), untick the original video track and export a new avi.
Answers.UserDisplayName: timonsku
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-01T14:35:15.680Z
Answers.Text: Alternatively you can also just extract both audio tracks with ffmpeg transcode the video to a seperate file like I suggested above and just import all files individually into premiere, you don't need the container if you just going to edit the whole thing anyway.
Answers.UserDisplayName: timonsku
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-01T16:34:17.563Z
Answers.Text: Oh ok I see what you're saying there. Thanks I will give this a shot!
Answers.UserDisplayName: Kyle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-29T22:02:37.903Z
Answers.LastActivityDate: 2014-07-01T17:47:34.260Z
Answers.LastEditDate: 2014-07-01T17:47:34.260Z
Answers.UserDisplayName: timonsku
Body: <p>Ok so I have a video made from dxtory. The video is using dxtory video codec and unknown audio codec. When I pop the file into avimux, I can clearly see two audio tracks/sources. I have successfully converted the video without loss of quality with the following.</p>
  
  <pre><code>ffmpeg -i "The Bunker.avi" -vcodec h264 TheBunkerMix.mp4
  </code></pre>
  
  <p>But, the resultant file only had one track/source. Basically I recorded game footage and the original file had both the in game sounds as well as the mic recording commentary on top. But, when I did the conversion my audio commentary track/source got lost in conversion. What other options can I include to get my audio tracks?</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>I've gotten close now, but still not right. I have used the following but again its seems to ignore the first -map option. If I flipped which map comes second, that is the stream that is audible in the output. How do I mux them together so they both play?</p>
  
  <pre><code>ffmpeg -i "The Bunker.avi" -map 0:0 -map 0:1 -map 0:2 -vcodec h264 -acodec:0 mp
   -acodec:1 mp3 TheBunkerNwMix.mp4
  </code></pre>
  
  <p>This is the stream mappings so I have no idea why it isn't mapping correctly?</p>
  
  <pre><code>Stream mapping:
    Stream #0:0 -&gt; #0:0 (dxtory -&gt; libx264)
    Stream #0:1 -&gt; #0:1 (pcm_s16le -&gt; libmp3lame)
    Stream #0:2 -&gt; #0:2 (pcm_s16le -&gt; libmp3lame)
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-06-29T21:44:38.287Z
Comments.Text: Do you want to keep both audio tracks and just convert the file so it can be used in an editing program or do you want to mix both audio files into one?
Comments.UserDisplayName: timonsku
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-06-30T15:31:00.613Z
Comments.Text: Yes I basically want a small mp4 that I can edit with, without loss of audio.
Comments.UserDisplayName: Kyle
Tags: <ffmpeg><conversion>
Title: FFMPEG convert video with multiple audio streams?
UserDisplayName: Kyle
ThreadText: # FFMPEG convert video with multiple audio streams?
  
  (Asked by: username_0 on 2014-06-29)
  
  Ok so I have a video made from dxtory. The video is using dxtory video codec and unknown audio codec. When I pop the file into avimux, I can clearly see two audio tracks/sources. I have successfully converted the video without loss of quality with the following.
  
  ```
  ffmpeg -i "The Bunker.avi" -vcodec h264 TheBunkerMix.mp4
  
  ```
  
  But, the resultant file only had one track/source. Basically I recorded game footage and the original file had both the in game sounds as well as the mic recording commentary on top. But, when I did the conversion my audio commentary track/source got lost in conversion. What other options can I include to get my audio tracks?
  
  **EDIT 2:**
  
  I've gotten close now, but still not right. I have used the following but again its seems to ignore the first -map option. If I flipped which map comes second, that is the stream that is audible in the output. How do I mux them together so they both play?
  
  ```
  ffmpeg -i "The Bunker.avi" -map 0:0 -map 0:1 -map 0:2 -vcodec h264 -acodec:0 mp
   -acodec:1 mp3 TheBunkerNwMix.mp4
  
  ```
  
  This is the stream mappings so I have no idea why it isn't mapping correctly?
  
  ```
  Stream mapping:
    Stream #0:0 -> #0:0 (dxtory -> libx264)
    Stream #0:1 -> #0:1 (pcm_s16le -> libmp3lame)
    Stream #0:2 -> #0:2 (pcm_s16le -> libmp3lame)
  
  ```
  
  **Tags:** ffmpeg, conversion
  
  > **Comments:**
  > **username_1**: Do you want to keep both audio tracks and just convert the file so it can be used in an editing program or do you want to mix both audio files into one?  
  > **username_0**: Yes I basically want a small mp4 that I can edit with, without loss of audio.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-06-29. Score: 6 | Accepted answer
  
  If you copied your command there then your issue is probably `-acodec:0 mp`. That should be `-acodec:0 mp3`.
  
  You can just use `-c:a mp3` to apply the encoding options to all audio tracks at once, no need to apply them for each individually.
  
  Other than that your mapping is correct and shouldn't be the issue.
  
  Edit: To conclude the discussion in the comments regarding the actual reason behind the question: When it comes to editing it is no problem to just transcode the video stream if the source codec makes problems and import the audio from the source file by either muxing the audio into a new container with the transcoded video stream or just importing the transcoded video and audio streams separately (by demuxing the source) into your editing program and skip on the container format.
  
  > **Comments:**
  > **username_0**: Is it possible that its a playback problem inside of wmp?  
  > **username_1**: definitely, Windows Media Player is bad, really really bad when it comes to format compatibility. Try VLC or Media Player Classic Home Cinema.  
  > **username_0**: Ok I will give that a shot when I get home later. If it does work there, is it safe to assume it would import correctly into Premiere?  
  > **username_1**: Not necessarily when it comes to codecs but in the case of several audio tracks, yes it should. Though if you just want to edit it, you can just import the file like it is into Premiere, h264 is really not suitable for editing and degrades quality if you recorded with dxtory's lossless codec (h264 is highly lossy compressed). The codec should integrate into the Windows AVI codecs so Premiere would be able to use it. Edit: It does, you can just import the recordings without transcoding.  
  > **username_0**: Really? That is interesting. But, the file size is definitely a problem. 60 GB video file is not so easy to transfer, but I can probably give it a shot.  
  > **username_1**: Then I recommend you just transcode the video to mjpeg, which is much more edit friendly and retains a lot of visual quality. Then mux the mjpeg only video file (without audio) into a new avi together with the original audio tracks. You can do this with Avi-Mux http://www.alexander-noe.com/video/amg/#download. Just import the transcoded video and the original file (then click the "generate.." button), untick the original video track and export a new avi.  
  > **username_1**: Alternatively you can also just extract both audio tracks with ffmpeg transcode the video to a seperate file like I suggested above and just import all files individually into premiere, you don't need the container if you just going to edit the whole thing anyway.  
  > **username_0**: Oh ok I see what you're saying there. Thanks I will give this a shot!  
  
  ---
  
  ### Answer by username_2 on 2021-02-11. Score: 1
  
  Your "mp" codec would be the reason why only one track may be in the output file; there's no "mp" codec (looks like a typo).
  
  If stream mapping is showing both audio tracks are present in the output file, then you should be able to select which track to play in the video player. By default, the best or first supported audio will play.
  
  If you want both audio tracks to play ("*mux them together so they both play*"), then [mix the audio](https://trac.ffmpeg.org/wiki/AudioChannelManipulation) into one track.
  
  Here's how `-c` (select codecs) & `-map` (select streams) options work:
  
  ```
  -c:a -> select best supported audio (transcoded)
  -c:a copy -> best supported audio (copied)
  -map 0:a -> all audio from 1st input file (transcoded)
  -map 0:0 -> 1st stream from 1st input file (transcoded)
  -map 1:a:0 -> 1st audio stream from 2nd input file (transcoded)
  -map 1:a:1 -c:a copy -> 2nd audio stream from 2nd input file (copied)
  
  ```
  
  
  ---
  
  