View Full Version : put one clip into other?
sasam
11th September 2005, 18:42
Im not sure where I should post this but anyway I need a Avs plugin or script which takes 2 clips which deletes some specific color from the first clip and puts it over second clip. To explain what am I doing:
first clip is some 3D animation I made that I want to put into second but the background of the 3D object is black so I need to delete black color and put only 3D object into second clip ,second clip is a camera recording and it is not changed.
If you still dont understand what I need here is a second example:
A guy stands infront of the blue background, they delete the blue color and put something else instead of it...
If there isnt a avs plugin for this can anyone recommend some small and simple program that does this?
Thanks in advance
stickboy
11th September 2005, 20:56
Look into the internal ColorKeyMask function.
Mug Funky
12th September 2005, 04:16
also, to get cleaner and more accurate masking, why not render your animation with an alpha channel? there's a few avi codecs that support RGBA, avisynth supports it, and i've never seen a 3d app that didn't support it, so htis could be the way to go.
you could just use "layer(clip1,clip2)" in this case, i think.
E-Male
12th September 2005, 04:28
or export the animation to a sequence of images and load those into avisynth with immaavs, so you'll have an alpha-channel
sasam
12th September 2005, 07:29
I render in maya in rgb32 with alpha channel enabled in avi.
avisource("maya.avi").trim(1,200)
ShowAlpha()
when I use this script I get a black clip?
I then used something like this:
a=directshowsource("P1010019.mov").trim(1,200)
b=avisource("maya.avi").trim(1,200)
b=Mask(b,b)
c=layer(a,b)
c
and the black background was fully transparent but the object was also ~50% transparent.
Since then I changed something and now I cant get anything to work? I tried every setting but it always crashes?
I cant figure it out???
sasam
12th September 2005, 08:39
Now it is working again. (All clips must be rgb)
Here is a picture of what I get and what I want:
http://img352.imageshack.us/img352/5515/a1za.jpg
Any ideas?
mg262
12th September 2005, 15:58
Look at the documentation for the layer command -- especially the level argument.
stickboy
12th September 2005, 19:11
Yup. And note that you don't want to use Mask: it converts the clip to grayscale and uses the resulting clip as a mask. If your clip is RGB32 with an alpha channel already, then you should use Layer directly.
sasam
13th September 2005, 08:00
I dont know if it has a mask. I think it doesnt. Because when I use ShowAlpha() I get a black clip, but alpha channel is checked in maya?
When I use layer directly the whole maya clip is transparent.
sasam
13th September 2005, 08:10
I dont know how to make my own mask. I tried colorkeymask but it crashes
a=avisource("bds.avi").converttorgb.trim(1,200)
b=avisource("maya.avi").trim(1,200)
b=ColorKeyMask(b)
mask = b.ShowAlpha("rgb")
c=overlay(a,b,mask=mask)
c
Mug Funky
13th September 2005, 09:02
what video codec are you using? a lot will just ignore any alpha info handed them by a 3d app and save only RG and B.
i believe "corePNG" supports alpha, and i think the RGB mode of huffyuv does as well.
sasam
13th September 2005, 12:14
in renders in uncompressed rgb32
sasam
15th September 2005, 07:58
I now rendered the animation as a tif sequence and open it in Photoshop, and now it has an alpha channel but avisynth still cant see it so I download a trial of premiere and import one picture and a clip and it is working, but I didnt find an option to import image sequence. Do you know if it has an option to import as an image sequence or do you know some other video program that can do it?
Wilbert
15th September 2005, 09:18
Pics with alpha channel can be loaded with ImageSource (using latest v2.56rc1) or Immaavs: http://forum.doom9.org/showthread.php?s=&threadid=90131
sasam
15th September 2005, 09:46
Pics with alpha channel can be loaded with ImageSource (using latest v2.56rc1) or Immaavs: http://forum.doom9.org/showthread.php?s=&threadid=90131
Yes I know and have tried that. I have 2.56 build jan 31 2005.
it opens with
imagesource("untitled%d.tif", 0, 199, 25)
but when I add showalpha("RGB") it crashes
...but it doesnt crash when I add converttorgb32 to imagesource, but the alpha is then all white? those images are already rgb32...
sasam
15th September 2005, 10:21
thanks to everyone, it is working now with Immaavs.
Wilbert
15th September 2005, 11:58
Try
imagesource("untitled%d.tif", 0, 199, 25, pixel_type="RGB32")
sasam
15th September 2005, 14:17
Try
imagesource("untitled%d.tif", 0, 199, 25, pixel_type="RGB32")
that also doesnt work but it works with Immaavs...
Wilbert
15th September 2005, 15:01
Try v2.5.6rc1, since your version is too old.
E-Male
15th September 2005, 16:33
ImMaAvs should always produce rgb32
it reads the alpha-channel from all formats that ImageMagick can read it from
not sure if it works with tif
you could ask about that at the ImageMagick forum
Wilbert
15th September 2005, 19:33
not sure if it works with tif
Like he says it works with tiff :)
E-Male
15th September 2005, 19:35
oooops, i missread the 'imagesource' in "...when I add converttorgb32 to imagesource, but the alpha is then all white..." for 'immaavs'
sasam
17th September 2005, 13:37
...by the way it works in newest avisynth with imagesource but I'm going to wait for final release because the denoising script I use (http://forum.doom9.org/showthread.php?p=622247#post622247) gives much worse results until seeking forward or backwards.
I don't know if this issue is familiar to anyone
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.