Opened 13 years ago
Closed 5 months ago
#98 closed defect (fixed)
Channel reordering in pcm files
Reported by: | Carl Eugen Hoyos | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | undetermined |
Version: | git-master | Keywords: | chan |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | yes |
Description
I will attach a three channel pcm caf file. The file contains left, center and right stream, FFmpeg currently warns that the channel layout is unsupported. It is simple to set the correct channel layout (trivial patch attached), but the problem is that the file has channel order "center, left, right" (MPEG-3-0-B), so that FFmpeg maps the left channel to the right, the right channel to center and the center channel to the left channel on decoding.
How can a demuxer tell the pcm decoder that the decoder has to reorder channels?
ffmpeg -i MPEG30B.caf FFmpeg version git-N-29301-gab15726, Copyright (c) 2000-2011 the FFmpeg developers built on Apr 23 2011 10:48:07 with gcc 4.5.2 configuration: --cc=/usr/local/gcc-4.5.2/bin/gcc --enable-gpl --enable-libcelt libavutil 51. 0. 0 / 51. 0. 0 libavcodec 53. 1. 0 / 53. 1. 0 libavformat 53. 0. 1 / 53. 0. 1 libavdevice 53. 0. 0 / 53. 0. 0 libavfilter 2. 0. 0 / 2. 0. 0 libswscale 0. 13. 0 / 0. 13. 0 [caf @ 0x12a0ae0] Unknown channel layout. [caf @ 0x12a0ae0] Estimating duration from bitrate, this may be inaccurate Input #0, caf, from 'MPEG30B.caf': Duration: 00:00:10.66, start: 0.000000, bitrate: 1151 kb/s Stream #0.0: Audio: pcm_s8, 48000 Hz, 3 channels, u8, 1152 kb/s At least one output file must be specified
Attachments (2)
Change History (8)
by , 13 years ago
Attachment: | MPEG30B.caf added |
---|
by , 13 years ago
Attachment: | patchMPEG30Blayout.diff added |
---|
comment:1 by , 12 years ago
Analyzed by developer: | set |
---|---|
Reproduced by developer: | set |
Status: | new → open |
Type: | enhancement → defect |
Version: | git → git-master |
comment:2 by , 12 years ago
Keywords: | chan added; pcm channel order layout removed |
---|
comment:3 by , 9 years ago
more possible solutions: (not saying they are better or not than what was suggested)
the demxuer could just reorder chanels
the demuxer could pass the channel order through extradata or sidedata to the decoder
comment:5 by , 4 years ago
Is not that like this done here https://github.com/FFmpeg/FFmpeg/blob/a0ac49e38ee1d1011c394d7be67d0f08b2281526/libavformat/mov_chan.c#L177 and
maybe it should be here https://github.com/FFmpeg/FFmpeg/blob/904ab5365cf4881eae1e5cac980f3c4f252b69cd/libavformat/isom.c#L711
comment:6 by , 5 months ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed in e6c2c8703732bc46395c65c530038c8146df0deb.
This is now a bug because FFmpeg incorrectly reports "3.0" instead of "3 channels, unknown layout".
I sent a patch last year to fix this ticket:
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/132789