[FFmpeg-trac] #10321(avformat:new): mov_channel_layout[] table possible issues

FFmpeg trac at avcodec.org
Sat Apr 15 13:10:00 EEST 2023


#10321: mov_channel_layout[] table possible issues
----------------------------------+---------------------------------------
             Reporter:  Tim       |                     Type:  enhancement
               Status:  new       |                 Priority:  normal
            Component:  avformat  |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+---------------------------------------
 Note: this is kind of a "thinking out loud" thing, possibly worth
 discussing anyway.

 Example:
 https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/a3f4916:/libavformat/isom.c#l400
 {{{
     { AV_CH_LAYOUT_7POINT1, (128<<16) | 8}, //
 kCAFChannelLayoutTag_MPEG_7_1_C
 }}}
 https://developer.apple.com/library/archive/documentation/MusicAudio/Reference/CAFSpec/CAF_spec/CAF_spec.html
 {{{
     kCAFChannelLayoutTag_MPEG_7_1_C = (128<<16) | 8,         // L R C LFE
 Ls Rs Rls Rrs
 }}}
 Thus:
 {{{
 L | R | C | LFE | BL | BR | SL  | SR     AV_CH_LAYOUT_7POINT1
 L | R | C | LFE | Ls | Rs | Rls | Rrs    kCAFChannelLayoutTag_MPEG_7_1_C
 }}}
 BL == Ls (kCAFChannelLabel_LeftSurround)
 BR == Rs (kCAFChannelLabel_RightSurround)
 but SL (kCAFChannelLabel_LeftSurroundDirect) != Rls
 (kCAFChannelLabel_RearSurroundLeft)
 and SR (kCAFChannelLabel_RightSurroundDirect) != Rls
 (kCAFChannelLabel_RearSurroundRight)

 …also, perhaps importantly, as far as I can understand, SL and SR are
 supposedly closer to
 the front channels than BL/Ls and BR/Rs whereas Rls Rrs are behind BL/Ls
 and BL/Rs, making
 the mapping rather problematic?

 On the other hand:
 {{{
 L | R | C | LFE | BL | BR | FLC | FRC    AV_CH_LAYOUT_7POINT1_WIDE_BACK
 L | R | C | LFE | Ls | Rs | Lc  | Rc     kCAFChannelLayoutTag_MPEG_7_1_A
 }}}
 but there is no mapping for it in the mov_channel_layout table.

 {{{
 L | R | C | LFE | SL | SR | FLC | FRC    AV_CH_LAYOUT_7POINT1_WIDE
 L | R | C | LFE | Ls | Rs | Lc  | Rc     kCAFChannelLayoutTag_MPEG_7_1_A
 }}}
 exists with SL == Ls and SR == Rs, which is also used by
 AV_CH_LAYOUT_5POINT1 ==
 kCAFChannelLayoutTag_MPEG_5_1_A and several other mappings, but is
 somewhat less
 problematic since there are no back channels in the corresponding
 AV_CH_LAYOUTs.

 Also:
 {{{
 L | R | C | LFE | BL | BR | BC    AV_CH_LAYOUT_6POINT1_BACK
 L | R | C | LFE | Ls | Rs | Cs    kCAFChannelLayoutTag_MPEG_6_1_A
 }}}
 seems suitable but is absent from the table.

 This would not work, on the other hand:
 {{{
 L | R | C | LFE | BC | SL | SR    AV_CH_LAYOUT_6POINT1
 L | R | C | LFE | Ls | Rs | Cs    kCAFChannelLayoutTag_MPEG_6_1_A
 }}}
 (but does not exist in the table, just noteworthy)

 Finally/FWIW
 https://developer.apple.com/documentation/coreaudiotypes/1572101-audio_channel_layout_tags?language=objc

 Does list some additional WAVE-specific layout tags which are not
 present in the CAF Channel Layout Chunk specification, for example:

 kAudioChannelLayoutTag_WAVE_7_1 = (189U<<16) | 8
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10321>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list