2

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!

1 Answer 1

3

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
2
  • 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
    Jun 23, 2016 at 20:40
  • No, the given commands ignore any audio in the video file.
    – Gyan
    Jun 24, 2016 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.