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 719636 - deinterlace: alters caps in passthrough mode preventing hardware decode
deinterlace: alters caps in passthrough mode preventing hardware decode
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 720388
 
 
Reported: 2013-12-01 13:14 UTC by Lionel Landwerlin
Modified: 2018-01-29 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
deinterlace: don't alterate peer's caps in passthrough mode (1.08 KB, patch)
2013-12-01 13:16 UTC, Lionel Landwerlin
needs-work Details | Review
deinterlace: support ANY caps features if deinterlace mode allows it (2.08 KB, patch)
2013-12-06 17:23 UTC, Matthieu Bouron
none Details | Review
deinterlace: support ANY caps features if deinterlace mode allows it (2.08 KB, patch)
2013-12-06 17:27 UTC, Matthieu Bouron
needs-work Details | Review
deinterlace: support any video formats and any caps features if deinterlace mode allows it (2.10 KB, patch)
2013-12-16 13:58 UTC, Matthieu Bouron
needs-work Details | Review
deinterlace: support any video formats and any caps features if deinterlace mode allows it (2.34 KB, patch)
2013-12-16 17:11 UTC, Matthieu Bouron
committed Details | Review
deinterlace: do no try to set deinterlace method if passthrough is enabled (1.22 KB, patch)
2014-01-16 11:34 UTC, Matthieu Bouron
committed Details | Review

Description Lionel Landwerlin 2013-12-01 13:14:28 UTC
I've been trying to get playbin to work with the vaapi plugins out of the box and with the help of several people on the #gstreamer channel we finally figured out one of the problem was in the deinterlace plugin.

It seems deinterlace alterates caps even though it's in passthrough mode, which strips out the meta:GstVideoGLTextureUploadMeta capabilities of our video sink. What follows is that the vaapidecode doesn't get to know about this caps and it just happens to not link or not do software decode.

Attached is a patch to prevent the filtering in passthrough mode.
Comment 1 Lionel Landwerlin 2013-12-01 13:16:00 UTC
Created attachment 263232 [details] [review]
deinterlace: don't alterate peer's caps in passthrough mode
Comment 2 Olivier Crête 2013-12-05 00:14:18 UTC
Comment on attachment 263232 [details] [review]
deinterlace: don't alterate peer's caps in passthrough mode

You can't check self->passthrough in getcaps, as this is supposed to give you everything that you can do, not what is currently configured.

In this case, I think deinterlace should potentially just prepend the peer caps.
Comment 3 Olivier Crête 2013-12-05 00:16:37 UTC
That said, we can't just append them. playbin probably needs to add some kind of passthrough mode. Something like a autoconvert containing identity and deinterlace.
Comment 4 Sebastian Dröge (slomo) 2013-12-05 08:33:57 UTC
Also that patch is incomplete, deinterlace can also handle all caps that are progressive in automatic mode, and can handle all caps always in disabled mode. In interlaced mode it can only handle the caps that it can actually handle. I think basing the getcaps behaviour on the mode would be a good idea.

