GNOME Bugzilla – Bug 625407
ffenc_nellymoser lists too many formats in the sink caps
Last modified: 2010-07-28 05:42:48 UTC
ffenc_nellymoser lists many different audio formats in their sink caps: SINK template: 'sink' Availability: Always Capabilities: audio/x-raw-int channels: [ 1, 2 ] rate: [ 4000, 96000 ] signed: true endianness: 1234 width: 16 depth: 16 audio/x-raw-int channels: [ 1, 2 ] rate: [ 4000, 96000 ] signed: true endianness: 1234 width: 32 depth: 32 audio/x-raw-float channels: [ 1, 2 ] rate: [ 4000, 96000 ] endianness: 1234 width: 32 audio/x-raw-float channels: [ 1, 2 ] rate: [ 4000, 96000 ] endianness: 1234 width: 64 Despite this, the encoders only work properly when actually fed with audio/x-raw-int, width=16 - feeding data in any other format only produces garbage, without outputting any warning. Sample command line that illustrates the problem: gst-launch audiotestsrc ! audio/x-raw-float ! ffenc_nellymoser ! ffdec_nellymoser ! wavenc ! filesink location=foo.wav The same issue, listing too many sink caps, seems to happen for at least ffenc_alac, too.
Until libavcodec can give us the optimal format one must use for each encoder... there's not much we can do (hardcoding values in gst-ffmpeg is painfully bad).
Wouldn't it be safer only to list int16 if the encoder itself doesn't specify anything? Then you wouldn't get false matches at least.
What would it take to fix this from the ffmpeg side, btw? I tried adding this: Index: libavcodec/nellymoserenc.c =================================================================== --- libavcodec/nellymoserenc.c (revision 23755) +++ libavcodec/nellymoserenc.c (working copy) @@ -392,4 +392,5 @@ .close = encode_end, .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY, .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, }; But that didn't seem to help.
Scratch that - it does seem to help. I'll try to get that into ffmpeg, then.
Fixed in ffmpeg SVN rev 24560.