[FFmpeg-devel] [PATCH] alsdec: channel sorting
Thilo Borgmann
thilo.borgmann at googlemail.com
Thu Jan 3 01:32:23 CET 2013
Am 02.01.13 23:38, schrieb Paul B Mahol:
> On 1/2/13, Thilo Borgmann <thilo.borgmann at googlemail.com> wrote:
>> Am 21.12.12 15:05, schrieb Paul B Mahol:
>>> On 12/21/12, Thilo Borgmann <thilo.borgmann at googlemail.com> wrote:
>>>> Am 21.12.12 14:21, schrieb Paul B Mahol:
>>>>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>>>>> ---
>>>>> libavcodec/alsdec.c | 13 ++++++++++---
>>>>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>>>
>>>> Probably ok. Have you tested and veryfied using the reference
>>>> encoder/decoder?
>>>>
>>>
>>> Yes, without this patch ffmpeg reports CRC error.
>>
>> During my test today ffmpeg still reports a CRC error after you pushed the
>> patch:
>>
>>
>>
>> localhost:tmp Thilo$ ./mp4alsRM23 -m6,1,2,4,5,3 in_6ch.wav out_2.mp4
>> localhost:tmp Thilo$ ../ffmpeg -debug 1 -i out_2.mp4 -debug 1 -f crc -
>> ffmpeg version N-48393-g8bc7422 Copyright (c) 2000-2013 the FFmpeg
>> developers
>> built on Jan 2 2013 19:27:49 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
>> configuration: --disable-encoder=mpeg2video
>> libavutil 52. 13.100 / 52. 13.100
>> libavcodec 54. 85.100 / 54. 85.100
>> libavformat 54. 59.100 / 54. 59.100
>> libavdevice 54. 3.102 / 54. 3.102
>> libavfilter 3. 30.102 / 3. 30.102
>> libswscale 2. 1.103 / 2. 1.103
>> libswresample 0. 17.102 / 0. 17.102
>> matched as AVOption 'debug' with argument '1'.
>> Reading option '-i' ... matched as input file with argument 'out_2.mp4'.
>> Reading option '-debug' ... matched as AVOption 'debug' with argument '1'.
>> Reading option '-f' ... matched as option 'f' (force format) with argument
>> 'crc'.
>> Reading option '-' ... matched as output file.
>> Finished splitting the commandline.
>> Parsing a group of options: global .
>> Successfully parsed a group of options.
>> Parsing a group of options: input file out_2.mp4.
>> Successfully parsed a group of options.
>> Opening an input file: out_2.mp4.
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9cfb03d800] Format mov,mp4,m4a,3gp,3g2,mj2
>> probed
>> with size=2048 and score=100
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9cfb03d800] ISO: File Type Major Brand: mp42
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9cfb03d800] File position before
>> avformat_find_stream_info() is 8885069
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9cfb03d800] All info found
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9cfb03d800] File position after
>> avformat_find_stream_info() is 8884417
>> Guessed Channel Layout for Input Stream #0.0 : 5.1
>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out_2.mp4':
>> Metadata:
>> major_brand : mp42
>> minor_version : 0
>> compatible_brands: mp42isom
>> creation_time : 2013-01-02 20:33:39
>> Duration: 00:00:13.84, start: 0.000000, bitrate: 5134 kb/s
>> Stream #0:0(und), 1, 1/96000: Audio: mp4als (mp4a / 0x6134706D), 96000
>> Hz,
>> 5.1, s32, 5133 kb/s
>> Metadata:
>> creation_time : 2013-01-02 20:33:39
>> Successfully openened the file.
>> Parsing a group of options: output file -.
>> Applying option f (force format) with argument crc.
>> Successfully parsed a group of options.
>> Opening an output file: -.
>> Successfully openened the file.
>> [abuffer @ 0x7f9cfac19ba0] Setting entry with key 'time_base' to value
>> '1/96000'
>> [abuffer @ 0x7f9cfac19ba0] Setting entry with key 'sample_rate' to value
>> '96000'
>> [abuffer @ 0x7f9cfac19ba0] Setting entry with key 'sample_fmt' to value
>> 's32'
>> [abuffer @ 0x7f9cfac19ba0] Setting entry with key 'channel_layout' to value
>> '0x3f'
>> [graph 0 input from stream 0:0 @ 0x7f9cfac18760] tb:1/96000 samplefmt:s32
>> samplerate:96000 chlayout:0x3f
>> [aformat @ 0x7f9cfac1a140] Setting entry with key 'sample_fmts' to value
>> 's16'
>> [audio format for output stream 0:0 @ 0x7f9cfac1a060] auto-inserting filter
>> 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
>> filter
>> 'audio format for output stream 0:0'
>> [auto-inserted resampler 0 @ 0x7f9cfac1a680] chl:5.1 fmt:s32 r:96000Hz ->
>> chl:5.1 fmt:s16 r:96000Hz
>> Output #0, crc, to 'pipe:':
>> Metadata:
>> major_brand : mp42
>> minor_version : 0
>> compatible_brands: mp42isom
>> encoder : Lavf54.59.100
>> Stream #0:0(und), 0, 1/90000: Audio: pcm_s16le, 96000 Hz, 5.1, s16, 9216
>> kb/s
>> Metadata:
>> creation_time : 2013-01-02 20:33:39
>> Stream mapping:
>> Stream #0:0 -> #0:0 (als -> pcm_s16le)
>> Press [q] to stop, [?] for help
>> Multiple frames in a packet from stream 0
>> Last message repeated 98 times
>> [output stream 0:0 @ 0x7f9cfac19e60] 100 buffers queued in output stream
>> 0:0,
>> something may be wrong.
>> Multiple frames in a packet from stream 0
>> Last message repeated 224 times
>> [als @ 0x7f9cfb040400] CRC error!
>> [output stream 0:0 @ 0x7f9cfac19e60] EOF on sink link output stream
>> 0:0:default.
>> No more output streams to write to, finishing.
>> CRC=0x36aa7466
>> size= 0kB time=00:00:13.84 bitrate= 0.0kbits/s
>> video:0kB audio:15575kB subtitle:0 global headers:0kB muxing overhead
>> -99.999906%
>> Statistics: 8917805 bytes read, 2 seeks
>>
>>
>>
>>
>> Do I miss something?
>
> No I can reproduce this, something fishy is going on.
The only thing I can imaging is that the CRC is computed on the wrong data if
chan_sort == 1. But this would have prevented your initial test from confirming
correctness.
Are you going to have a closer look on this? (otherwise its on me with barely
any sparetime...)
-Thilo
More information about the ffmpeg-devel
mailing list