View Full Version : Create AVI with Alpha Channel
michaelang
20th August 2003, 05:23
Hi, hope someone can help me on this. I am trying to create a rgb32 avi with alpha (for other NLE) using virtualdub or avs2avi without much success. My avs is as below:
video=BlankClip(200,width=720,height=576,FPS=25, color=$0000FF)
subVideo=TextSub(video,"D:\movies\champnagne1.srt")
MaskClip=ColorKeyMask(subVideo,$0000FF,20) #mask out blue as alpha
clip=Mask(subVideo, MaskClip)
return clip
Please also advise a suitable codec for the compression.
Thanks in advance.
Belgabor
20th August 2003, 14:24
I don't know if this is possible. First I don't know if avisynth actually spits out the alpha channel to vdub (ask an avisynth guru for that :)) and second I don't know if there is a codec that actually preserves the alpha info, probably you'll have to save it uncompressed. Last I'm not entirely sure if vdub internally handles rgb32, so I can't say if it would 'corrupt' rgb32 input if you select anything diffrent from 'Direct Stream Copy'.
Wilbert
20th August 2003, 15:23
First I don't know if avisynth actually spits out the alpha channel to vdub
Sure.
Only in 'Direct Stream Copy' it stays RGB32, but I guess you know this better than I do.
I don't know if there is a codec that actually preserves the alpha info
I guess the lossless codecs (huffyuv, ffvfw) do this if you select RGB32.
To which NLE do you want to frameserve?
michaelang
21st August 2003, 04:37
I am bringing the AVI or MOV to Final Cut Pro. I solved the problem using avs2avi and change the avs to below (adopt from http://forum.doom9.org/showthread.php?s=&threadid=56277):
Yes, huffyuv is probably the only working codec.
Sorry that I placed this topic in VirtualDub group, but I think virtualDub does not handle alpha channel very well.
<<<<<<<
video=BlankClip(200,width=720,height=576,FPS=25, color=$00FF00,pixel_type="yuy2")
grey=blankclip(video,color=$808080,pixel_type="yuy2")
base=BlankClip(video, color=$0000FF,pixel_type="rgb32")
subVideo=TextSub(video,"D:\movies\champnagne1.srt")#.converttoyv12()
mymask=subVideo.VtoY().converttoyuy2().greyscale().levels(104,1,128,0,255).bilinearresize(720,576).converttorgb32()
rgbclip=subVideo.converttorgb32()
goodclip=mask(rgbclip,mymask)
goodclip2=layer(base,goodclip, level=255, op="add")#.converttoyuy2()
return goodclip2#.showalpha()
>>>>>>>>
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.