GNOME Bugzilla – Bug 706884
audioconvert: Only considers first structure when fixating caps
Last modified: 2018-11-03 11:25:56 UTC
This pipeline for example should negotiate to S32BE instead of S16LE: gst-launch-1.0 audiotestsrc ! audioconvert ! capsfilter caps="audio/x-raw,format=S32LE" ! audioconvert ! capsfilter caps="audio/x-raw,format={S8, S16LE};audio/x-raw,format=S32BE" ! fakesink -v But because the fixate function inside gstaudioconvert.c only looks at the first structure this does not happen. It should probably iterate over all structures after fixating each structure for itself, and then select the first best structure according to the same algorithm as it currently fixates every structure.
*** Bug 731601 has been marked as a duplicate of this bug. ***
Given this bug is old, here some feedback to bump it's importance: currently gstreamer 1.2.4 is broken on (some) FreeBSD 10 due to this issue. I.e. gst-play file.ogg does produce hissing due to down sampling to 8 bits. Nicolas Dufresne reported that he had seen problems on Windows with gstreamer playback, but had not realised at that time this was due to incorrect audio resampling. So we have two different OSes where there are real audio playback issues, not just hypothecial sink examples that are broken.
This can be worked around in the sink by ordering the caps structures by the sample width... but of course should be fixed properly in audioconvert. There's a work-in-progress patch for this btw.
I suppose I can only do that with a source change right? None of my gstreamer based apps work right now.
(In reply to Sebastian Dröge (slomo) from comment #3) > This can be worked around in the sink by ordering the caps structures by the > sample width... but of course should be fixed properly in audioconvert. > > There's a work-in-progress patch for this btw. Maybe worth telling us where ? ;-P
I'm not sure anymore, I'll have to look for it :)
*** Bug 767226 has been marked as a duplicate of this bug. ***
There's a small unit test in https://bugzilla.gnome.org/show_bug.cgi?id=767226#c14 The solution for all this would be similar to what videoconvert is doing. Instead of truncating the caps to a single structure, it should generate a list of all possible conversion. The best conversion that is possible per structure (i.e. what it does now), and then for all those structures it should select the one that is "best" according to the metrics we already have.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/89.