FORUMS: list search recent posts

command line audio stream selection?

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Wu
command line audio stream selection?
on Sep 26, 2016 at 7:56:30 pm

I have an mxf file from a canon camcorder. It contains 1 video stream and 2 audio streams corresponding to left and right channel. My video editor (an old version of premiere) cannot read this file, so I have to demux it into video and audio files. I have no problem with the video and first audio stream.

To extract the 2nd audio channel, I can do

ffmpeg -i input.mxf -map 0:2 -acodec copy out2.wav


I also read that you can put stream specifier on the option, so i tried

ffmpeg -i input.mxf -codec:a:2 copy out2.wav


This doesn't work. I get the first audio stream. What am I misunderstanding?
I'm trying to understand ffmpeg better because I have more advance operations in mind (e.g. re-package the mxf file into a file that premiere cs4 can read).


Return to posts index

Chris Oram
Re: command line audio stream selection?
on Nov 29, 2016 at 10:48:34 am

Hi Peter,

MXF files are great because of the wealth of information that they can pack in to the metadata to describe the essence it carries however as a result there are a myriad of different ways of carrying audio in MXF files which will impact what is the appropriate mapping for you to output to extract the files you need.

I would recommend that you post the information you get from the source file by just running the -i command and pasting the results here for us to take a full look at.

The -map option is usually enough to allocate the mapping of your output into files, streams and channels (in that order).
e.g. 0:1:0:0:1:0
:::::

tip - A regular gotcha for anybody dealing with numbers in this output is to remember that the first item whether it is a file, stream or channel will start from '0'

-Chris Oram

http://antiversal.com
Technology, Design and Development for Moving Image Creators


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]