video masking...

hi, i am making a film and i need to composite my 3D models behind moving objects
(people, cars, etc…etc) and need to know if there is a free program like gimp (where you can add an alpha channel and erase alpha where you want) but do that for video, and add it as a animated texture (avi)


u could buy my book…
the quick answer is you model a mask in Blender, then use that either in 3D View, or in the Compositor, or the Sequencer, to cut out that portion of the video you dont want, or to put that portion of video in front of whatever CG object you wish.
also see my masking video tutorial on Vimeo
links are in my sig

yes, i do know how to do it in the uv image editor and the composite nodes, but the one problem is that it doesn’t save. and when you are working with film that would have 100-1000+ frames, and it is a real pain to have to mask out EVERY frame when it doesn’t save and a any moment you could lose all your work.
thats why i use gimp, but for still image masking. i need a tool for video masking.

thanks -RyLeY

you might want to check out this tutorial. also if you set blender to render RGBA tiff or tga you can save alpha channels. you can add a file output node in the compositor.
O.k. this probably reads better with the link, don’t know what happened there. must have had a late night.

You need professional software like “Motor” to do what you want.
Can´t find the product page for some reason. Just saw the tool once in a studio. :frowning: But i am pretty sure its name was Motor
You mask your objects once, let the software track the shot and export the alpha mask sequence.

As such software involves robust pattern matching, edge detection and complex vector calculations they are quite costly.

If anyone knows an freeware alternative, I am all ears.

Lately I wrote a pattern matching tool via NCC with meanshift and currently have to work on code involving FFT and edge detection. For this stupid practical I got to reinvent the wheel, but there are some really good image processing libraries out there. Maybe it is time to start to plan some nice new open source software.

I´d really like to see:
motion capture via 2 camera feeds on a blender armature
fast camera calibration for Blender
tracked video masking

If it just wouldn´t involve that much numeric and discreet math that has to be right =)

i definately agree. we really do need some decent open source software for masking, tracking and mask tracking.
maybe there could be an implement on 2.6?

If someone codes it =)
Then again, I don´t see the need to integrate everything into blender. We also got no minesweeper in blender although it would shorten the time during render, and also no mp3 player, although its nice to listen to music blending =)
I use many tools in my production pipeline. As long as they work together nicely I don´t care if they are a moetly crew of tools.

errrr…what do you mean by ‘minesweeper’? i get what you mean by mp3 player, but don’t get what tou mean by minesweeper…

Don´t bother, jk :D:D:D

Well, I know both.

Ramen is none of the things stated, it is a compositor and can´t track masks.

And voodoo is neat, but its not really a pearl of usability, not licensed for commercial use and not open source. I hope the new VooCat will be any good, because the current one is just bad. The only good camera motion tracker with a reasonable license fee (compared to Boujou for instance) is SynthEyes IMO. And voodoo also is not usable for camera matching for stills.

you dont mask in the image editor; you make a 3D mask; it tracks so much better and easier - you just move and shape it to match.

There are mo-track programs like voodoo… that will give you markers to go by.

are you saying I use shape keys?..i don’t like shapekeys at all. to me they are not very user-friendly. easy to use, hard to get descent.

No, don’t use shape keys for masking. I use NURBS with Hooks on every control point.
Than animate the Hooks.
Screenshot NURBS with Hooks.

I would be very happy to animate the control points without hooks, but that’s not possible in Blender.

left this link out of my first post.

Agreed; what technique to use depends on what shape/complex profile of object you are masking out, how easy it is to distinguish from other elements in the scene (if you can auto-generate a mask using a matte node) and the quality/fineness needed, whether it is moving, and, if moving relative to camera, to what degree it changes its profile, and so on. So far we have these possible masking techniques:

  1. Physical masks made in 3D using curves, mesh, nurbs
  2. Painted masks made in UV/Image Editor paint, 3D paint, or GIMP/PS
  3. Auto masks made using matte nodes or color analysis nodes
  4. Separation masks made by comparing the frame to a reference shot

Physical masks may be animated to move or deform shape. That change can be set either a) manually by moving the location of the mask or elements of the mask (the overall mask may be a combination of primitive objects), b) changing the shape of the mask via shape keys (aka rotoscoping) or c) driving the shape of the mask according to markers (hooks) placed and location-animated to track motion. Location of markers may be automatically determined using a mo-tracker program like voodoo or icarus etc or manually moved by the artist (set autokey on!)

Masks can be 2D or 3D. For example, to mask out a car from a video shot, it might be easier to use a 3D car, and then just rotate it to match the camera/car move. Since the car itself does not change shape during the video, the shape of the 3D mask does not have to change either - just match camera distortion to virtual camera, and mimic the car movement relative to camera.

If there’s another approach…chime in!

A free alternative for video masking is Claxa, available at Works pretty well once you get the hang of it.

hey thanks for that info.
Claxa looks decent.

“Claxa” offers several options for masks built in it to be subsequently processed in AE. Here are the export types:
· Source footage with everything erased (or replaced with data from another footage) except for the object.
· Sequence of masks for each frame from the source footage.
· Approximate description of the mask in the form of dynamic B-spline, which can be exported in AE layer as ordinary mask with the possibility to edit it by hands and apply additional effects to it in AE.

Too bad its “only” free and not OSS, i´d love to look into the code =)

I gave up trying to do any roto / masks with 2.5 new animation system like in sx-1’s link. Script not transferred to 2.5, Can’t key frame points in a curve shape and shape keys just were unusable, but maybe 2.5 has improved recently.

Yup still sucks.

the technique doesn’t use shape keys for animation it uses hooks. Apply hooks to each of the splines vertices and animate the hooks. Object mode-editing (F9) to change the display and size of hooks. Add empties as trackers and parent hooks to empties for semi-automation. hooks can be linked in groups and animated individually. good for inorganic shapes , buildings etc., for complex shapes use the above technique for garbage matte, and clean up with chroma or colour keys. works in 2.5. only problem I had in 2.5 was a memory issue while chroma keying needed to save file and restart blender to clear the cache, at least that’s what I thought I did. went fine after that.