However that will make negotiation fail in auto mode for all caps that deinterlace does not understand and which are interlaced, e.g. "video/x-raw(meta:GstVideoGLTextureUploadMeta),interlaced=true". Alternatively we could also add a third mode that always allows everything, and only does deinterlacing if it can do that and the input is interlaced. Some kind of best-effort-auto mode.
Comment 5 Sebastian Dröge (slomo) 2013-12-05 08:34:23 UTC
(In reply to comment #3)
> That said, we can't just append them. playbin probably needs to add some kind
> of passthrough mode. Something like a autoconvert containing identity and
> deinterlace.

Then you're moving the problem from deinterlace to playbin without making it easier ;)
Comment 6 Matthieu Bouron 2013-12-06 17:23:43 UTC
Created attachment 263687 [details] [review]
deinterlace: support ANY caps features if deinterlace mode allows it

Here is an attempt to solve the issue, taking into account Sebastian's remarks.
Comment 7 Matthieu Bouron 2013-12-06 17:27:34 UTC
Created attachment 263688 [details] [review]
deinterlace: support ANY caps features if deinterlace mode allows it
Comment 8 Matthieu Bouron 2013-12-13 13:04:50 UTC
See also this related patch which enable the deinterlaced element to disable itself when it does not support the input caps features:

https://bugzilla.gnome.org/show_bug.cgi?id=720388

And this patch for letting playbin plugs elements with caps features:

https://bugzilla.gnome.org/show_bug.cgi?id=720205
Comment 9 Sebastian Dröge (slomo) 2013-12-14 17:13:34 UTC
Review of attachment 263688 [details] [review]:

::: gst/deinterlace/gstdeinterlace.c
@@ +279,3 @@
 
+#define DEINTERLACE_ALL_CAPS DEINTERLACE_CAPS ";" \
+    GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", DEINTERLACE_VIDEO_FORMATS)

This is not correct IMHO, it should support any format in passthrough mode. Not just DEINTERLACE_VIDEO_FORMATS.
Comment 10 Matthieu Bouron 2013-12-16 13:58:09 UTC
Created attachment 264286 [details] [review]
deinterlace: support any video formats and any caps features if deinterlace mode allows it
Comment 11 Sebastian Dröge (slomo) 2013-12-16 14:52:04 UTC
Looks good, will merge it when #720388 is ready and we have a unit test
Comment 12 Sebastian Dröge (slomo) 2013-12-16 14:53:25 UTC
Comment on attachment 264286 [details] [review]
deinterlace: support any video formats and any caps features if deinterlace mode allows it

Actually not completely. In the !peercaps case you should also do the same instead of just using the template caps.
Comment 13 Matthieu Bouron 2013-12-16 17:11:56 UTC
Created attachment 264306 [details] [review]
deinterlace: support any video formats and any caps features if deinterlace mode allows it
Comment 14 Sebastian Dröge (slomo) 2014-01-03 10:22:53 UTC
commit 0bbdb9bb1d9408dbbe753b47c3b919ddc285511c
Author: Matthieu Bouron <matthieu.bouron@collabora.com>
Date:   Fri Dec 6 17:08:54 2013 +0000

    deinterlace: support any video formats and any caps features if deinterlace mode allows it
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719636
Comment 15 Thibault Saunier 2014-01-15 20:40:36 UTC
Since that patch playing: http://files.sounddevices.com/prores422_proxy_29.97.mov fails with:

ERROR:gstdeinterlace.c:426:gst_deinterlace_set_method: assertion failed: (method_type != G_TYPE_INVALID)

Reverting it makes it working.
Comment 16 Matthieu Bouron 2014-01-16 11:34:25 UTC
Created attachment 266444 [details] [review]
deinterlace: do no try to set deinterlace method if passthrough is enabled
Comment 17 Michael Sheldon 2014-01-31 22:46:48 UTC
 It would appear that deinterlace doesn't really support all the formats which the recent patches make it claim to support. And while the most recent patch fixes issues where content is in unsupported formats but already progressive it doesn't handle cases where the content is in an unsupported format and still interlaced.

 For example interlaced I422_10LE content will fail, this can be triggered with the following pipeline:

gst-launch-1.0 videotestsrc ! video/x-raw,format=I422_10LE,interlace-mode=mixed ! deinterlace ! fakesink

 If deinterlace was reporting the correct sink caps this could be avoided via a videoconvert element, but due to the incorrect caps videoconvert doesn't do anything (since its already in a format that all elements claim to accept).
Comment 18 Sebastian Dröge (slomo) 2014-02-04 20:43:36 UTC
Yeah, there's something not really right here. This needs further changes, especially something more along the lines of the videobalance/textoverlay changes that Matthieu currently works on.
Comment 19 Sebastian Dröge (slomo) 2014-02-04 20:46:00 UTC
Comment on attachment 266444 [details] [review]
deinterlace: do no try to set deinterlace method if passthrough is enabled

commit 200eb7498d01937685a0e2d48df4d7b7b62e83d6
Author: Matthieu Bouron <matthieu.bouron@collabora.com>
Date:   Thu Jan 16 11:26:41 2014 +0000

    deinterlace: do not try set deinterlace method if passthrough is enabled
    
    Fixes an issue with progressive content and unsupported video formats
    for the deinterlace method.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719636
Comment 20 Tim-Philipp Müller 2018-01-28 21:25:09 UTC
Not sure I understand what needs to be done here.

The pipeline from comment #17 seems to work just fine here these days?
Comment 21 Lionel Landwerlin 2018-01-29 08:16:50 UTC
I don't really remember :)
Comment 22 Tim-Philipp Müller 2018-01-29 10:21:29 UTC
Yeah, it's been a while. Let's close this then. If anyone remembers, please re-open, otherwise I'm sure people will file new bugs if there are still issues.