GNOME Bugzilla – Bug 756288
avenc_jpeg2000 and avdec_jpeg2000 can't negotiate caps
Last modified: 2015-10-12 08:56:24 UTC
Simple pipeline like this doesn't work: gst-launch-1.0 videotestsrc ! videoconvert ! avenc_jpeg2000 ! avdec_jpeg2000 ! fakesink It gives internal dataflow error. With GST_DEBUG=5 I see this: 0:00:07.732583626 5411 0xa0fa00 DEBUG bin gstbin.c:883:find_message:<pipeline0> no message found matching types 00001000 If I remove avdec from pipeline I can see this: c:3074:gst_pad_query_caps_default:<avenc_jpeg2000-0:src>[00m using caps 0x1586540 unknown/unknown 0:00:00.240567066 [334m 5451[00m 0x1546a00 [37mDEBUG [00m [00;01;31;41m GST_PADS gstpad.c:3272:gst_pad_query_default:<avenc_jpeg2000-0:src>[00m not forwarding 0x1586680 (caps) query 0:00:00.240574648 [334m 5451[00m 0x1546a00 [37mDEBUG [00m [00;01;31;41m GST_PADS gstpad.c:3836:gst_pad_query:<avenc_jpeg2000-0:src>[00m sent query 0x1586680 (caps), result 1 0:00:00.240581884 [334m 5451[00m 0x1546a00 [37mDEBUG [00m [00;01;34m GST_CAPS gstutils.c:2845:gst_pad_query_caps:<avenc_jpeg2000-0:src>[00m query returned unknown/unknown It seems to me that avenc_jpeg2000 for some reason has sink caps "unknown/unkown". Source caps for avdec_jpeg2000 also are "unknown/unknown".
Kind of a duplicate of #733467 there is a patch there that at least gets the mapping correct. *** This bug has been marked as a duplicate of bug 733467 ***
Thiago, I believe you are wrong. Bug you marked as duplicate is said to be fixed in libav commit cbc808d726afdf53d866264722785c1304c17390. The only change I can see there is in file jpeg2000dec.c: if (ncomponents > 3) { became if (ncomponents > 4) { in function static int get_siz(Jpeg2000DecoderContext *s). That was in 2014; that fix is present in libav 10.7 and in gst-libav-1.6.0.tar.xz from which I built gst-libav plugins. And I honestly don't understand how that fix can be related to gstreamer caps. Please, correct me if I'm wrong; my understanding of gstreamer and libav source structure is very poor.
I can confirm that caps for jpeg2000 are missing. Here is the template on both encoder and decoder. SINK template: 'sink' Availability: Always Capabilities: unknown/unknown
It's also missing from the codecmap, which means this just never worked before.
(In reply to Amomum from comment #2) > Thiago, I believe you are wrong. > > Bug you marked as duplicate is said to be fixed in libav commit > cbc808d726afdf53d866264722785c1304c17390. > > The only change I can see there is in file jpeg2000dec.c: > if (ncomponents > 3) { > > became > > if (ncomponents > 4) { > > in function static int get_siz(Jpeg2000DecoderContext *s). > > That was in 2014; that fix is present in libav 10.7 and in > gst-libav-1.6.0.tar.xz from which I built gst-libav plugins. > > And I honestly don't understand how that fix can be related to gstreamer > caps. > > Please, correct me if I'm wrong; my understanding of gstreamer and libav > source structure is very poor. The fix in libav was for some issue in JPEG2000 decoding, there is a patch in the bug I mentioned that adds the proper mapping of caps to gst-libav (that is the gstreamer plugin for libav/ffmpeg) and that makes your pipeline work. You can try applying it and checking if it works for you.
*** This bug has been marked as a duplicate of bug 733467 ***
Thiago Sousa Santos, you are right. I didn't notice attached files in your link. After applying that patch simple pipeline indeed starts to work. The only question remaining is this: why is that patch still not in the master, after a whole year of existence? I also could not link avenc_jpeg2000 to rtpj2kpay without little modification of your patch (as I described in bug 756422).