<p>Channels are conjoint tracks within a single stream, so a stereo audio WAV has one stream which contains two channels. If this is what you have, use</p>

<pre><code>ffmpeg -i video -i audio -map 0:v -map 1:a output
</code></pre>

<p>If they are distinct streams, then the above command will still map all the streams, but for explicit specification, use</p>

<pre><code>ffmpeg -i video -i audio -map 0:v -map 1:a:0 -map 1:a:1 output
</code></pre>

CC BY-SA 3.0
2016-06-23T20:40:32.943Z
Okay i'll try it thanks!
For the first command - what if the video file itself also has an audio stream but i don't want to use it? would that change the command or no?
Gambit2007
CC BY-SA 3.0
2016-06-24T03:28:10.117Z
No, the given commands ignore any audio in the video file.
Gyan
CC BY-SA 3.0
2016-06-23T20:28:14.677Z
2016-06-23T20:28:14.677Z
Gyan
<p>I have a video file and an audio file (that contains 2 channels) and i want to map the video to stream 0 of the resulting file and the audio file to the next stream/s.</p>

<p>Since the audio file has 2 channels, would i have to map it to 2 separate streams? (1 and 2 of the resulting file)
Or just one stream? </p>

<p>Finally, how should i go about doing that?
I've only tried mapping with video files so i'm not sure how to do it with audio ones.</p>

<p>Thanks!</p>

<ffmpeg>
ffmpeg - mapping an audio file with 2 channels to a video file?
Gambit2007
# ffmpeg - mapping an audio file with 2 channels to a video file?

(Asked by: username_0 on 2016-06-23)

I have a video file and an audio file (that contains 2 channels) and i want to map the video to stream 0 of the resulting file and the audio file to the next stream/s.

Since the audio file has 2 channels, would i have to map it to 2 separate streams? (1 and 2 of the resulting file)
Or just one stream?

Finally, how should i go about doing that?
I've only tried mapping with video files so i'm not sure how to do it with audio ones.

Thanks!

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2016-06-23. Score: 3 | Accepted answer

Channels are conjoint tracks within a single stream, so a stereo audio WAV has one stream which contains two channels. If this is what you have, use
ffmpeg -i video -i audio -map 0:v -map 1:a output

If they are distinct streams, then the above command will still map all the streams, but for explicit specification, use
ffmpeg -i video -i audio -map 0:v -map 1:a:0 -map 1:a:1 output

> **Comments:**
> **username_0**: Okay i'll try it thanks! For the first command - what if the video file itself also has an audio stream but i don't want to use it? would that change the command or no?  
> **username_1**: No, the given commands ignore any audio in the video file.  

---

