How to indicate target audio codec?

181 views
Skip to first unread message

kai

unread,
Jun 21, 2011, 5:38:12 AM6/21/11
to ffmbc-discuss
I am trying to recode a source file with 8 stereo tracks into 16 mono
tracks in IMX30 output. For some reason ffmbc insists on encoding the
output audio as pcm_s16le, rather than the pcm_s24le I'd like to
get.

This is the command line I use:
ffmbc -y -i input.mxf -t 10 -target imx30 output.mxf -acodec copy -
map_audio_channel 0:0:0:0:1 -map_audio_channel 0:0:1:0:1 -
map_audio_channel 0:1:0:0:1 -map_audio_channel 0:1:1:0:1 -
map_audio_channel 0:2:0:0:1 -map_audio_channel 0:2:1:0:1 -
map_audio_channel 0:3:0:0:1 -map_audio_channel 0:3:1:0:1 -
map_audio_channel 0:4:0:0:1 -map_audio_channel 0:4:1:0:1 -
map_audio_channel 0:5:0:0:1 -map_audio_channel 0:5:1:0:1 -
map_audio_channel 0:6:0:0:1 -map_audio_channel 0:6:1:0:1 -
map_audio_channel 0:7:0:0:1 -map_audio_channel 0:7:1:0:1

and on execution it looks like

