GNOME Bugzilla – Bug 598916
qtmux: support more of j2k
Last modified: 2009-12-16 19:47:17 UTC
Things that it would be nice if qtmux supported, regarding jpeg2000 data: 1. Images with alpha channels. Would require component mappings and channel definitions, as from #598915. 2. Similarly, images with nonstandard component counts or orderings. For example AYUV or BGRA. 3. Images with num-components != 3. This is probably just a bug, the num-components field in the image/x-j2c caps from #598915 could be used to determine this. See also #598915.
Created attachment 145887 [details] [review] First patch Please, review and test. I don't have many mj2 files around, and the jp2kdec keeps rejecting the files I try to play.
Created attachment 148833 [details] [review] same as thiago's patch, updated to compile Here's a patch that compiles with the current code. However the resulting file does not demux properly, due to an mdat without a length or something. Do you know what the deal is, Thiago?
BTW, I am finally able to deal in proper J2C streams, so I should be able to test this patch now. Sorry for the delay.
Could you make some samples available so that I could try myself?
(In reply to comment #2) > Created an attachment (id=148833) [details] [review] > same as thiago's patch, updated to compile > > Here's a patch that compiles with the current code. However the resulting file > does not demux properly, due to an mdat without a length or something. Do you > know what the deal is, Thiago? What pipeline are you using? Are you using gst-launch using a live src for recording? If so, you might be missing the -e flag to gst-launch to force it to push an EOS when you press the ctrl+c.
I have been trying to do so all day but found some bugs. I will have them for you next week :/
(In reply to comment #5) > (In reply to comment #2) > > Created an attachment (id=148833) [details] [review] [details] [review] > > same as thiago's patch, updated to compile > > > > Here's a patch that compiles with the current code. However the resulting file > > does not demux properly, due to an mdat without a length or something. Do you > > know what the deal is, Thiago? > > What pipeline are you using? Are you using gst-launch using a live src for > recording? If so, you might be missing the -e flag to gst-launch to force it to > push an EOS when you press the ctrl+c. That could very well be. I'll check it out. As it is I am having some problems getting my hardware decoder to handle valid j2c. Will let you know when things settly on my end. Thanks for the tip :)
Verily: image/x-j2c, fourcc=(fourcc)sYUV, width=(int)800, height=(int)600, num-components=(int)3, framerate=(fraction)10/1, fields=(int)1 http://wingolog.org/pub/thiago-j2c-yuv.gdp And: image/x-j2c, fourcc=(fourcc)sRGB, width=(int)800, height=(int)600, num-components=(int)3, framerate=(fraction)10/1, fields=(int)1, channel-definitions=(int)< 1, 2, 3 > http://wingolog.org/pub/thiago-j2c-rgb.gdp Both are about 1 MB, and 20 frames.
Hm, I see now that "image/x-j2c" is supposed to be boxed already, according to comments in gstjasperdec.c. The data in those streams is unboxed, but claims to be image/x-j2c.
I fixed my codestream muxer and made these with image/x-jpc caps. http://wingolog.org/pub/thiago-j2c-yuv.gdp http://wingolog.org/pub/thiago-j2c-rgb.gdp I have verified that the RGB one decodes correctly with jp2kdec (jasper), though it has an error on the yuv one, which I haven't yet tracked down.
er, sorry; I meant these links: http://wingolog.org/pub/thiago-jpc-yuv.gdp http://wingolog.org/pub/thiago-jpc-rgb.gdp
Whee, YUV decoding with jasper works too. I was just missing holy water in the form of ffmpegcolorspace.
Is there any way to make mj2mux accept jpc instead of j2c? It seems quite silly to have to box the codestreams just for Quicktime's benefit.
What is the difference between them in qt/mj2 muxing terms? Couldn't find it in the docs I have around.
Created attachment 149558 [details] [review] updated patch Still couldn't test as the current implementation is for image/x-jp2 streams.
Created attachment 149737 [details] [review] Support for more j2k Updated patch, now with support to jpc as well.
Most excellent! I have been able to mux frames, demux with qtmux, and decode them, with correct colors. Thank you very much!
Fixed. Module: gst-plugins-bad Branch: master Commit: 1b2e0eae670fafeb9773b7c9f7efdb8c06c05f18 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=1b2e0eae670fafeb9773b7c9f7efdb8c06c05f18 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Thu Dec 10 22:20:45 2009 -0300 qtmux: support more of j2k Reads the new caps added to qtdemux by commit c917d65e6df0b5d585f905c7ad78a8a0a44b2cb0 and adds its corresponding atoms. Also adds support for image/x-jpc as it is the same as image/x-jp2, except that the buffers need to be boxed inside a jp2c isom box before muxing. To solve this the QTPads now have a function that (if not NULL) is called when a buffer is collected. This function returns a replacement to the current collected buffer. Fixes #598916