Okay, you’ve shot your green-screen footage, but there’s still a lot of work to do in terms of de-interlacing and chroma keying for the best results.
In the last column, we looked at shooting footage against a plain green screen, which can then be replaced on your Mac with a completely different background. This sort of technique used to be reserved for Hollywood blockbuster-size budgets, but you can create similar effects yourself with a reasonably powerful Mac. The more you can do to ensure you’ve got good footage to work with before you start the keying process, the better your results. We’ve already covered how to shoot material to make it easier once you get the video onto your Mac.
If the footage you’ve recorded is interlaced then de-interlacing it first before you start keying will increase your chances of getting a good result. This will obviously have implications later on, depending on where the final edit will end up, but if you can de-interlace your footage first, then you’ll get a much cleaner cutout.
There are many ways you can achieve this, but the free Mpeg Streamclip utility from Squared 5 (www.squared5.com/svideo/mpeg-streamclip-mac.html) is particularly handy if you’re working with HDV footage.
Mpeg Streamclip will allow you to play back M2T files directly, which are HDV files created by a solid-state capture device such as the Sony HVR-MRC1 CompactFlash memory recording unit discussed in previous video columns. It can also transcode M2T files into QuickTime files, which means you can use them in Final Cut.
Just open the clip you want to use in Mpeg Streamclip and then select Export to QuickTime from the File menu. It’s best to use a codec that’s better quality than the one you started with to save the QuickTime file – if you have Final Cut Studio installed, then Apple’s ProRes codec is a good choice. Either ProRes (LT) or even ProRes (Proxy) will work if your source footage is HDV. Once you’ve chosen your codec from the Compression drop-down list, tick the box marked Deinterlace Video and hit Make Movie.
When the video has finished transcoding, you’ll now have a movie file you can drop straight into Final Cut. There are basic chroma key effects bundled with Final Cut that could work for well-shot footage, but you’ll need a custom plug-in for best results. One of the best available is Keylight from The Foundry (thefoundry.co.uk), which has been used in countless Hollywood productions. Keylight is available as a plug-in for Final Cut, so you can use it directly in the application. If you’ve got After Effects CS4, then it’s bundled with that as standard.
The process is similar whether you’re working in Final Cut or After Effects. Once you’ve imported your green-screen footage, apply the Keylight effect. You won’t see any difference initially, as you need to tell Keylight what colour you want to cut out. By using the eyedropper next to the Screen Colour control in the options, choose an area of the screen close to the subject. This on its own does a decent job of removing the background, but you’ll usually need to tweak a couple of settings to get a good result.
By default, you’ll see the final result of the effect, but it’s useful to also look at the matte view when you’re tweaking the settings, which lets you see which areas of the image will be transparent. Choose Screen Matte from the View option in the settings. You’ll now see a white area, which is the subject you want to keep, and a black area, which is the screen that will be removed. You’ll also probably see grey areas, which will be semi-transparent and which you need to adjust to either pure black or white to get a good key.
When chroma keying, you only need to worry about the pixels that directly surround your subject – the aim is to get a good edge around your moving subject. Areas at the edge of the frame where the green screen isn’t a consistent colour can easily be removed with a garbage matte. In After Effects, use the Pen tool to draw a mask roughly around your subject. Keylight will then only be applied to the area inside the mask and anything outside will simply be transparent. Once you’ve drawn your mask, quickly scrub through the timeline and check that any arm gestures or other movements don’t go outside the mask you just created. The other advantage of using a garbage matte is that it allows you to easily eliminate objects you don’t want in the final shot – such as lighting rigs or the edge of the screen.
Once you’ve isolated the area on which you want to work, the first settings to tweak are Screen Gain and Screen Balance – although you don’t want to adjust them too drastically, otherwise you may affect the subject. After you’ve changed a setting a little, it’s worth switching from Screen Matte view to Final Result to double-check that everything still looks okay.
The next values you need to adjust are in the Screen Matte section – the Clip Black and Clip White controls will help remove any grey areas of the Screen Matte. Again, if you adjust the values too drastically, this will be noticeable in the end result, but if you adjust them slowly until you can only see black and white areas, then you should have a good key. Again, it’s worth switching between matte view and the final result to check that your subject still looks good.
If you then want to then edit your footage and place it over a separate background, you’ll need to export it in a format that includes the transparency information – also called alpha. Apple’s Animation codec allows you to include an alpha channel, but it’s fairly space intensive. A 30-second clip using the ProRes (Proxy) codec will take up around 130MB of space. The same shot once you’ve cut out the green screen and saved it with transparency using Apple’s Animation codec will take up nearly 1GB – nearly seven times as much space.
If you’re not pushed for space then the Animation codec is definitely the way to go. However, if that’s not the case, there is another option. While only some codecs let you export the alpha channel along with the video, After Effects will let you export just the alpha channel in any codec. You can then combine the alpha channel and the original video in your editor.
To do this in After Effects, when you’re happy with your Keylight settings, choose Add to Render Queue from the Composition menu. Select Best Settings for the Render Settings and Alpha Only for the Output module. Click on the Alpha Only link to manually adjust the settings. Click the Format Options button from the Output Module Settings screen and then choose the codec that matches that of your original file – in this case, ProRes (Proxy). Click Render to create the alpha file. The final result will be a fraction of even the original file size – around 30MB for a 30-second file.
Import your alpha file into Final Cut and create a new sequence. Place the alpha file in track one and then place your original green screen footage file above it on track two, so both clips start at exactly the same point. Click on your source file on track two and then from the Modify menu navigate to Composite Type and choose Travel Matte – Luma. If everything is lined up correctly, when you scrub through the timeline, you should see only your subject against a black background.
The advantage of adding the two clips to a single sequence first is that you can then treat that sequence as a normal clip with transparency without having to worry about the two individual video clips getting out of sync. So you could add it to a sequence you’re already working in and if you place it above a clip that video will now become the background to your subject.
Now that you know the basics, the only limitation is your imagination.














