View Full Version : Overlay image after titles
steveski
28th January 2008, 14:16
Hi,
I've created the following script which nicely creates a translucent watermark on my video.
movie = AviSource("F:\Projects\PremiereProjects\Media\Georgia 3rd Birthday Complete.avi").ConvertToRGB32
logo = ImageSource("F:\Projects\PremiereProjects\Media\CopyrightLogo.png").ConvertToRGB32
maskclip = ColorKeyMask(logo, $000000, 60)
Overlay(movie, logo, mask=ShowAlpha(maskclip), mode="blend", opacity=0.3)
I have an intro title screen which tends to look a bit silly with this watermark displayed as well. Is there a way to have the watermark appear from a specific frame number?
Also, my video has a fade to black at the end.
Is there a way to set the watermark image to fade to black starting from a specific frame number?
Thanks,
Steveski
sh0dan
28th January 2008, 16:08
Create a file called "opacity.txt" along your script that contains:
Type float
Default 0.0
I 0 50 0.0 0.3
R 50 1234 0.3
I 1234 6789 0.3 0.0
Replace "1234" with the frame where the fadeout begins, "4567" with where it ends.
Then change your script to:
movie = AviSource("F:\Projects\PremiereProjects\Media\Georgia 3rd Birthday Complete.avi").ConvertToRGB32
logo = ImageSource("F:\Projects\PremiereProjects\Media\CopyrightLogo.png").ConvertToRGB32
maskclip = ColorKeyMask(logo, $000000, 60)
Overlay(movie, logo, mask=ShowAlpha(maskclip), mode="blend", opacity=0)
ConditionalReader("opacity.txt", "OL_opacity_offset", false)
btw, you shouldn't need to convert your movie to rgb - it's slow and since overlay is done in YUV it is also unnecessary. My suggestion would be:
movie = AviSource("F:\Projects\PremiereProjects\Media\Georgia 3rd Birthday Complete.avi").ConvertToYV12(interlaced=false)
logo = ImageSource("F:\Projects\PremiereProjects\Media\CopyrightLogo.png")
maskclip = ColorKeyMask(logo, $000000, 60).showalpha("yv12")
logo = converttoyv12(logo)
Overlay(movie, logo, mask=maskclip, mode="blend", opacity=0)
ConditionalReader("opacity.txt", "OL_opacity_offset", false)
steveski
28th January 2008, 21:13
Hi,
Thanks heaps for your help.
One thing though is that taking off the .ConvertToRGB32 from the ImageSource line makes ColoyKeyMask fail as it "requires RGB32 input". Is there a way around it?
Thanks again,
Steveski
kevo777
28th January 2008, 22:10
btw, you shouldn't need to convert your movie to rgb - it's slow and since overlay is done in YUV it is also unnecessary.
Just take ConvertToRGB32 off of the AVI, not the Image. It works perfectly this way.
I had another thought. Is it possible to overlay a logo with a drop shadow? I've noticed that my overlay image is missing the drop shadow when applied to the video clip. I'm really trying to wrap my head around masks and layers and alpha channels and different colorspaces etc. Ugh!
steveski
28th January 2008, 23:31
I did try it with ConvertToRGB32 left off both.
logo = ImageSource("F:\Projects\PremiereProjects\Media\CopyrightLogo.png")
maskclip = ColorKeyMask(logo, $000000, 60)
Those lines are independent of the avi source anyway, so I don't see how ColorKeyMask could be affected by the avi being Converted to RGB.
I'll have another look at it tonight.
Just on the drop shadow...I'm using a png as the source which I made with Photoshop. I'd simply set the 'drop shadow' tab of the text layer's blending options, or if it's an older version of PS, GIMP or whatever, create another layer containing the drop shadow.
If your logo is just text from 'Subtitle()' then I don't know how you apply a drop shadow with avs.
By the way, how would I get my overlay to display starting at frame 500?
steveski
steveski
29th January 2008, 00:57
Aah, actually I think I confused myself.
I was originally using Layer() to do the merging, maybe that's where I had issues with blending the 2 colour spaces.
I think what you're saying will work, providing I leave the ConvertToRGB32 on the image.
Cool, pays to think about things ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.