FFmbc version 0.6-rc7
Copyright (c) 2008-2011 Baptiste Coudurier and the FFmpeg developers
[mxf @ 0x2c09be0] Estimating duration from bitrate, this may be
inaccurate
Input #0, mxf, from 'input.mxf':
Metadata:
timecode: 00:00:00;00
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0.0(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.1(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.2(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.3(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.4(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.5(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.6(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.7(und): Audio: pcm_s24le, 48000 Hz, 2 channels, s32,
2304 kb/s
Stream #0.8(und): Video: dvvideo, yuv422p, 720x480i bff [PAR 8:9
DAR 4:3], 29.97 fps
auto-rescaling to IMX resolution
[scale @ 0x2c1bf10] w:720 h:480 fmt:yuv422p -> w:720 h:486 fmt:yuv422p
flags:0x4 interlaced:0
[pad @ 0x2c1c290] w:720 h:486 -> w:720 h:512 x:0 y:26 color:
0x108080FF[yuva]
Warning, QMAT_SHIFT is larger than 21, overflows possible
Last message repeated 1 times
Output #0, mxf_d10, to 'output.mxf':
Metadata:
encoder: FFmbc 0.6
Stream #0.0(und): Video: mpeg2video, yuv422p, 720x512i tff [PAR
128:135 DAR 4:3], cbr, 30000 kb/s, 29.97 fps
Stream #0.1(und): Audio: pcm_s16le, 48000 Hz, 16 channels, s16,
12288 kb/s
Stream mapping:
Stream #0.8 -> #0.0
Stream #0.0 -> #0.1 [channel: 0 -> 0]
Stream #0.0 -> #0.1 [channel: 1 -> 1]
Stream #0.1 -> #0.1 [channel: 0 -> 2]
Stream #0.1 -> #0.1 [channel: 1 -> 3]
Stream #0.2 -> #0.1 [channel: 0 -> 4]
Stream #0.2 -> #0.1 [channel: 1 -> 5]
Stream #0.3 -> #0.1 [channel: 0 -> 6]
Stream #0.3 -> #0.1 [channel: 1 -> 7]
Stream #0.4 -> #0.1 [channel: 0 -> 8]
Stream #0.4 -> #0.1 [channel: 1 -> 9]
Stream #0.5 -> #0.1 [channel: 0 -> 10]
Stream #0.5 -> #0.1 [channel: 1 -> 11]
Stream #0.6 -> #0.1 [channel: 0 -> 12]
Stream #0.6 -> #0.1 [channel: 1 -> 13]
Stream #0.7 -> #0.1 [channel: 0 -> 14]
Stream #0.7 -> #0.1 [channel: 1 -> 15]
Press [q] to stop encoding
discarding 1601 audio samples in stream #0.0
discarding 1601 audio samples in stream #0.1
...
[etc]

What do I need to do to keep the original codec?

Baptiste Coudurier

unread,
Jun 21, 2011, 6:06:45 AM6/21/11
to ffmbc-...@googlegroups.com
Hi,

On 6/21/11 2:38 AM, kai wrote:
> I am trying to recode a source file with 8 stereo tracks into 16 mono
> tracks in IMX30 output. For some reason ffmbc insists on encoding the
> output audio as pcm_s16le, rather than the pcm_s24le I'd like to
> get.
>
> This is the command line I use:
> ffmbc -y -i input.mxf -t 10 -target imx30 output.mxf -acodec copy -

Put -acodec between -target and output file (output.mxf)

--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org

kai

unread,
Jun 21, 2011, 6:30:22 AM6/21/11
to ffmbc-discuss


On Jun 21, 12:06 pm, Baptiste Coudurier <baptiste.coudur...@gmail.com>
wrote:
> Hi,
>
> On 6/21/11 2:38 AM, kai wrote:
>
> > I am trying to recode a source file with 8 stereo tracks into 16 mono
> > tracks in IMX30 output.  For some reason ffmbc insists on encoding the
> > output audio as pcm_s16le, rather than the pcm_s24le I'd like to
> > get.
>
> > This is the command line I use:
> > ffmbc -y -i input.mxf -t 10 -target imx30 output.mxf -acodec copy -
>
> Put -acodec between -target and output file (output.mxf)

Hmm, that made the codec correct, but on the other hand ignored my
audio channel mapping so that I only got four output channels.

Phillip Barnett

unread,
Jun 21, 2011, 9:56:54 AM6/21/11
to ffmbc-...@googlegroups.com

Kai,
If you want pcm_s24le then why don't you specify it?

"-acodec pcm_s24le"

Phillip

kai

unread,
Jun 21, 2011, 11:19:45 AM6/21/11
to ffmbc-discuss


On Jun 21, 3:56 pm, Phillip Barnett <phillip.p.barn...@gmail.com>
wrote:
Well, it doesn't make any difference whether I say copy or pcm_s24le,
I've tried both.

Phillip Barnett

unread,
Jun 21, 2011, 3:33:51 PM6/21/11
to ffmbc-...@googlegroups.com
Ahah, I have the answer, I believe.

I just re-read your initial command line more carefully. The problem is that you're using the -target imx30.
If you look at the source code,  you'll find the line 

'opt_audio_codec("pcm_s16le");' in the imx30 section, so it looks as though ffmbc will always encode audio at 16 bit even if you specify a different format separately on the command line - the compiled target overrides it.

Now, I do know that 24 bit audio is valid for imx30 as well as 16 bit, because my company (accidentally) ingested a few thousand clips at 24 bit which we didn't actually want (it upsets some of our kit) and will probably all need some recoding at some point.
But if you do want 24 bit then it looks as though we need to patch ffmbc to provide a choice. 

You could delete that line and recompile to get you round the problem for now.


Phillip

Baptiste Coudurier

unread,
Jun 21, 2011, 6:41:22 PM6/21/11
to ffmbc-...@googlegroups.com

You don't need to do that.
You can specify -acodec pcm_s24le before -target and the output file.

Baptiste Coudurier

unread,
Jun 21, 2011, 6:46:03 PM6/21/11
to ffmbc-...@googlegroups.com

IMX only supports one output track with maximum 8 channels.

kai

unread,
Jun 22, 2011, 3:52:24 AM6/22/11
to ffmbc-discuss


On Jun 22, 12:46 am, Baptiste Coudurier <baptiste.coudur...@gmail.com>
wrote:
> On 06/21/2011 03:30 AM, kai wrote:
>
> > On Jun 21, 12:06 pm, Baptiste Coudurier <baptiste.coudur...@gmail.com>
> > wrote:
> >> Hi,
>
> >> On 6/21/11 2:38 AM, kai wrote:
>
> >>> I am trying to recode a source file with 8 stereo tracks into 16 mono
> >>> tracks in IMX30 output.  For some reason ffmbc insists on encoding the
> >>> output audio as pcm_s16le, rather than the pcm_s24le I'd like to
> >>> get.
>
> >>> This is the command line I use:
> >>> ffmbc -y -i input.mxf -t 10 -target imx30 output.mxf -acodec copy -
>
> >> Put -acodec between -target and output file (output.mxf)
>
> > Hmm, that made the codec correct, but on the other hand ignored my
> > audio channel mapping so that I only got four output channels.
>
> IMX only supports one output track with maximum 8 channels.

Tell that to our customers. ;-)

Anyway, if I explicitly set the codec *and* specify 8 channels, then
it works. I'll have to see what I can negotiate about the 16-channel
files, but this will do for now.

Thank you very much!

Phillip Barnett

unread,
Jun 22, 2011, 3:59:51 AM6/22/11
to ffmbc-...@googlegroups.com
Baptiste,
I thought he said he'd tried that and it didn't work. 
Oh well. Sorry to doubt you :-)

Reply all
Reply to author
Forward
0 new messages