[FFmpeg-devel] [RFC] lavfi-audio test

Mina Nagy Zaki mnzaki at gmail.com
Fri Jul 22 13:30:27 CEST 2011


On Wed, Jul 20, 2011 at 01:18:28AM +0200, Stefano Sabatini wrote:
> On date Monday 2011-07-18 01:41:49 +0200, Stefano Sabatini encoded:
[...]
> 
> Added a check on the supported layout conversions, now I get:
> $ make V=1 fate-lavfi-audiofmts_anull
> [...]
> TEST    lavfi-audiofmts_anull
> ./tests/fate-run.sh fate-lavfi-audiofmts_anull "" "" "/home/stefano/src/ffmpeg-mnzaki2" 'lavfitest' '' '' '' '' ''
> /home/stefano/src/ffmpeg-mnzaki2/ffmpeg -v 0 -y -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -threads 1 -ar 44100 -ac 2 -sample_fmt s16 -i /home/stefano/src/ffmpeg-mnzaki2/./tests/data/asynth1.sw -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -threads 1 -dct fastint -af aformat=dbl:mono:packed,anull= -acodec pcm_f64le -sample_fmt dbl -f nut md5:
> --- ./tests/ref/lavfi/audiofmts_anull	2011-07-18 00:51:31.000000000 +0200
> +++ tests/data/fate/lavfi-audiofmts_anull	2011-07-20 01:13:54.000000000 +0200
> @ -1 +1 @@
> -null
> \ No newline at end of file
> +dbl_mono_packed     
> \ No newline at end of file
> make: *** [fate-lavfi-audiofmts_anull] Error 
> 
> or in other words the -af aformat=dbl:mono:packed,anull filter is
> crashing ffmpeg.
> 
> Mina, can you have a look?

Actually aformat takes packing as a bool like it is stored in links and buffers,
so 0 for packed and 1 for planar. It might be better to change to keywords for
arguments to be consistent though. It works properly if you use dbl:mono:0, but
there's a bug in handling "planar mono" that I'm going to fix in the new branch.

It's also worthwhile to note that the asink/asrc filters take their formats from
the input and output parameters to ffmpeg, except for planar/packed since all
encoding/decoding is always packed. So,
./ffmpeg -i file.wav -ac 2 -sample_fmt dbl out.wav
will insert an appropriate aconvert. 


> +# tell if the $1 -> $2 conversion is supported
> +supported_channel_conversion() {
> +    src=$1
> +    dst=$2
> +    # hardcode available conversions in aconvert, needs to be updated as the code is changed
> +    [ "$src" = "mono" -a "$dst" = "5.1"    ] ||
> +    [ "$src" = "5.1"  -a "$dst" = "stereo" ] ||
> +    [                    "$dst" = "mono"   ];

These are the currently supported:

[ "$src" = "stereo" -a "$dst" = "5.1"    ] ||
[                      "$dst" = "stereo" ] ||
[                      "$dst" = "mono"   ];




More information about the ffmpeg-devel mailing list