flacenc: Wrong quality levels in GStreamer, level 9 doesn't exist in libflac
Submitted by Christian Stadelmann
Link to original bug (#776413)
Description
According to libflac [1], there are 9 compression levels, 0…8.
GstFlacEncQuality (values for the "quality" property in GstFlacEnc) has 10 compression levels, 0…9.
When trying to encode to FLAC through API with quality set to 9, I'm getting this GError:
GLib.Error: gst-library-error-quark: Die Unterstützungsbibliothek konnte nicht initialisiert werden. (3)
plus this debug message:
gstflacenc.c(872): gst_flac_enc_set_format (): /GstPipeline:pipeline0/GstFlacEnc:flacenc0:
could not initialize encoder (wrong parameters?) 11
Steps to reproduce:
- run:
$ gst-launch-1.0 filesrc location=test.mp3 ! mpegaudioparse ! mad ! audioconvert ! flacenc quality=8 ! filesink location=test.flac"
which runs fine.
- run
$ gst-launch-1.0 filesrc location=test.mp3 ! mpegaudioparse ! mad ! audioconvert ! flacenc quality=9 ! filesink location=test.flac"
gives an error message instead:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFlacEnc:flacenc0: Could not initialize supporting library.
Additional debug info:
gstflacenc.c(872): gst_flac_enc_set_format (): /GstPipeline:pipeline0/GstFlacEnc:flacenc0:
could not initialize encoder (wrong parameters?) 11
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
I'm running gstreamer1-plugins-good-1.10.2-1.fc25.x86_64 on Fedora 25.
[1] https://www.xiph.org/flac/api/group__flac__stream__encoder.html#gae49cf32f5256cb47eecd33779493ac85
Version: 1.10.x