Answers.Body: <p>Use</p>
  
  <pre><code>-i /path/to/mp4File
  -i /path/to/soundmp3File1
  -i path/to/soundmp3File2
  -map 0 -map 1:a -map 2:a
  -codec copy -shortest path/to/output/fileWithSounds
  </code></pre>
  
  <p>FFmpeg will automatically select one video and one audio stream from among all the inputs. <code>-map</code> options are required to include all streams.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-19T11:37:27.597Z
Answers.Text: For some reason only one audio stream ends up in my output file. Multiple streams only work if I amerge, but that's slow. I use the command you pasted. Unfortunately I accepted before trying.
Answers.UserDisplayName: WPMed
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-19T11:54:30.557Z
Answers.Text: Share full log.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-19T12:02:04.447Z
Answers.Text: I think I may have misunderstood multiple things about mp4. So if I add multiple audiotracks, will a player actually play all the tracks included? So I think the reason I only hear one audio in the output is that the player picks one. Does it make sense?
Answers.UserDisplayName: WPMed
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-19T12:45:24.487Z
Answers.Text: Yes, that's expected. You'll need amix filter if you want to hear all sounds at once - this will produce one track with all tracks mixed. A video player will only play one track at a time.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-09T14:34:35.573Z
Answers.LastActivityDate: 2018-11-09T14:34:35.573Z
Answers.UserDisplayName: Gyan
Body: <p>I would like to add multiple mp3 files to an mp4 file.
  For adding a single mp3 to an mp4, I used this command with success:</p>
  
  <pre><code>"-i /path/to/mp4File -i /path/to/soundmp3File -codec copy -shortest path/to/output/fileWithSound"
  </code></pre>
  
  <p>But I'm stuck with adding another mp3. I tried this, but it didn't work:</p>
  
  <pre><code>"-i /path/to/mp4File -i /path/to/soundmp3File1 -i path/to/soundmp3File2 -codec copy -shortest path/to/output/fileWithSounds"
  </code></pre>
  
  <p>How can I make it work with multiple audio files?</p>
  
Tags: <ffmpeg><mp4>
Title: Add multiple mp3 files to an mp4 file with ffmpeg
UserDisplayName: WPMed
ThreadText: # Add multiple mp3 files to an mp4 file with ffmpeg
  
  (Asked by: username_0 on 2018-11-09)
  
  I would like to add multiple mp3 files to an mp4 file.
  For adding a single mp3 to an mp4, I used this command with success:
  
  ```
  "-i /path/to/mp4File -i /path/to/soundmp3File -codec copy -shortest path/to/output/fileWithSound"
  
  ```
  
  But I'm stuck with adding another mp3. I tried this, but it didn't work:
  
  ```
  "-i /path/to/mp4File -i /path/to/soundmp3File1 -i path/to/soundmp3File2 -codec copy -shortest path/to/output/fileWithSounds"
  
  ```
  
  How can I make it work with multiple audio files?
  
  **Tags:** ffmpeg, mp4
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-09. Score: 5 | Accepted answer
  
  Use
  
  ```
  -i /path/to/mp4File
  -i /path/to/soundmp3File1
  -i path/to/soundmp3File2
  -map 0 -map 1:a -map 2:a
  -codec copy -shortest path/to/output/fileWithSounds
  
  ```
  
  FFmpeg will automatically select one video and one audio stream from among all the inputs. `-map` options are required to include all streams.
  
  > **Comments:**
  > **username_0**: For some reason only one audio stream ends up in my output file. Multiple streams only work if I amerge, but that's slow. I use the command you pasted. Unfortunately I accepted before trying.  
  > **username_1**: Share full log.  
  > **username_0**: I think I may have misunderstood multiple things about mp4. So if I add multiple audiotracks, will a player actually play all the tracks included? So I think the reason I only hear one audio in the output is that the player picks one. Does it make sense?  
  > **username_1**: Yes, that's expected. You'll need amix filter if you want to hear all sounds at once - this will produce one track with all tracks mixed. A video player will only play one track at a time.  
  
  ---
  
  