Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Compression Techniques command line audio stream selection?

  • command line audio stream selection?

     Chris Oram updated 5 years ago 2 Members · 2 Posts
  • Peter Wu

    September 26, 2016 at 7:56 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).

  • Chris Oram

    November 29, 2016 at 10:48 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
    Technology, Design and Development for Moving Image Creators

Viewing 1 - 2 of 2 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy