Open MichalFiglarowicz opened 5 months ago
Unfortualely I do not know how to properly fix the MediaInfoLib code since the ChannelLayout_2018_Rename is called late and can't see inforamtion where the Audio_ChannelLayout value was taken from.
This part of the code is definitely messy, and there are conflicts between specs about names, so a mix up when we try to normalize. I think that we need to know the source of the channel names (AAC or MP4) and this is not an obvious patch due to the super messy code, I'll check.
Here is how to generated such stream
Please share a small sample file, easier for me to deal directly with a file having for sure the issue.
Here is an example file
https://github.com/MediaArea/MediaInfoLib/assets/72302178/f9f7aab6-3daf-4a0e-b9e6-a1429e9efde7
Generated with
ffmpeg -i big_buck_bunny_1080p_h264.mov -t 00:00:05.0 -vn -c:a:0 aac -f mov mov_with_chan_5_1.mov
MediaInfo v23.04 reports different
Channel layout
on MOV file with AAC in 5.1 channel layout then v22.09. In addition the value reported by MediaInfo v23.04 inChannel layout
is very different that the value reported inChannelLayout_Original
which seems to be wrong. MediaInfo v23.04:MediaInfo v22.09
The change between versions is from
Left Rear Surround
(Lb
) toBottom Front Left
(Bfl
), which looks like a bug IMO. The different behaviour is observed since https://github.com/MediaArea/MediaInfoLib/commit/b53aa8063bff8bf99a1e49e3114144eb8bf686c0I observe it only on MOV files with AAC which have
chan
atom/box (Channel Layout Chunk
) specified in https://developer.apple.com/library/archive/documentation/MusicAudio/Reference/CAFSpec/CAF_spec/CAF_spec.html#//apple_ref/doc/uid/TP40001862-CH210-BCGBHHHI. In such files theChannel layout
is taken fromchan
atom andChannelLayout_Original
is taken from AAC elementary stream.Here is how to generated such stream
I looked at the MediaInfoLib code and IMO the problem is that value from
chan
is renamed withChannelLayout_2018_Rename
function (the most problematic is the part afterIsAac
flag). It seems that this code should be executed on values parsed from the AAC elementary stream, but not on values formchan
atom. Unfortualely I do not know how to properly fix the MediaInfoLib code since theChannelLayout_2018_Rename
is called late and can't see inforamtion where theAudio_ChannelLayout
value was taken from.