After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625407 - ffenc_nellymoser lists too many formats in the sink caps
ffenc_nellymoser lists too many formats in the sink caps
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gst-libav
0.10.10
Other Mac OS
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-07-27 15:54 UTC by Martin Storsjö
Modified: 2010-07-28 05:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Storsjö 2010-07-27 15:54:11 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.
Comment 1 Edward Hervey 2010-07-27 16:27:53 UTC
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).
Comment 2 Martin Storsjö 2010-07-27 16:53:30 UTC
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.
Comment 3 Martin Storsjö 2010-07-27 17:15:23 UTC
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.
Comment 4 Martin Storsjö 2010-07-27 19:53:45 UTC
Scratch that - it does seem to help. I'll try to get that into ffmpeg, then.
Comment 5 Martin Storsjö 2010-07-28 05:42:48 UTC
Fixed in ffmpeg SVN rev 24560.