Chromakey and rendering

rzanotti wrote on 11/21/2002, 12:44 AM
Hi Folks,

We have filmed some interviews using a green screen. These clips will be placed in a Flash movie using Sorenson compression. We used the chromakeyers, but it always seems to come out rendered as black...

Is there a way to render the video so that the green screen disappears and the transparent background of the Flash movie shows up; or any other application for that matter. I've seen it done, but I'm stumped....

Any help would be appreciated. Thanks. :)

Comments

philfort wrote on 11/21/2002, 1:08 AM
What format are you rendering to? If you render to *uncompressed* .avi or .mov, I think the alpha channel is preserved... otherwise it will be black.
rzanotti wrote on 11/21/2002, 1:19 AM
Hmm? I tried rendering several different formats: Quicktime (fairly compressed) and I did try DV, but it was compressed. So far, the background comes out black, or white. I tried adding a new layer with solid white in it. That didn't work either...

I know this is somehow easy... Just don't know what the heck I'm doing... :)
AlexB wrote on 11/21/2002, 5:02 AM
So where is the problem? You take the background clip, put it on the timeline. You take the greenscreen clip, put it on a video track above that. You click on the little FX-Icon at the end of the Clip (or in the track header) and add chroma key fx, take the colour pick instrument and click it on your green background in the clip to set the key colour. You render.
Tyler.Durden wrote on 11/21/2002, 7:14 AM
My understanding is you need to render *uncompressed* in QT or AVI to keep the alpha information for other apps to use.

I'm not familiar enough with Flash to know if it supports alpa for video files, but if it does, you will need to observe the uncompressed issue.

If Flash does not support alpha in video, you may need to render a separate mask-video to place in a track above the clip in Flash.


HTH, MPH

Tips:
http://www.martyhedler.com/homepage/Vegas_Tutorials.html
rzanotti wrote on 11/21/2002, 11:25 AM
Thanks. The problem wasn't in the chromakeying; that was easy. The problem was once rendered, I couldn't make the background transparent so the video could show the underlying Flash layers...
EW wrote on 11/22/2002, 9:22 AM
I read this at a Macromedia Flash MX forum:

> how did U do to cut out people in the flash movies of Contribute presentation?
> is there any feature in Flash6 that can use a key color to set background transparency in order to avoid cutting our the background on any frame of the video?

usually manually done frame by frame- flash has no control over video files
in such way . You can only import it to flash in movie clip , than mask but this will
be mask for entire file not particular frames.

The URL of the thread is:
http://webforums.macromedia.com/flash/messageview.cfm?catid=194&threadid=488775&highlight_key=y&keyword1=video

And, from another thread:
I don't think it's streaming in video via Flashcom server - it's preloading swf files from here:
(found in web cache)

http://www.macromedia.com/home_movies/clip_01.swf
(clips 1 to 6)

if you look at: http://www.macromedia.com/home_movies/clip_02.swf

you can see the vector mask, revealing the footage was shot agains a purple background.
Right-click and select 'play' - the mask movie clip won't move but the video plays...


Im guessing they made a copy of the video,
made it black and white,
upped the contrast until it was only 2 colours (black and white obviously)

output this as a png sequence with alpha channel to get a mask sequence

then you have to either leave them as png's or trace bitmap to make vector masks.

Yeah its time consuming, and I'd much rather Flash could native handle movie files with alpha channels...
EW wrote on 11/22/2002, 1:04 PM
I found FREE software that can convert an AVI file into a series of JPEGs:

http://www.livetronix.com/products/avidecomposer/index.php

What I did was:

1. Render (uncompressed) the edited Vegas file of the subject against the key background. For me this was just a red block drifting across a green screen.
2. Use AVIDecomposer to produce a string of JPEG's from the uncompressed AVI.
3. Open 1 jpeg in Photoshop 7. I don't know how much of this works in other versions.
4. Go to SELECT, Color Range.
5. Choose Sampled Color from dropdown, Adjust Fuzziness (50 or higher), make sure "selection" is selected, don't worry about the preview.
6. Use eyedropper to choose the chromakey color from the background.
7. You can save this as a preset, then Click OK.
8. Your JPEG should now show a selection on only your chromakey color.
9. You can close this file. Do not resave it.

Create a new folder for the alpha channel files (in PNG format) you are about to create. NOW, the next set of steps will be recorded as a Photoshop Action, for replay and batch processing of all your JPEGs.

1. Open any of the JPEGs.
2. Create a new action called Flash Import. Start RECORDING.
3. Make a new layer.
4. Select the background layer, then select ALL, cut.
5. Make another new layer.
6. Paste into the highest layer available.
7. Delete the background layer.
8. Go to Select, Color Range.
9. Press ENTER to accept the settings.
10.OPTIONAL STEP: Select, Modify, Expand. Set to 2 or 3 pixels. This can help produce a tighter matte.
11.Press DELETE to delete the selection. Now you should see only the foreground image against a "transparent" background. It's not a perfect as a video chromakey, but is quite usable for something like Flash.
12.Go to Save As, choose PNG format and a new location.
13.STOP RECORDING.

From now on, in Photoshop 7, you can do a batch process on all the JPEGs in the folder. It took a few minutes to process about 114 JPEGs to PNGs with an alpha channel.

Then I imported the first PNG into Flash, and it automatically detected the whole sequence. It played back pretty accurately. I now have a "chromakeyed" scene for use in Flash. I didn't have the ability to blue/green screen anything, so my sample was an AVI of just a red block that moved across the screen, against a green background, which got alphaed out thru the above process.

The only thing you may ever have to redo, is the set of steps to define the color range if you change your key color.