Codec for Alpha Channel and Compatibility with Jitter (Jit.Gl.Render)

matt greenwood's icon

Hi,

I've been trying to compose layers of video with alpha channels, but I'm stumped by trying to put .mov files with animation codec (the only more universal codec I know that has alpha) which don't work. H.264 works fine but has no alpha channel. Does anyone know of a video format that works with jitter and this object that has an alpha channel? Thank you.

MH's icon

I believe these codecs can keep alpha

Apple ProRes 4444,

PNG, None, or Animation from the Video Codec menu, and choose 32 from the Depth menu.

matt greenwood's icon

I don't have Apple ProRes 4444 unfortunately. I have PNG and Animation but they don't work in jitter. They just don't play at all. 32 bit depth isn't an option when exporting video from After Effects with those lossless codecs :(

MH's icon

Strange I got PNG to work perfectly with alpha
are you using @blend_enable 1 when using jit.gl.videoplane ?

matt greenwood's icon

Do you mean PNG as a codec? Because I've gotten PNG files to work, but just not contained in a sequence within a .mov file, but I'll try again

Even if I could get a separate alpha file in that'd be fine (I can export a separate alpha file in h.264)

Alternatively I could set a chroma key for each video? So I'd have 3 or 4 separate layers of videoplanes - each with a chroma key. Would this involve a jit.gl.slab? What would be the easiest way to implement this? Just 4 videoplanes going to one jitter window output, with a chroma key where I can choose the colour...

MH's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Also if you are intending to use 2 videos to mix with an alpha with gl.slab
you better use something like cc.alphaglue.jxs combined with co.alphablend.jxs

matt greenwood's icon

Sorry, I'm not quite sure if that helps as I can't really use alphas and I'm using at least 4 video planes.

Attached is a really super basic version of what I need to start with, which is 4 videos on video plane layers. Ideally I'd love functioning alphas on them, but if it's not possible, is there an easy way to set a jit.slab with chroma on each video to erase a colour I set?

The only issue with this approach with Chroma Key on a jit.slab in examples I've found is that they deal with two videos being fed into one video plane. I'd much prefer to have separate chroma keys that can be applied to all 4 videos, or 3 videos with one backing video that is uneffected

Thanks and I apologize, I'm really struggling with this program and have 2 days to submit a working project :S :S :S

4Videos.maxpat
Max Patch
Andro's icon

Send each video to a jit.gl.videoplane. Make sure blend enable is on for each one.
Test it with still images. If that works but the films dont then you have no alpha data.
Also get 1 film and send it to jit.unpack 4.
Create 4 jit.pwindows plug each output from pack into them. If the alpha plane is pure white then theres no encoded alpha data.

matt greenwood's icon

Hey,
I don't have alpha data, h.264 is the only encoding that works for me in jitter, and that doesn't contain alpha data. I think at this point I'd rather do a chroma key, but I'm unsure how to do it for 4 different video planes (See my last post)

yaniki's icon

ProRes works fine with alpha channel. Animation, and PNG too. You may also consider HAP Alpha codec (with the great [jit.gl.hap] external by Rob Ramirez).

matt greenwood's icon

Animation and PNG don't work unfortunately. Like I said, only H.264 work in jitter. ProRes may also work but I don't have Final Cut Pro or Compressor which are the only ways to get it. I think Possibly that Chroma Keying might work best for me here if anyone can take a look at my patch and let me know how best to approach that.

4Videos1.maxpat
Max Patch
Andro's icon

Then the problem is with your video encoders not with Max.
Consider searching for open source software which can render with a transparent alpha channel (if your source material has it)
Blender also has a film editor where you can import and export films with all the above mentioned codecs plus you can load in a sequence of still images and then render them as a video with alpha data.

MH's icon

Here's a very simple patch with a png video that has a mask.

You could do the same with lots of different tools in Max (jit.gl.pix, gl.nodes, gl.texture ...)
but for a start that patch works

I do my png files with After Effects and save in quicktime PNG, millions+(which is 32 bit) to keep the alpha
Look at the PNG .mov file in Quicktime inspector and you'll notice the Millions+ info that indicate alpha
I don't know how in FinalCut.

Archive-PNG-video-patch.zip
zip
MH's icon

Also maybe you should download update your codecs in your system ?

Jesse's icon

You don't need Final Cut or Compressor to get ProRes.

Rob Ramirez's icon

supported alpha channel codecs:
Prores4444 with jit.movie (32 or 64)
Animation with jit.movie @engine qt
Hap-Alpha with the jit.gl.hap external (32 bit only)

matt greenwood's icon

"You don’t need Final Cut or Compressor to get ProRes.

That's actually a Final Cut Pro update.

I've updated my codecs and downloaded quicktime pro in an attempt to find a codec that works.

Marie Helene - that patch doesn't work on my end :( It doesn't display the leaf video at all, and when I load in a background video it doesn't handle it properly (it started flicking two colours). Also I'd need to be able to work with 4 separate video planes (like in the patch I attached), so I'm not sure if that's translatable?

@Rob Ramirez
I'm using jit.gl.videoplane because of the layering capabilities. Do I use a jit.movie in conjunction with jit.gl.videoplane?

I really appreciate the responses thus far. Please forgive me as I'm new to Max (am taking it for a university course), so sometimes when I just hear object names I'm unsure how to use them in context.

matt greenwood's icon

i'm thinking that the issue is sending video formats other than h.264 (and maybe prores but i cant test that) to jit.gl.videoplane? So can anyone tell me how I can send a jit.movie to a jit.gl.videoplane? Because I need the layering of videoplane! :)

MH's icon

That is very strange what you describe.

1- What is your computer model and system version ?

2- What Max version are you using ?

3- Do you have Photo JPEG codec ? Try loading a video background formatted with that codec.

matt greenwood's icon

1 - macbook pro 2014 retina 15"

2 - max 7 (second most recent v)

3 - yes I do but it also doesn't work. I can confirm that I've tried a range of different codecs with alpha channel capabilities. I do not think its simply an issue with codecs as only one codec works. I've tried Animation, PNG, No codec, JPEG2000, Motion JPEG ETC ETC ETC. I think the issue might be that I need to load it though a jit.movie.. Can anyone confirm that this might be a potential solution??

Can anyone confirm that maybe these codecs do not work with videoplane alone? That maybe I need to load them into jit.movie and then into the videoplane? Is this possible to do?

MH's icon

And what OSX system ?

I had a lot of problems with a late 2014 MacPro with OSX Yosemite

ProRes codec was our friend.and running Max in 64 bits

Normally all the codecs that were mentioned to you should work. Not just h264.

MH's icon

Just to test ... why don't you try with Max 6.1.9 to see if you get somewhere
with more codecs.

matt greenwood's icon

Unfortunately I am on a month by month subscription which means I do not have access to max 6 :(

can confirm only h.264 works for me with jit.movie too actually.. so i guess that isnt a solution

EDIT: I found a way to get prores 4444 without Final Cut and that seems to work fine!

Thanks for the advice. Over the course of today Im probably unfortunately going to have a tonne of follow up questions, but for now I will experiment,, thanks!!!

matt greenwood's icon

Can anyone confirm if you can do looping points and frame scrubs with the jit.gl.videoplane object? Or does it need to be through jit.qt.movie?

Jesse's icon

jit.gl.videoplane is a display object only. It would not have anything to do with loop points. This can be done with jit.qt.movie.

The Apple installer I posted is a standalone codec installer - it has nothing to do with Final Cut Pro.

matt greenwood's icon

Sorry, but give it a download - it most certainly requires Final Cut Pro, Motion or Compressor. I'd tried that exact installer before I even posted here. It gets to a screen that asks which of your hard drives to install it on, and then informs you that you don't have an application that supports it (Compressor, Motion, FCP). It's not standalone at all.

Andro's icon

Try Blender its free and you get up and running with the films and frames function in 10 minutes

MH's icon

You can’t get a trial version for 30 days ?
Actually the latest for Max6 is 6.1.10

Jesse's icon