Bug#863663: libgstreamer1.0-0: plays MJPEG AVI files (and possibly other formats) at degraded quality

Francesco Poli invernomuto at paranoici.org
Sun Jun 18 11:01:20 UTC 2017


On Thu, 15 Jun 2017 10:09:10 +0300 Sebastian Dröge wrote:

[...]
> Please ask GStreamer development
> related question on the GStreamer mailing list, someone else will be
> able to help you there:
>   https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Dear Sebastian, dear GStreamer developers,
while waiting for the actual bug to be fixed in GStreamer, I am trying
to modify the application (pdf-presenter-console, which is written in
Vala) in order to work around the bug and force the GStreamer library
to use avdec_mjpeg, in stead of jpegdec.

For those who need more context, please take a look at the [Debian bug
#863663] and at the [GStreamer bug 783267].

[Debian bug #863663]: <https://bugs.debian.org/863663>
[GStreamer bug 783267]: <https://bugzilla.gnome.org/show_bug.cgi?id=783267>


Well, my attempts to work around the bug are failing miserably!   :-(

Please someone help me!

The code I added gets a reference to the GStreamer registry singleton
by using  Gst.Registry.get() .
Then, it invokes its lookup_feature() method to find "jpegdec" and
"avdec_mjpeg".
It checks their ranks with get_rank() and finds

  jpegdec     → rank 256
  avdec_mjpeg → rank 64

It then sets swapped ranks with set_rank() :

  jpegdec     → rank 64
  avdec_mjpeg → rank 256

which are checked again and found to be set as desired.

Nonetheless, the AVI file is still played at degraded quality,
as if nothing had changed at all.

The added Vala code (which I hereby release under the terms of the GNU
GPL v2 or later) is:

            GLib.printerr("trying to access the GStreamer registry...\n");
            Gst.Registry regist = Gst.Registry.get();
            GLib.printerr("looking for jpegdec...\n");
            Gst.PluginFeature jdplugin = regist.lookup_feature("jpegdec");
            if (jdplugin != null) {
                GLib.printerr("jpegdec found with rank %u\n", jdplugin.get_rank());
                jdplugin.set_rank(64);
                GLib.printerr("jpegdec set to rank %u\n", jdplugin.get_rank());
            }
            else {
                GLib.printerr("jpegdec not found!\n");
            }
            GLib.printerr("looking for avdec_mjpeg...\n");
            Gst.PluginFeature mjplugin = regist.lookup_feature("avdec_mjpeg");
            if (mjplugin != null) {
                GLib.printerr("avdec_mjpeg found with rank %u\n", mjplugin.get_rank());
                mjplugin.set_rank(256);
                GLib.printerr("avdec_mjpeg set to rank %u\n", mjplugin.get_rank());
            }
            else {
                GLib.printerr("avdec_mjpeg not found!\n");
            }


The output that I get is:


  trying to access the GStreamer registry...
  looking for jpegdec...
  jpegdec found with rank 256
  jpegdec set to rank 64
  looking for avdec_mjpeg...
  avdec_mjpeg found with rank 64
  avdec_mjpeg set to rank 256


If I instead set jpegdec to rank 1, GStreamer spits out the following
error:

  Gstreamer error Your GStreamer installation is missing a plug-in.

Hence, it seems that I am actually modifying the ranks and that these
modified ranks actually change something.
But I seem to be unable to persuade GStreamer to use avdec_mjpeg in
stead of jpegdec!

Where am I going wrong?
Could someone please take a look at this and provide some help?

Thanks a lot for your time.



-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170618/c1b8a5d4/attachment-0001.sig>


More information about the gstreamer-devel mailing list