Opened 9 months ago
Last modified 9 months ago
#10471 new defect
FLAC in MP4 ignores WAVEFORMATEXTENSIBLE_CHANNEL_MASK Vorbis Comment
| Reported by: | John Regan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | git-master | Keywords: | |
| Cc: | John Regan | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
When an MP4 file contains FLAC audio with a channel layout that requires signalling via Vorbis Comment in the FLAC Specific Box - ffmpeg ignores the comment and uses the incorrect channel layout.
Using the attached sample file:
% ffprobe 2_point_1.mp4
ffprobe version N-111429-g9a2335444b Copyright (c) 2007-2023 the FFmpeg developers
built with gcc 13.1.1 (GCC) 20230429
configuration:
libavutil 58. 14.100 / 58. 14.100
libavcodec 60. 22.100 / 60. 22.100
libavformat 60. 10.100 / 60. 10.100
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 8.102 / 9. 8.102
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55f7561ffd80] non-STREAMINFO FLACMetadataBlock(s) ignored
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2_point_1.mp4':
Metadata:
major_brand : iso6
minor_version : 0
compatible_brands: iso6aid3
Duration: 00:00:06.00, start: 0.000000, bitrate: 185 kb/s
Stream #0:0[0x1](und): Audio: flac (fLaC / 0x43614C66), 48000 Hz, 3.0, s16, 182 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
This should list a channel layout of 2.1 and instead lists 3.0.
Attachments (1)
Change History (4)
by , 9 months ago
| Attachment: | 2_point_1.mp4 added |
|---|
follow-up: 2 comment:1 by , 9 months ago
This is not really bug, metadata like comment are ignored.
flac in ogg have own channel layout set at codec level.
comment:2 by , 9 months ago
Replying to Elon Musk:
flac in ogg have own channel layout set at codec level.
Just want to clarify - this ticket is for FLAC in MP4, not FLAC in Ogg.
I'll ask the FLAC project what the intended way to signal custom channel layouts is for MP4.
comment:3 by , 9 months ago
After discussing with the FLAC project I do think this is a bug.
The primary definition of FLAC is considered the IETF spec - https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/ - and the spec is considered to apply to all encapsulations of FLAC, including MP4.
Since the FLAC spec states that the WAVEFORMATEXTENSIBLE_CHANNEL_MASK comment within a Vorbis Comment Block is used to signal a channel layout, and the ISO encapsulation spec allows for including Vorbis Comment Blocks in the FLAC Specific Box - the comment block should be parsed and the tag honored, similar to native FLAC files.



An MP4 file with FLAC audio. The FLAC specific box contains two FLAC metadata blocks - a STREAMINFO block and a Vorbis Comment block. The Vorbis Comment has a tag listing the channel layout.