After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756288 - avenc_jpeg2000 and avdec_jpeg2000 can't negotiate caps
avenc_jpeg2000 and avdec_jpeg2000 can't negotiate caps
Status: RESOLVED DUPLICATE of bug 733467
Product: GStreamer
Classification: Platform
Component: gst-libav
1.6.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-09 13:52 UTC by Amomum
Modified: 2015-10-12 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Amomum 2015-10-09 13:52:46 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".
Comment 1 Thiago Sousa Santos 2015-10-10 00:23:12 UTC
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 ***
Comment 2 Amomum 2015-10-10 13:18:49 UTC
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.
Comment 3 Nicolas Dufresne (ndufresne) 2015-10-10 22:33:24 UTC
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
Comment 4 Nicolas Dufresne (ndufresne) 2015-10-10 22:37:38 UTC
It's also missing from the codecmap, which means this just never worked before.
Comment 5 Thiago Sousa Santos 2015-10-11 08:31:54 UTC
(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.
Comment 6 Sebastian Dröge (slomo) 2015-10-11 09:37:19 UTC

*** This bug has been marked as a duplicate of bug 733467 ***
Comment 7 Amomum 2015-10-12 08:56:24 UTC
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).