GNOME Bugzilla – Bug 688823
Not able to display certain jpegs via playbin when using HTTP
Last modified: 2013-07-23 13:03:53 UTC
The jpeg at http://rygel-project.org/snapshot/testfiles/foo.jpg works fine when used with playbin from local file system, but when used via HTTP, playbin/decodebin decides to use avdec_mjpeg which then displays green garbage only. This does not apply to all jpegs, displaying e.g. http://jensge.org/wp-content/uploads/2012/06/cropped-DSC018201.jpg works fine.
The following error is due to the fact that in foo.jpg the image data is preceded by EXIF and XMP metadata and this cause the type detector to fail to find the width and height of the image. $ gst-launch-1.0 playbin uri=http://rygel-project.org/snapshot/testfiles/foo.jpg Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Missing element: JPEG decoder WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'image/jpeg'. Additional debug info: gsturidecodebin.c(879): unknown_type_cb (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0 ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0: Your GStreamer installation is missing a plug-in. Additional debug info: gstdecodebin2.c(3714): gst_decode_bin_expose (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0: no suitable plugins found ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ... With debug output enabled things go wrong after the following line: decodebin gstdecodebin2.c:1873:connect_pad:<typefind> caps image/jpeg not subset of image/jpeg, width=(int)[ 1, 65535 ], height=(int)[ 1, 65535 ] In fact at that point caps are just "image/jpeg".
Created attachment 240073 [details] [review] Failing testcase for the gstreamer unittests Testing that "image/jpeg" is a proper subset of "image/jpeg, width=(int)[ 1, 65535 ], height=(int)[ 1, 65535 ]" with gst_caps_is_subset() currently fails.
gst_caps_is_subset() docs say that: * <note>This function does not work reliably if optional properties for caps * are included on one caps and omitted on the other.</note> It may be the case here. I'd suppose that gst/typefind/gsttypefindfunctions.c:jpeg_type_find() in gst-plugins-base should be changed to always return the width and height properties, even if unset.
What is needed here is a jpegparse that's up to scratch, so it can be given a rank, and be put between src and decoder. The typefinder can't/shouldn't really set width/height to something random if it doesn't know. It could probably be fixed to handle the APPx markers better so that it actually gets to the SOF.
Comment on attachment 240073 [details] [review] Failing testcase for the gstreamer unittests This testcase is wrong. c2 is a superset of c1.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 626531 ***