Remove video background with Shotcut?

Hello, Shotcut does not seem to support a method to remove or replace background similar to that new AI method I found in some other video editing programs.
But the results of these method are not that fine I looked for, as they let remain bad artifacts at some regions, for instance around faces of a person (especially ears and throat and glasses).

The object of the operation I need: I have a video of mine before a background, which is a poster on the wall behind me AND a picture by frame export of the same video without me, when I left the camera scope for a moment. I wanted to “subtract” all parts - and only those parts - of the video which differ from the picture; that would be me in the foreground! If I could replace this background by transparence or one color I should have a kind of green screen; a may be simple remove-background method.

In my lack of knowledge I tried first to set both video and picture onto two tracks of Shotcut timeline and added some filters, such as opacity, alpha channel filters, brightness and chroma key, contrast and so on, to both tracks and changed the order of them in the time axis to see what happened: With NO satisfying result!

[ I refused / did not try another idea with mask filters, cause I found no way to define a variable mask which additionally should follow the variable shape of, e.g., a foreground person automatically, even if there would be a way to track the person’s mask over all frames of the video. (There are only fix shaped masks in Shotcut, right?) ]

Is there a method I did not yet find out to “subtract” the parts of the background pic from the video with the person in the foreground, so that only the foreground person can still be seen? (That may apply only the pixels which do not differ except in a certain small difference of color)

[ I read that the image tool Blender might have such a feature, but I wold have to export all frames to process the method and afterwards import all the result frames into a new video, and it is not sure if this can be done in a batch task, by Blender; and I do not know video tools which can do so ]

Have you heard anywhere about such a editing / processing possibility in Shotcut or another tool?

You can use the Mask: Draw (Glaxnimate) filter to create complex masks.
You’ll need to learn how to use Glaxnimate though.

You can also draw a black and white mask yourself (in Gimp or Photoshop for example) and use it in the Mask: From File filter.

DDdUDJH28Y

1 Like

Hello, thanks for the mask hints. The solutions mentioned get along without the referencing background foto, right?
My problem is that such a mask must be mapping tolerably accurate a certain foreground object (that may also be a person and its moves, i.e it must “track” the object or person). Can Glaxnimate do this for me? Or can all this be accomplished by that second suggestion (self-made black or white mask from file); and must I do this for each video frame separately?
This was the reason I wrote my idea with the “frozen” background picture for a video with moving parts in front of the same non-moving background.

If you need the mask to follow an object, then the Mask: Draw (Glaxnimate) filter will be the best tool for the job. You can draw an accurate mask and animate it to follow the object’s movements and changes of shape. It won’t do it automatically though. There is a bit of work involved.

To help you learn how it’s done, watch this tutorial created by @bentacular:

3 Likes

Thanks a lot! I’ll try out …

… but this will be very painful work. (On the other hand, the AI tools - mostly online based - do not work good enough for my purpose. They do not identify and separate a person in the foreground if there are also persons in the background; all persons remain after removing the “background” :frowning: )

So I think I furthermore have to keep my idea in mind and look for a video tool (!not image tool) which can compare a video with a background-identical video or image and then mask the differrent parts of both.

Perhaps someone can give me an appropriate solution, or knows a chain of filters in Shotcut (may be multiple identical filters in alternation with others) that does what I tried to explain here.

There is no automatic way of creating a moving mask for you in Shotcut. You will need to key each frame manually, whether it’s one filter or a combination of filters.

3 Likes

Ok then, and please accept my best thanks for all your helping responses!

1 Like