How to make a bound...
 
Notifications
Clear all

[Solved] How to make a bounding box around a picture-in-picture?

11 Posts
4 Users
2 Likes
2,234 Views
0
Topic starter

Hi,

 

I am learning Cinelerra and I am working on a project which shows a couple of scaled and cropped photos over a video. Placing the photos over the video works great via the "Crop & Position" plugin. What I require on top of that is, that each of those overlayed photos gets a border, so that it stands out on top of the underlying video. I can not paint the border directly into the photos, because I am cropping them on demand in Cinelerra. For now I ended up using an F_drawbox plugin, which however is super cumbersome.

Crop & Position works with values expressed in percent, F_drawbox works with pixels; so basically I ended up setting up the crop & position first and then continued with F_drawbox, where I had to find where my overlayed image is. As you can imagine, if it turns out that I need to tune the position of my image (or if I wanted to move it via keyframes) - it becomes a nightmare, because I have to manually readjust the F_drawbox coordinates.

I assume that there is a much better and easier way and that I have just not found it yet 🙂

Could anyone please hint me on how to add those borders properly in Cinelerra? Basically I'm looking for something that would work off the cropped image and just follow the crop/position, adding a border of a specified width.

 

Kind regards,

Jin

9 Answers
1

Hi Jin,
if you are not using Proxy this is how I do that (PiP).

In the Timeline create 3 video tracks, from top to bottom:
- V3_Frame4Picture
- V2_Picture
- V1_Video

In the V2_Picture track insert:
- your picture, of course
- the Scale effect, if you want to scale the picture (sometime is needed to use the Camera tool)
- the Crop&Position effect, only to crop the picture (Crop ONLY)
- another Crop&Position effect, only to move the picture (Position ONLY). For now, Reset all the
values with the Reset button.

In the V3_Frame4Picture track insert:
- the Sketcher effect, and draw the frame around the picture
- the Shared effect from V2_Picture track -> the 2nd Crop&Position effect

Using only the 2nd Crop&Position effect (Position ONLY) of the V2_Picture track you can move your picture and frame together,... and animate them.
Let's me know if it is clear or not, please.

IgorBeg 10/01/2023 8:41 am

May be that in the V2_Picture video track you have to swap the Scale effect with Crop&Position (Crop ONLY).
So in the timeline you should see:

- V3_Frame4Picture
    -> Sketcher
    -> Shared V2_Picture:Crop&Position (Position ONLY)
- V2_Picture
    -> your Picture
    -> Crop&Position (Crop ONLY)
    -> Scale
    -> Crop&Position (Position ONLY)
- V1_Video
    -> your Video
1

An image of what CinGG looks like with all plugins active (Thanks to IgorBeg):

https://postimg.cc/18zPfHP9

0

@Jin

The Sketcher plugin worked for me.  On the bottom of the Sketcher menu, there is a Help button and if you check this, it displays the keys to use.  Don't be scared by the documentation at:  https://cinelerra-gg.org/download/CinelerraGG_Manual/Sketcher.html   because you just (1) check on Help (2) use Shift LMB to make a point and then 4 more to make a box.  You can change the color of the box by clicking on the White spot.  Be sure to uncheck "Drag" before rendering so you do not have the points in your output.  You can change the width of the line at the top of the menu, the second button over named width.

But maybe Igor or Andrea have a better way.

@IgorBeg

@andreapaz

This post was modified 2 years ago by phylsmith2004
0
Topic starter

Hi @phylsmith2004,

thank you for your answer, I tried the Sketcher and it is indeed better suited than F_drawbox, because in the Sketcher you can at least interactively drag the points and see where you are in the video image.

However, its still not quite what I was looking for, if I had to move the in-picture by keyframing its position, I would also have to manually move the borders drawn in the Sketcher along with it. Is there really no way to combine Crop & Position with something else, so that it would produce a border which would simply be at a static offset from the cropped edges? I am not saying that I have to use the Crop & Position plugin, but perhaps another technique which would basically allow to crop and position an image over a video, but allow to define a border around the cropped area.

0

@Jin

@IgorBeg

@andreapaz

There probably is another way.  Because of differences of time around the world, Andrea and IgorB may take some time to reply with an alternative.

0
Topic starter

Hi @IgorBeg,

 

thank you for the guide, I tried to reproduce the steps, but where do I find the Frame4Picture effect? I tried googling for it, assuming that there might be some plugin repository or something, but I could not find anything. I do not have it in my list, also using Search in Video Effects does not show it.

 

I am using `cinelerra-gg-5.1.2022.11-2.fc37.x86_64`, "About" says "built: Dec 16 2022 00:00:00"

What am I missing?

 

Kind regards,

Jin

0
Topic starter

Hi @IgorBeg,

 

first of all, sorry - I was being silly, I misread your original post, Frame4Picture was of course the name of the track, not the name of the effect! This explains why I was not able to find it, which is what I was writing about in my previous post 🙂

So I redid everything again and I now got it to work according to your instructions, with one difficulty though:

I was not able to attach any effects to V3 when the track was empty, I had to first add a V2 as a shared track to V3, only then I could add Sketcher and a shared V2 Crop & Position, then I deleted the V2 shared track in V3 and the other effects remained so I now have the setup as you described.

I wonder why I was not able to attach those effects to V3 without having V2 as a shared track first? I guess I did something wrong.

Anyway, I have yet to understand why it works as I think I would not be able to come up with something like this myself, at least not at this early stage in the learning phase 🙂

Thank you very much for this small tutorial

 

Kind regards,

Jin

0

@Jin

"I was not able to attach any effects to V3 when the track was empty"

This is not obvious if just beginning.  If you are in "Cut and Paste" editing mode, which is the default, to attach an effect to an empty track you hold down the left mouse button and wipe the area over the empty track where you want to add the effect (drag and hold).  That area will turn white and then you just drag the plugin and drop it on the track.

Jin Topic starter 11/01/2023 3:03 pm

@phylsmith2004 Another feature learned, thank you for the pointer 👍

0

I am glad it helped you, @Jin .

Thank You, @phylsmith2004 and @andreapaz !

Share: