How to put a black border around a video?

Normally I put frames/borders around videos if necessary using transparent PNGs, but I was wondering if there’s a quick way to add a simple black line built into Shotcut itself? It’s just nice to have some contrast/segregation between the video and background.

You mean something like this?

image

Yeah, that would do nicely - it gives it a sort of embossed badge look, which is very effective IMO. Blue on blue would be a bit hazy otherwise.

It’s reasonably straight forward using timeline tracks as layers to composite this effect.
Only problem is recent versions using the Size & Position Filter turns my machine into an anchor. It never used to do this, I have many older PiP videos created using much earlier versions of Shotcut, but now it’s impossible for me so I have to use DVR.

Ah, it sounds like a workaround best left alone then, especially since I’ve been having a lot of stability issues too lately.

Sauron, is this how you achieved the effect above?

It’s not a simple “such-and-such pixel line around an image,” but if you don’t mind doing a little math / fiddling with numbers until it works, the Mask filter can get you a black outline (fuzzy or sharp). I don’t see how to get around using the Size and Position filter, though. I haven’t noticed having more problems with the S&P than any other filter, but Steve_Ledger has way more experience than I do.

Here’s what the Mask filter would look like:
shotcut_mask_ex01

[Edit: In case it isn’t clear, this is two tracks: V1 has the colorful background, V2 has an image that has been scaled down with the Size & Position filter, and has a mask that is slightly larger than the image, which creates the black “border.” I probably should have used the Rotate’s scale function instead of S&P.]

1 Like

I only have to select the S&P filter in the Filter list and Shotcut becomes almost unresponsive for about 10 seconds. Adjusting the ‘size’ is next to impossible without everything feeling like I’m stuck in a quagmire…
As I say, never used to happen. Maybe a Windows Update has thrown a spanner into Shotcut’s works.

I wonder how easy a ‘Border’ Filter would be to add to Shotcut?

OK, Playing around some more for this border question, Shotcut just wasn’t playing the game and just stopped responding with every move I made until it crashed.

Capture

So I uninstalled, re installed choosing the remove registry settings option and now it’s behaving better :+1:

I had to do the same registry deletion about an hour ago :slight_smile:

I’ve never had the 10-second wait upon clicking on the S&P filter, but it does seem clear that messing around with filters will cause problems. It’s not simply the S&P filter itself, because I’ve used that extensively. It might be a certain S&P setting, or deleting filters in the wrong order, or trying to put a filter on a clip that doesn’t exist, or something else like that.

I think I’m going to go make a record of what the registry values are like now, to see if there’s a noticeable difference the next time Shotcut starts crashing constantly.

Thanks for the tip, John. I’ll give that a go. Tinkering with the coordinates for precision placement shouldn’t be too taxing. I love the example pics btw - that’s my kinda wacky. :smiley:

I’d definitely second the idea of implementing something like this as a filter at some point in the future.

No I did not use the Size and Position filter. I used the Mask filter. Background on track V1.

Color with Mask on V2.
image

Video with Mask on V3.
image

@sauron in your example we’re not seeing the entirety of the video though, right? You’d have to shoot your source video with the expectation that you’ll be adding a border around the subject in the center. If we just want to put a border around the outer edge of a video, we have to scale the video smaller than the resolution of the project by using a filter, I think?

Note that my example was only 2 tracks, V1 is the background and V2 has a scaled image with a mask that is slightly larger than the image (that probably wasn’t very clear from the screenshot).

The better filter to use for straight-up scaling is probably the Rotate filter, though; I keep forgetting that it has a Scale slider. The math involved is much more straightforward.

That is correct. The video is cropped.

Yes.

The Rotate filter works pretty well for adding a border or a shadow. I still used 3 tracks, one for background, one for border and one for the video.

image

The S&P filter works as well but needs a little tweaking to get it right. There quite a few ways to add a border.