Alpha Channels/Compositing with Open Source

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
gnat
Posts: 34
Joined: Fri Aug 11, 2006 2:24 pm
Location: Maryland

Alpha Channels/Compositing with Open Source

Post by gnat »

I have been playing around with compositing animated material from Moho with live scenes, and have had some problem with Free/Open Source video editing software (e.g. Zweistein) supporting the alpha channels from Quicktime files. I'm not looking to get AfterEffects, if I can just make one of the other tools work well.

I've finally sorted out a way of accomplishing what I want with AVISynth frame server for those of you suffering the same issue, but I am wondering if anyone else has had luck with Jahshaka or one of the other open source editors.

Thanks,

Gnat

P.S. To do the compositing with Avisynth, download and install it (avisynth.org), write a script something like the following naming it with the "avs" extension, and then use something like VirtualDub (sourceforge.net) to open the AVS file and save it as an AVI. You may need Quicktime Alternative to make the DirecShowSource work right in AVISynth:

clip1 = AVISource("LiveClip.avi")
clip2 = DirectShowSource("MohoMovieWithAlpha.mov")
Overlay(clip1, clip2, mask=ShowAlpha(clip2), mode="blend", opacity=1)
Visit Pappy's Blog, home of Pappy the wonder terrier!!!
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Post by Fazek »

There is the same problem with Gimp if I export from Moho into a TGA sequence. The TGA file has the alpha information, but a bit ( (((char *)TGAHead)[0x11] & 0x0F) == 0x08 ) is missing from the header so Gimp reads it as RGB instead of RGBA. Maybe the Quicktime files has something like this. But Quicktime is a complicated (Apple...) format, so it is harder to find why those programs fails.

(I am using Moho 5.4, not Anime Studio)
- - - Fazek
User avatar
gnat
Posts: 34
Joined: Fri Aug 11, 2006 2:24 pm
Location: Maryland

Post by gnat »

Fazek, thanks for the response.

A lot of this is out of my depth regarding the specific high byte for the alpha channel, but it seems like Apple documents the alpha channel capabilities for Quicktime. Also, in the Windows environment, the DirectShow support (as indicated by my AviSynth tests) provides a pretty easy interface. I'm hoping that there is some free video editor, at least for Wintel, that would make it a bit easier to do some more complex edits on combined Moho and non-Moho content. I can work pretty happily with AVISynth for short bits, but it gets tedious after a while.

Thx,

Nat
Visit Pappy's Blog, home of Pappy the wonder terrier!!!
User avatar
relik
Posts: 34
Joined: Wed Sep 13, 2006 3:52 pm
Location: Houston, TX, USA
Contact:

Post by relik »

I'm wondering why you aren't exporting to AVI to begin with (may have missed something in your post-perhaps you are on a Mac and don't have the option). Exporting AVI as Full Frames (uncompressed) creates an alpha channel in the file.

I know After Effects sees it, but have no idea about Zwei-Stein. What little I have read about it would tend to indicate that it would, especially if you are doing an AVI conversion to the QT to make it work. AVI didn't used to output an alpha channel, but it does now.

I will caveat that my test of this is with "Anime Studio Pro" but I believe this conforms fairly faithfully to Moho 5.4 from what I've heard. At any rate if you're not on a Mac you might give it a try.

Alternatively, you might consider importing the video into Moho as the background layer, and letting it do the compositing. I did that with a recent project (again using AS Pro) and it worked just fine.-R
User avatar
gnat
Posts: 34
Joined: Fri Aug 11, 2006 2:24 pm
Location: Maryland

Post by gnat »

I'll have to try that. I thought I understood that Moho only did RGB24, without the additional alpha channel-- but I guess I never checked. Don't have Zweistein handy, but it may handle that more gracefully.

Thx,

Gnat
Visit Pappy's Blog, home of Pappy the wonder terrier!!!
User avatar
relik
Posts: 34
Joined: Wed Sep 13, 2006 3:52 pm
Location: Houston, TX, USA
Contact:

Post by relik »

I tried this with a "beta version" of Anime Studio Pro which I understand is equivalent to Moho 5.x, so I think it should work at least on the PC. I popped it into After Effects and it saw the alpha channel on import, let me load it and matted correctly.

I'm pretty sure you have to work with non-compressed AVI, though, but the format apparently has been supporting an alpha channel for about the last year. If the app writes out the alpha using the Windows API, there's nothing that should prevent it.

I went looking for zwei-stein on Google and got a link to t@b (?) for something called ZS4. I'm assuming this is the app in question (Opensource compositor/editor) . Reading down through the list of features/fixes it appeared it should have no problem matting an AVI alpha channel correctly.

Let me know if that works for you. If not I'll look around and see if there are some other toys. Obviously I already have After Effects myself, but I try to keep up with what's out there.-R
myles
Posts: 821
Joined: Sat Aug 21, 2004 3:32 am
Location: Australia, Victoria, Morwell
Contact:

Post by myles »

Some great posts relik! (in this and other threads)

Yes, gnat, as relik says, uncompressed AVIs support alpha. You can also get other lossless codecs that support alpha but create smaller file sizes, if you need smaller file sizes for any reason (my current favorite is Lagarith, but you could also use HuffYUV).

Note to readers: many AVI and Quicktime codecs don't support alpha, you need to check each codec, and make sure it is set to actually generate alpha (In Quicktime format, the setting Millions of colors+, the '+' indicating alpha).

Regards, Myles.
"Quote me as saying I was mis-quoted."
-- Groucho Marx
User avatar
J. Baker
Posts: 1063
Joined: Wed Mar 23, 2005 7:22 pm
Location: USA
Contact:

Post by J. Baker »

myles wrote:...(my current favorite is Lagarith...
It's the best. :wink:
User avatar
gnat
Posts: 34
Joined: Fri Aug 11, 2006 2:24 pm
Location: Maryland

Post by gnat »

Took a shot at saving as AVI with alpha channel using HuffyUV with the appropriate settings for RGB32, but Zweistein doesn't recognize it. Zweistein is in some ways very complete (great tools for tweaking position and size of composite images, effect containers, etc. throughout the timeline), and in some ways it is a bit incomplete (odd interface, and if you want real compatibility between your clips and the program, you need to reprocess your video and use the programs internal codecs rather than the system codecs). I worked out a way to make it work by exporting the alpha channel as a separate B+W clip, but that is a nuisance.

Jahshaka is about to come out with a new release candidate, and I may take a second look at that. And I may poke around with Wax again. And I always have the backup plan of doing the compositing in AVISynth frame server. Or I could empty the bank account and buy a professional product like AfterEffects.... nah!

Regards,

Gnat
Visit Pappy's Blog, home of Pappy the wonder terrier!!!
Post Reply