[FFmpeg-devel] [PATCH 5/5] avformat/mxfdec: rework MCA channel layout parsing

Marton Balint cus at passwd.hu
Mon Nov 29 21:19:59 EET 2021



On Sun, 28 Nov 2021, Pierre-Anthony Lemieux wrote:

> On Sun, Nov 28, 2021 at 5:00 PM Marton Balint <cus at passwd.hu> wrote:
>>
>> Setting the channel layout was based on SoundfieldGroupLabelSubDescriptor, but
>> this was wrong, because soundfield groups are not necessarily used and a file
>> can also contain e.g. a single channel of a multichannel audio.
>
> For reference, below are MCA scenarios I am aware of:
>
> - single MXF file containing a single soundfield and all its
> constituent channels (specified in the Interoperable Master Format -
> IMF)
> - single MXF file containing a single soundfield and all its
> constituent channels, plus additional auxiliary channels, e.g.
> visually-impaired narration (specified in Digital cinema)
> - N MXF files, each containing one channel of a single soundfield
> (specified in IMF, but I have personally never seen it in practice)
>
>>
>> The new approach is to parse every AudioChannelLabelSubDescriptor and create a
>> channel layout based on those. We should also make sure that we only provide a
>> channel layout if every channel designation is recognized and is supported. If
>> a designation is not supported, or if a channel designation is used more than
>> once (e.g. multiple languages) we fall back to the unknown channel layout.
>>
>> MCA channel ID was also ignored previously, that should have been used to
>> determine which AudioChannelLabelSubDescriptor references which audio channel.
>> This is also fixed now.
>>
>> The new parsing code also detects ambigous language or service types, and only
>> set these metadata if all channels have the same value.
>>
>>
>> Soundfield groups are now only used for determinig the language of the tracks,
>> if it is not provided in the AudioChannelLabelSubDescriptor. Track sub
>> descriptors not necessarily contain the references to their soundfield groups,
>
> ST 377-4 states that "If the Audio Channel is part of a Soundfield
> Group then the SoundfieldGroupLinkID shall be present in the
> AudioChannelLabelSubDescriptor Set. The SoundfieldGroupLinkID shall be
> the MCA Link ID of the SoundfieldGroupLabelSubDescriptor to which this
> Audio Channel belongs."
>
> What do you mean by "Track sub descriptors not necessarily contain the
> references to their soundfield groups,"?

I mean that the SubDescriptors item of the WavePCMDescriptor not 
necessarily contains the references to the soundfield group. E.g. if a 
soundfield group consist of two channels, one channel is in audio track 1, 
another channel is in audio track 2. As far as I understand only one
WavePCMDescriptor can reference the SoundfieldGroup in its SubDescriptors, 
because it is a strong reference.

Obviosly the soundfield group can be found by iterating over all the items 
and searching for the link ID, but not by iterating over the UID 
references of the SubDescriptors of the WavePCMDescriptor.

Regards,
Marton


More information about the ffmpeg-devel mailing list