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

FFmpeg trac at avcodec.org
Sat Apr 15 13:58:59 EEST 2023


#10321: mov_channel_layout[] table possible issues
-------------------------------------+------------------------------------
             Reporter:  Tim          |                    Owner:  (none)
                 Type:  enhancement  |                   Status:  new
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------
Comment (by Tim):

 Here's some experiments re: "WAVE" layout tags in CAF (have not tested
 AIFF/MOV).

 ffmpeg -i 7point1.dts -c:a pcm_s24le -f caf ffmpeg.caf


 {{{
 % afinfo ffmpeg.caf
 File:           ffmpeg.caf
 File type ID:   caff
 Num Tracks:     1
 ----
 Data format:     8 ch,  96000 Hz, lpcm (0x0000000C) 24-bit little-endian
 signed integer
 Channel layout: 7.1 (L R C LFE Ls Rs Rls Rrs)
 estimated duration: 111.110833 sec
 audio bytes: 255999360
 audio packets: 10666640
 bit rate: 18432000 bits per second
 packet size upper bound: 24
 maximum packet size: 24
 audio data file offset: 130
 optimized
 audio 10666640 valid frames + 0 priming + 0 remainder = 10666640
 source bit depth: I24
 ----
 %
 }}}

 Using afconvert to force a change of channel layout tag w/out
 re-ordering (instead, overriding the layout tag for the input):
 {{{
 kAudioChannelLayoutTag_WAVE_7_1 = (189U<<16)
 }}}
 {{{
 % afconvert -v -f caff -d LEI24 -l WAVE_7_1 -l WAVE_7_1 ffmpeg.caf
 afconvert.caf
 Input file: ffmpeg.caf, 10666640 frames, MPEG_7_1_C
 Formats:
   Input file     8 ch,  96000 Hz, lpcm (0x0000000C) 24-bit little-endian
 signed integer
                  WAVE_7_1 -- overriding layout MPEG_7_1_C in file
   Output file    8 ch,  96000 Hz, lpcm (0x0000000C) 24-bit little-endian
 signed integer
                  WAVE_7_1
 Optimizing afconvert.caf... done
 Output file: afconvert.caf, 10666640 frames
 %
 }}}
 Result:
 {{{
 % afinfo afconvert.caf
 File:           afconvert.caf
 File type ID:   caff
 Num Tracks:     1
 ----
 Data format:     8 ch,  96000 Hz, lpcm (0x0000000C) 24-bit little-endian
 signed integer
 Channel layout: 7.1 (L R C LFE Rls Rrs Ls Rs)
 estimated duration: 111.110833 sec
 audio bytes: 255999360
 audio packets: 10666640
 bit rate: 18432000 bits per second
 packet size upper bound: 24
 maximum packet size: 24
 audio data file offset: 4096
 optimized
 audio 10666640 valid frames + 0 priming + 0 remainder = 10666640
 source bit depth: I24
 ----
 tim at Timothys-MBP Downloads %
 }}}
 {{{
 Channel layout: 7.1 (L R C LFE Rls Rrs Ls Rs)
 AV_CH_LAYOUT_7POINT1 L R C LFE BL  BR  SL SR
 }}}


 Making kAudioChannelLayoutTag_WAVE_7_1 potentially useful.

 However, the WAVE layout tags were not present several years ago, so I am
 unsure what is
 the oldest version of macOS/afconvert that can actually read files with
 such tags "correctly".

 {{{
 kAudioChannelLayoutTag_WAVE_6_1 = (188U<<16) | 7
 }}}

 afconvert -v -f caff -d LEI24 -l WAVE_6_1 -l WAVE_6_1 6.1.ffmpeg.caf
 6.1.afconvert.caf

 {{{
 % afinfo 6.1.afconvert.caf
 File:           6.1.afconvert.caf
 File type ID:   caff
 Num Tracks:     1
 ----
 Data format:     7 ch,  96000 Hz, lpcm (0x0000000C) 24-bit little-endian
 signed integer
 Channel layout: 6.1 (L R C LFE Cs Ls Rs)
 estimated duration: 111.110833 sec
 audio bytes: 223999440
 audio packets: 10666640
 bit rate: 16128000 bits per second
 packet size upper bound: 21
 maximum packet size: 21
 audio data file offset: 4096
 optimized
 audio 10666640 valid frames + 0 priming + 0 remainder = 10666640
 source bit depth: I24
 ----
 %
 }}}
 {{{
 Channel layout: 6.1 (L R C LFE Cs Ls Rs)
 AV_CH_LAYOUT_6POINT1 L R C LFE BC SL SR
 }}}

 Other WAVE layout tags:
 {{{
 kAudioChannelLayoutTag_WAVE_2_1   = kAudioChannelLayoutTag_DVD_4
 kAudioChannelLayoutTag_WAVE_3_0   = kAudioChannelLayoutTag_MPEG_3_0_A
 kAudioChannelLayoutTag_WAVE_4_0_A = kAudioChannelLayoutTag_ITU_2_2
 kAudioChannelLayoutTag_WAVE_4_0_B = (185U<<16) | 4
 kAudioChannelLayoutTag_WAVE_5_0_A = kAudioChannelLayoutTag_MPEG_5_0_A
 kAudioChannelLayoutTag_WAVE_5_0_B = (186U<<16) | 5
 kAudioChannelLayoutTag_WAVE_5_1_A = kAudioChannelLayoutTag_MPEG_5_1_A
 kAudioChannelLayoutTag_WAVE_5_1_B = (187U<<16) | 6
 }}}

 The _B layout tags are a bit redundant and can arguably only map to the
 _BACK channel layouts,
 whereas the _A variants are a bit more versatile; the difference being Ls
 vs. Rls and Rs vs. Rrs:

 afconvert -v -f caff -d LEI24 -l WAVE_5_1_B -l WAVE_5_1_B 5.1.ffmpeg.caf
 5.1.afconvert.caf
 {{{
 Channel layout: 5.1 (L R C LFE Rls Rrs)
 _LAYOUT_5POINT1_BACK L R C LFE BL  BR
 }}}
 afconvert -v -f caff -d LEI24 -l WAVE_5_1_A -l WAVE_5_1_A 5.1.ffmpeg.caf
 5.1.afconvert.caf
 {{{
 Channel layout: 5.1 (L R C LFE Ls Rs)
 _LAYOUT_5POINT1_BACK L R C LFE BL BR
 AV_CH_LAYOUT_5POINT1 L R C LFE SL SR
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10321#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list