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 764011 - faceoverlay: port to Gstreamer 1.x
faceoverlay: port to Gstreamer 1.x
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal enhancement
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 769176
 
 
Reported: 2016-03-22 03:24 UTC by César Fabián Orccón Chipana
Modified: 2017-04-11 08:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port (3.99 KB, patch)
2016-03-22 03:24 UTC, César Fabián Orccón Chipana
none Details | Review
faceoverlay: Revert deletion and port to Gstreamer 1.x (21.18 KB, patch)
2016-12-31 21:15 UTC, César Fabián Orccón Chipana
none Details | Review
faceoverlay: Revert deletion (22.01 KB, patch)
2017-04-07 22:01 UTC, César Fabián Orccón Chipana
committed Details | Review
faceoverlay: Port to GStreamer 1.x (4.47 KB, patch)
2017-04-07 22:02 UTC, César Fabián Orccón Chipana
committed Details | Review

Description César Fabián Orccón Chipana 2016-03-22 03:24:17 UTC
Created attachment 324517 [details] [review]
Port

Port faceoverlay to Gstreamer 1.x.
Comment 1 Mathieu Duponchelle 2016-03-22 04:45:12 UTC
Review of attachment 324517 [details] [review]:

Getting there, but not quite OK yet, please read on GstCaps and negotiation, it's a fairly essential part of what gstreamer does, arguably the most important one, can't hurt to learn about it :)

::: gst/faceoverlay/gstfaceoverlay.c
@@ +82,3 @@
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{RGB}")));

You should not just blindly copy paste stuff from other plugins, and instead take this as an occasion to learn what GstCaps are, and how to define them, for example here in new caps lingo we were previously looking at video/x-raw, format=[RGB, YUV], this reduces the plugin to only accepting video/x-raw, format=[RGB], which is incorrect. You can experiment by defining caps with capsfilters on the command line, something like this should work:

 gst-launch-1.0 autovideosrc ! videoconvert ! video/x-raw, format=yuv ! faceoverlay location=/path/to/gnome-video-effects/pixmaps/bow.svg x=0.5 y=0.5 w=0.7 h=0.7 ! videoconvert ! autovideosink

and it will be refused with your patch, even though the code in this plugin can handle both rgb and yuv. This is important to specify these right, because it's what is used by gstreamer to let videoconvert convert to an acceptable format for the plugin, while not doing unnecessary conversion, as this is a costly operation.

@@ +87,3 @@
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{BGRA}")));

Same comment applies here
Comment 2 Tim-Philipp Müller 2016-12-23 16:02:11 UTC
The faceoverlay plugin was removed in git master, but it can be resurrected if anyone wants to work further on porting it to 1.x.

commit 9b5de053995488d5ddc78c1bf4df651101271d70
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Dec 21 11:00:47 2016 +0200

    Remove various unported plugins
    
    If they were not ported after 4+ years it seems unlikely that anybody is
    ever going to need them again. They're still in the GIT history if
    needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774530


In the mean time let's close this bug until that happens.
Comment 3 César Fabián Orccón Chipana 2016-12-27 16:10:18 UTC
(In reply to Mathieu Duponchelle from comment #1)
> Review of attachment 324517 [details] [review] [review]:
> 
> Getting there, but not quite OK yet, please read on GstCaps and negotiation,
> it's a fairly essential part of what gstreamer does, arguably the most
> important one, can't hurt to learn about it :)
> 
> ::: gst/faceoverlay/gstfaceoverlay.c
> @@ +82,3 @@
>      GST_PAD_SINK,
>      GST_PAD_ALWAYS,
> +    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{RGB}")));
> 
> You should not just blindly copy paste stuff from other plugins, and instead
> take this as an occasion to learn what GstCaps are, and how to define them,
> for example here in new caps lingo we were previously looking at
> video/x-raw, format=[RGB, YUV], this reduces the plugin to only accepting
> video/x-raw, format=[RGB], which is incorrect. You can experiment by
> defining caps with capsfilters on the command line, something like this
> should work:
> 
>  gst-launch-1.0 autovideosrc ! videoconvert ! video/x-raw, format=yuv !
> faceoverlay location=/path/to/gnome-video-effects/pixmaps/bow.svg x=0.5
> y=0.5 w=0.7 h=0.7 ! videoconvert ! autovideosink
> 
> and it will be refused with your patch, even though the code in this plugin
> can handle both rgb and yuv. This is important to specify these right,
> because it's what is used by gstreamer to let videoconvert convert to an
> acceptable format for the plugin, while not doing unnecessary conversion, as
> this is a costly operation.


Do you mean that by setting only {RGB} on caps I am restricting it to only accept RGB format as input? Imagine I am developing the element from scratch. How can I know what should the input formats should be?
Comment 4 César Fabián Orccón Chipana 2016-12-31 21:15:28 UTC
Created attachment 342673 [details] [review]
faceoverlay: Revert deletion and port to Gstreamer 1.x
Comment 5 Sebastian Dröge (slomo) 2017-04-05 08:17:19 UTC
To ease reviewing, can you provide this in two patches? One for reverting the deletion, another for the porting to 1.x?
Comment 6 César Fabián Orccón Chipana 2017-04-07 22:01:48 UTC
Created attachment 349508 [details] [review]
faceoverlay: Revert deletion
Comment 7 César Fabián Orccón Chipana 2017-04-07 22:02:25 UTC
Created attachment 349509 [details] [review]
faceoverlay: Port to GStreamer 1.x
Comment 8 Sebastian Dröge (slomo) 2017-04-09 08:25:54 UTC
Review of attachment 349509 [details] [review]:

The review comments from comment 1 still apply here. Basically the caps should be just "video/x-raw", as this is a bin that is just wrapping around other elements that already specify their caps correctly (and there's a videoconvert!).
Comment 9 Sebastian Dröge (slomo) 2017-04-11 08:24:09 UTC
Attachment 349508 [details] pushed as d4797e4 - faceoverlay: Revert deletion
Attachment 349509 [details] pushed as 456153c - faceoverlay: Port to GStreamer 1.x