GNOME Bugzilla – Bug 638578
Add support for 12 bit sRGB JPEG-2000 images
Last modified: 2012-12-16 20:06:22 UTC
Created attachment 177412 [details] Debug log for the pipeline specified above I've been trying to play the mxf file using the following pipeline: filesrc location="path/to/foo.mxf" ! mxfdemux name=d d. ! jp2kdec ! ffmpegcolorspace ! videoscale ! autovideosink It fails before the pipeline can be set to PLAYING state, with this error message: ERROR : element /GstPipeline:pipeline0/GstMXFDemux:d : Internal data stream error. Additional debug info: mxfdemux.c(2797): gst_mxf_demux_loop (): /GstPipeline:pipeline0/GstMXFDemux:d: stream stopped, reason not-negotiated The complete debug log is attached. An example of a failing MXF file can be found here: http://rapidshare.com/files/440575455/lenna.mxf Tested with gst-core 0.10.30, and gst-plugins-bad 0.10.20, on Ubuntu 10.10.
Problem in jp2kdec, it doesn't support 12 bit sRGB images yet. 0:00:01.199506070 16069 0x10c59a0 LOG jp2kdec gstjasperdec.c:272:gst_jasper_dec_negotiate:<jp2kdec0> 2048 x 1080, 3 components 0:00:01.199538546 16069 0x10c59a0 DEBUG jp2kdec gstjasperdec.c:279:gst_jasper_dec_negotiate:<jp2kdec0> forcing container supplied colour space 1025 0:00:01.199549092 16069 0x10c59a0 LOG jp2kdec gstjasperdec.c:303:gst_jasper_dec_negotiate:<jp2kdec0> image component 0, 2048x1080, depth 12, sgnd 0 0:00:01.199559149 16069 0x10c59a0 DEBUG jp2kdec gstjasperdec.c:438:gst_jasper_dec_negotiate:<jp2kdec0> Decoded image has unsupported colour space.
*** Bug 643115 has been marked as a duplicate of this bug. ***
Here is another example of a DCP compliant MXF file. DCP j2k is encoded in the CIE1931 XYZ colorspace. http://files.aehunter.net/Sintel/Sintel-j2k-12bit-4k-test.mxf
Created attachment 200462 [details] [review] jp2k: support for decoding 12 bit components Since we don't have a 12 bit depth format in GStreamer, I chose to convert to r210 (10 bit depth), as the next possible format is ARGB with 16 bit depth, and we don't really need an alpha channel here. This is arbitrary, and others might prefer using the 64 bit format anyway, this is changeable easily enough if desired.
Tested with the Sintel sample, the first one appears to have gone.
Would be better to add the 12bpp format instead of converting inside jp2kdec.
12 bits means more than 32 bits per pixel though. So probably 64, doubling the size required. And needing to add support to colorspace converters too, or the output would be unusable. But yes, it'd be better. So I guess this waits till converters get support for 12 bit forat (or just 16) ?
I think we should add support for the 12 bit format that is generated by jp2kdec to libgstvideo, ffmpegcolorspace and colorspace/videoconvert. I assume this format is also used elsewhere.
I have new elements for 1.0 using openjpeg that support 12 bit RGB and many other new color formats. Will clean them up and push soon.
commit e1416c11a452c11e07a5072bff1c5bbe0b053479 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Fri Dec 14 14:38:45 2012 +0000 openjpeg: Add OpenJPEG based JPEG2000 decoder