Alpha Channel Problem

I’ve got a video with an alpha channel (a RGBA .mov, not a sequence) that I want to composite over another video. How do I use the alpha channel in the video? The alpha channel works when I check “premultiplied” when using the image as a texture on a 3d object, but not in the compositor. :confused: How can I use the alpha channel in the compositor? If possible, I’d prefer to keep the video file without making changes to it.

Video files don’t support alpha channels. PNGs, TIFFs and TARGAs does.

They do, actually. I have a .mov with an alpha channel that works with After Effects and VLC. I’m 100% positive it has an alpha channel. Now could someone answer me instead of telling me I don’t have a problem?

I am sure everyone will stand in line to help you with that sweet attitude…

woah - he was only trying to help.
and actually he didnt tell you you didnt have a problem, he tried to solve it.

add an image node, and set the input to be your film, then add the other film in the same way.
then add an alpha over node, apply the two films to the image inputs, and the alpha of the film to the alpha input.
you may need to switch them round to get it right.

Sorry for being such an a**hole :(. I just knew that the alpha channel worked, and that I didn’t want to use a sequence. I’m very sorry. Anyway, I sort of fixed the problem- I just rendered my scene with the images on planes.

Again, I’m really sorry. I was just really frustrated.

Out of curiosity, since when do video files support alpha channels? I’ve always had the impression that they didn’t.

The Motion-PNG quicktime codec supports alpha for sure, and a huge number of other codecs in the .avi and Quicktime containers also support alpha. It’s more common than I realized; the Action Essentials 2 pack (which was the video in the original question) is all .movs with alpha channels.

The more you know… :slight_smile:

To be blunt, working with compressed videos within compositing is bad practice.
The only time you do it is out of emergency when you got no uncompressed footage - if you created the footage compressed yourself rendering directly to a compressed container - well, it is unprofessional.

Uncompressed Image sequences are the way to go. It only has advantages and I know I sound repeatative by now, but the “render directly to video” option in Blender is for the VSE, not really for rendering scenes. You don´t even render previews to compressed sequences.

Imagine you render directly to hmm. QT. The customer then wants a preview and tells you “I want it as .wmv I don´t want to install QT”
If you got the uncompressed frames, you simply create a nice 2pass encoding and send it.
If you don´t, you can re-compress the compressed stuff, ending with poor quality and adding a line like “Sorry for the bad quality, it´s because I wasn´t thinking” or make up some story. You could also re-render everything to wmv.

Same for compositing.
Lets say you composite a video over another video like you do.
You take a compressed video, composite a compressed video over it and compress it again. Doesn´t sound too smart to me :wink:
If you got uncompressed image sequences, you compose 2 lossless sequences and compress it once.

I know image sequences are preferable, but most of my work is directly 3d stuff, modeling, etc. For my film projects, they all stay in the same network so it doesn’t matter. And video is the best option given limited space on my drive. :slight_smile:

I know it can be done; and the video has an alpha channel, so how do I use that in the Compositor? Help! :eek::eek::eek:

Just use the alpha over node
The example:
Background is an image file
100 frame animation of a moving cube. The movie uses the QT Animation codec with an alpha channel.
The alpha over node puts the cube on top of the background

Attachments


The problem isn’t that I don’t know how to AlphaOver stuff (I use that node all the time :slight_smile: ), but that when I load my RGBA Quicktime movie into the compositor, areas that should be alpha channel (totally transparent) are just black. I don’t think Blender recognizes the alpha channel; it does in the viewport on materials, but only about 25% of the time.

That’s weird! %-)
Are you 100% positive that your video does have an alpha channel?
If you import the video into the compositor and thread the alpha socket to an output viewer what comes out is black where it should be transparent?
Maybe the alpha data is not properly encoded or maybe the compositor doesn’t know how to handle it.
In retrospect, if alpha data is pure black would it be possible to pull a luma key and convert that to alpha data?
Wild guess here but you never know really…

AFAIK FFmpeg alone is used for video import into the VSE and Compositor where as QT is an import option for video textures (mac & win only)

So I guess FFmpeg does not support alpha channel in your video source.

You could use Avisynth to open your video in Blender by decompressing it with QT. If you can put up a sample or a link to a free demo source it would be interesting to see.

Taken that route before now for ProRes.

I can’t really put up the video I’m using, as it’s a commercially available product;I’ll try Avisynth and see how that works out.

If you’re unfamiliar with Avisynth then I can give it a go later today.

You’ll need QTSource plugin from Tateu Google those terms and you’ll see a direct link to the QTSource plugin and readme. Once you have a working .avs script you can create a simple batch script to generate a .avs script for each of your video sources and import the .avs scripts into the compositor directly as if they were the sources.

a foolproof way would be to render your video with 2 video outputs - 1 for RGB and the other for alpha [represented as RGB].

That way you can be sure it has an alpha channel :wink:

That’s a good idea, but I’m dealing with a video that I didn’t create. It already has an alpha channel.