GES, picture in picture, take only sub-rectangle of foreground video

Antonio Ospite ao2 at ao2.it
Fri Mar 30 10:57:17 UTC 2018


On Thu, 29 Mar 2018 20:57:37 -0700
David Ing <ding at panopto.com> wrote:

> I am using GES to create a "picture in picture" type of video.  I have a
> large video in the background and a small video in the foreground corner.
> This is working perfectly.
> 
> Now, for the video in the foreground, I don't want the entire surface area
> of the video to be displayed.  I only want it to display a sub-rectangle of
> that foreground video.
> 
> By the way, I have already determined that the xpos, ypos, width, height
> proprties of GESVideoSource will scale the video (and they represent the
> position of the video on the destination canvas).  So they don't behave in
> a way that would allow me to take the sub-rectangle.
> 
> My question is:  Is there an easy way to take the sub-rectangle of the
> foreground video using GES?  How?

You can use a "videocrop" effect and combine it with the scaling
transformation.

In pitivi it is quite easy to do:
 1. add the "videocrop" effect to the *unscaled* video;
 2. set the cropping properties, and adjust the transformation width and
    height accordingly to keep the original content aspect ratio;
 3. once you are satisfied you can optionally scale the clip further.

Changing the crop properties after 3. is not very intuitive IMHO, as
the properties would be affected by the scaling ratio, that's why I
recommended to crop the unscaled video in 1.

I've never done it from code.

I'd paste a ges-launch-1.0 example too but the parsing of the +effect
argument seems to be broken, or at least I couldn't figure out how to
pass properties.

I filed a bug about that:
https://bugzilla.gnome.org/show_bug.cgi?id=794837

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the gstreamer-devel mailing list