OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.36k stars 545 forks source link

Zoom on picture-in-picture clip, without changing shown size #2729

Closed RasmusWL closed 5 years ago

RasmusWL commented 5 years ago

Question:

How can I apply a zoom effect to a clip, without changing the dimension shown? As an example, I try to display Lenna on top of the OpenShot logo, and I want to zoom in on Lenna without covering up more of the OpenShot logo. Example of what I'm looking for can be seen here

example

Attempts at solving the problem

I tried 3 approaches:

Is it is possible to achieve this effect with OpenShot? :blush:

I can see one work-around; by doing the animation in an other project with the wanted dimensions, exporting this to a video, and importing into the original project. However, since I'm trying to automate the whole process with the openshot-api, I would rather not have to go through this :neutral_face:

System Details:

Other Details:

I found an example for how to do this with After Effects.

SuslikV commented 5 years ago

Usually, the order of layers need to be changed and background clip with the "hole" in the middle is the best solution.

RasmusWL commented 5 years ago

Thanks for the input @SuslikV. I can see that this can work for my MWE, and it should be applicable to my actual problem as well.

However, I don't think it's more of a hack than an actual solution to the core of this problem. It will not work if you want to add a transition to the location/rotation of Lenna, or transition to location/rotation of the OpenShot logo. If you use a picture with alpha to zoom, then this won't work either.

I think a solution to the core of this problem, could be to allow changing scale/location/rotation of the mask (by default, it could mirror the clip. solving my problem would just be making scale constant = 1.0)

jonoomph commented 5 years ago

We could add an additional property to effects, to render them before we scale the clip image. That combined with the crop effect, would allow the image to scale, but the crop to remain fixed (in theory). Not sure how well this would work in reality, but it's a possibility. :smile:

RasmusWL commented 5 years ago

I think I understand your point. We could figure out the viewport that should be displayed by the crop effect before scaling the image. So by setting {left,right,top,bottom}_crop=0.0, we will only show the same part that was shown on the first frame of the crop effect.

I don't know the internals of OpenShot, so I don't know if this is a good solution :smile:

For now, the "solution" that SuslikV came up with works for my specific case.