|
Digital Video Compositing in Blender
Working with objects in Blender is very fast and intuative
once you get to know the techniques. Being able to manipulate a 'plane'
to which you have applied full motion video is a bit like positioning
a screen behind your foreground detail in real life. If you also cut and
shape your background plane to suit the foreground graphics, you have
great potential for video compositing and special effects. There are other,
more acurate methods of combining live video with animated 3D objects
but if you don't need pixel level accuracy, this method is quick, simple
and effective. Right, let's get on with it then.
Blender can use uncompressed AVI video files as animated
textures so the first thing to do is to make sure your background video
is in the right format. I use Adobe Premiere to grab video from my Canon
DV camcorder and then export the clip as an uncompressed AVI file. Any
decent DV NLE package should allow you to export as Uncompressed AVI.
In Premiere, import the clip and drag it to the timeline.
Then highlight the clip and choose 'Export Clip', 'Movie' from
the file menu.
From the Export Movie dialogue choose 'Settings'
From the Export Movie Settings dialogue you must choose
Microsoft AVI as the file type (not Microsoft DV AVI).
Fig 1. Choosing
the file type

Now change from 'General' to 'Video' from the Settings
list and from the Compressor list choose 'None'. This is important as
Blender will complain about unsupported file formats if you don't do this!
Fig 2. Choosing
'Compressor', 'None' from the list

Having adjusted your export settings, make a final check
that the Compression is 'None' @ 100% and go ahead and save to a file.
Fig 3. Saving the Uncompressed file
Right, now the fun begins. Fire up Blender and add a
simple plane. This represents a 'projection screen' in front of which
you can place your 3D objects. Just like setting up a 'real' rear-projection
stage!
Fig 4. The plane used as a 'projection screen'

With the plane selected. add a new material (hit F5)
and to this material add a new texture (hit F6). Now in the Texture Settings
you need to make a few choices. 1. Select 'Movie' as the texture type.
2. Use the 'Load Image' button to browse to your saved uncompressed AVI
file. 3. Set the total number of frames in the video clip (this will already
be shown at 4.) 5. Set the length of the clip, again in frames. My example
clip has only 42 frames but yours may have many more (at 25 frames per
second of screen time.)
Fig 5. The texture button settings for your
video clip texture
Back in the Material settings (F5) you need to give
the material an Emit value of 1. This is to make the image 'project' from
the 'screen' by emitting light from itself.
Fig 6. The material has an 'Emit' value of
1
Additional Material settings are as shown in Fig 7 below.
These are all the defaults so no need to change anything (except one important
option, the 'Shadeless' button. This is not selected yet but we will come
back to this in a moment when we put some 3D objects in our scene.)
Fig 7. Other material
settings
Right, now position your camera to point at the plane
in your scene and hit F12 for a render. Here I have intentionally pulled
the camera back and set it at an angle from the plane so you can see that
the video clip really is attached to the plane as a texture. I could move
or reshape the plane anyway I wanted now and the video would remain intact
on the 'screen'.
Fig 8. The plane is rendered with the video,
just like a rear projection screen
Now, to use this setup as a simple background screen,
just like rear projection, you should position your camera so that it
is pointing straight at the background plane. You will also want to adjust
the distance between the camera and the plane so that it extends just
beyond the outer safe area in the viewfinder, as shown in Fig 9. (check
this by looking at the camera view, hit key 0 on the Num Pad.)
Fig 9. The background plane fills the viewfinder
So now you have your background video plane in position.
Since you will no doubt want to combine some foreground graphics with
this background footage, you can now position and animate your 3D Blender
objects in front of the 'screen'. These 3D objects will need lighting
so go ahead and position some lights too. Now, to avoid the foreground
lighting 'washing out' the background video on the screen, select the
plane and in its' material settings make sure you click the 'Shadeless'
button. This will prevent the foreground lights having any effect on the
background footage.
Fig 10. Click the 'Shadeless' button to prevent
the foreground lighting washing out the video footage

So now, all you have to do is set your render preferences
and render the whole stage to an AVI file. As your foreground objects
animate, so the background video (as an animated texture) automatically
advances each frame. Your foreground objects can move towards and away
from (and even embed themselves in) your background 'screen'. There is
no need for any Alpha Channel or Blue Screen type keying effects. The
background footage is just another object with material and texture attribute
and so is rendered along with all you other objects perfectly. and in
sync with your animation.
Fig 11. Foreground objects and background footage
rendered together perfectly.
That's it. The beauty of this technique is that you
don't need to take your animations and background footage into a package
like Adobe After Effects in order to combine them.
If you want your background video to exactly match
your camera viewpoint without having to position your background plane
then use the following technique.
The World environment can use an animated texture too,
but it has to ba a texture which is already attached to an object. Add
the video clip as a texture to any object (a simple plane for instance),
give the object a name and position the object somewhere 'off camera'.
Then go to the 'World' buttons screen and add a New
World.
Choose 'Paper' as the World Background type. In the
Texture section, click the 'View' button and in the box above the view
button, type the name of the object you just gave your animated texture
to.
Click the 'Hori' button.
From the texture browse button, choose the animated
texture you attached to your 'off-screen' object.
If all is well, you should see the first frame of your
video clip texture in the preview window to the left of the World buttons
(see Fig 12.)
Fig 12. Choose 'Paper' as the World type
Fig 13. Choose the object with the texture
(Plane) and choose the texture itself (BGVideo)
Now when you render your animation the background video
appears magically behind your scene perfectly matched in terms of size
and aspect ratio.
Also remeber that you can place a single frame of your
video (create one in Premiere before you start) as a window background
to help you model your objects in relation to your background video footage
(rotoscoping as it is called in the film industry, from the technique
of projecting a single frame of your background plate onto animation paper
so you can draw precisely over it to match movements etc.)
So that's it for this tutorial. Hope that seems clear.
Once you've rendered your animation you can then import it back into Premiere
(or the editing package of your choice) for inclusion in your latest epic!
Good luck.
If you have any comments about this technique then please
make them in the Discussion Forum. At some point I might setup 'comments
posting' facility for each and every tutorial I create but for now, please
use the Forum.
Happy Blending,
Rob Coldwell.
Take the time to visit
the Blender discussion forum where you
can hopefully exchange tips and get advice from fellow Blender users.
Meanwhile, download
Blender for Windows or Blender
for Linux and get Blending!
NB, the above binaries downloads
will remain available until such time as Blender.org
release binaries themselves. At that time I will remove the above files.
Source code however, is available for download now at Blender.org
This document last modified
Wednesday, 16-Oct-2002 22:36:18 BST
|