Opened 3 years ago

Closed 7 weeks ago

#3847 closed defect (fixed)

Wrong decision of sample format

Reported by: mfcc64 Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
Wrong decision of sample format conversion from dblp to u8
Thank's
How to reproduce:

% ffplay -v debug -f lavfi 'aevalsrc=0.1*sin(2*PI*100*t):c=stereo, aformat=dbl, equalizer=frequency=100'
ffplay version N-65425-g4b63bce Copyright (c) 2003-2014 the FFmpeg developers
  built on Aug  9 2014 07:45:07 with gcc 4.8.1 (GCC) 20130603 (Red Hat 4.8.1-1)
  configuration: --disable-static --enable-shared --enable-gpl --enable-nonfree --enable-fontconfig --enable-frei0r --enable-libfaac --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libx264 --enable-openssl --enable-x11grab --enable-libvorbis --enable-libass --enable-libx265 --enable-opengl
  libavutil      52. 98.100 / 52. 98.100
  libavcodec     55. 73.101 / 55. 73.101
  libavformat    55. 55.100 / 55. 55.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.103 /  4. 11.103
  libswscale      2.  6.101 /  2.  6.101
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
detected 2 logical cores
[Parsed_aevalsrc_0 @ 0x7fdf54004c20] compat: called with args=[0.1*sin(2*PI*100*t):c=stereo]                                  
[Parsed_aevalsrc_0 @ 0x7fdf54004c20] Setting 'exprs' to value '0.1*sin(2*PI*100*t)'                                           
[Parsed_aevalsrc_0 @ 0x7fdf54004c20] Setting 'c' to value 'stereo'                                                            
[Parsed_aformat_1 @ 0x7fdf54007d80] Setting 'sample_fmts' to value 'dbl'                                                      
[Parsed_equalizer_2 @ 0x7fdf54008640] Setting 'frequency' to value '100'                                                      
[Parsed_aformat_1 @ 0x7fdf54007d80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_aevalsrc_0' and the filter 'Parsed_aformat_1'                                                                                              
[Parsed_equalizer_2 @ 0x7fdf54008640] auto-inserting filter 'auto-inserted resampler 1' between the filter 'Parsed_aformat_1' and the filter 'Parsed_equalizer_2'                                                                                           
[out @ 0x7fdf54007c80] auto-inserting filter 'auto-inserted resampler 2' between the filter 'Parsed_equalizer_2' and the filter 'out'                                                                                                                       
[AVFilterGraph @ 0x7fdf54005620] query_formats: 4 queried, 0 merged, 9 already done, 0 delayed
[Parsed_aevalsrc_0 @ 0x7fdf54004c20] sample_rate:44100 chlayout:stereo duration:-1
[auto-inserted resampler 0 @ 0x7fdf54009d80] [SWR @ 0x7fdf5400a1a0] Using double precision mode
[auto-inserted resampler 0 @ 0x7fdf54009d80] ch:2 chl:stereo fmt:dblp r:44100Hz -> ch:2 chl:stereo fmt:dbl r:44100Hz
[auto-inserted resampler 1 @ 0x7fdf5400e760] [SWR @ 0x7fdf5400eac0] Using double precision mode
[auto-inserted resampler 1 @ 0x7fdf5400e760] ch:2 chl:stereo fmt:dbl r:44100Hz -> ch:2 chl:stereo fmt:dblp r:44100Hz
[auto-inserted resampler 2 @ 0x7fdf540132e0] [SWR @ 0x7fdf54013700] Using double precision mode
[auto-inserted resampler 2 @ 0x7fdf540132e0] ch:2 chl:stereo fmt:dblp r:44100Hz -> ch:2 chl:stereo fmt:u8 r:44100Hz
[lavfi @ 0x7fdf540008c0] All info found
Input #0, lavfi, from 'aevalsrc=0.1*sin(2*PI*100*t):c=stereo, aformat=dbl, equalizer=frequency=100':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0, 1, 1/44100: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
[ffplay_abuffer @ 0x7fdf54018960] Setting 'sample_rate' to value '44100'
[ffplay_abuffer @ 0x7fdf54018960] Setting 'sample_fmt' to value 'u8'
[ffplay_abuffer @ 0x7fdf54018960] Setting 'channels' to value '2'
[ffplay_abuffer @ 0x7fdf54018960] Setting 'time_base' to value '1/44100'
[ffplay_abuffer @ 0x7fdf54018960] Setting 'channel_layout' to value '0x3'
[ffplay_abuffer @ 0x7fdf54018960] tb:1/44100 samplefmt:u8 samplerate:44100 chlayout:0x3
[ffplay_abuffersink @ 0x7fdf540198e0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
[AVFilterGraph @ 0x7fdf54018a80] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x7fdf5401a860] ch:2 chl:stereo fmt:u8 r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
Audio frame changed from rate:44100 ch:2 fmt:u8 layout:stereo serial:-1 to rate:44100 ch:2 fmt:u8 layout:stereo serial:1
[ffplay_abuffer @ 0x7fdf480018a0] Setting 'sample_rate' to value '44100'
[ffplay_abuffer @ 0x7fdf480018a0] Setting 'sample_fmt' to value 'u8'
[ffplay_abuffer @ 0x7fdf480018a0] Setting 'channels' to value '2'
[ffplay_abuffer @ 0x7fdf480018a0] Setting 'time_base' to value '1/44100'
[ffplay_abuffer @ 0x7fdf480018a0] Setting 'channel_layout' to value '0x3'
[ffplay_abuffer @ 0x7fdf480018a0] tb:1/44100 samplefmt:u8 samplerate:44100 chlayout:0x3
[ffplay_abuffersink @ 0x7fdf48002a80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
[AVFilterGraph @ 0x7fdf480015a0] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x7fdf48003da0] ch:2 chl:stereo fmt:u8 r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz

wrong decision here:

[auto-inserted resampler 2 @ 0x7fdf540132e0] ch:2 chl:stereo fmt:dblp r:44100Hz -> ch:2 chl:stereo fmt:u8 r:44100Hz
[auto-inserted resampler 0 @ 0x7fdf5401a860] ch:2 chl:stereo fmt:u8 r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
[auto-inserted resampler 0 @ 0x7fdf48003da0] ch:2 chl:stereo fmt:u8 r:44100Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz

Change History (5)

comment:1 Changed 3 years ago by cehoyos

  • Component changed from ffplay to avfilter
  • Reproduced by developer set
  • Status changed from new to open

Workaround is to specify aformat=dblp

comment:3 Changed 21 months ago by michael

  • Resolution set to fixed
  • Status changed from open to closed

comment:4 Changed 8 weeks ago by Ratio

  • Resolution fixed deleted
  • Status changed from closed to reopened

I see in sources that float format preferred over s32. But s32 has more precision (32 vs 23 bits).

comment:5 Changed 7 weeks ago by cehoyos

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.