Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Registered User
Join Date: May 2016
Posts: 4
|
Trying to overlay an image logo zooming in while retaining transparency.
I have no idea how I'm having so much trouble with this.
What I'm trying to do is, have a video, have a logo appear in the center super small, then slowly zoom in to fill up the screen, all the while leaving the original video in the background, and keep transparency intact. I'm trying to use the sample on the Animate page, "Zoom overlay 2". But when I do it, the closest I get is, the first frame of the video has the final frame of the zoom's transparency present, like a mask, and the image zooms in to fill in that space, only showing up where the black mask is. The weird thing is, if I jump around in the video, it disappears altogether. If I then run through it, flickers between the underlay video and the zooming image on a pure black background. What the heck is going on? Here's the entire script: Code:
a=FFVideoSource("video.mp4").converttorgb32 function res(clip clip, clip "LClip", int "width", int "height", \ int "centerX", int "centerY") { LClip = BicubicResize(LClip, width, height) Overlay(clip, LClip, centerX-LClip.Width/2, centerY-LClip.Height/2) } function resize(clip clip, clip "LClip", \ int "start_frame", int "start_width", int "start_height", \ int "end_frame", int "end_width", int "end_height", \ int "centerX", int "centerY") { return Animate(start_frame, end_frame, "res", \ clip, LClip, start_width, start_height, centerX, centerY, \ clip, LClip, end_width, end_height, centerX, centerY) } clip = ImageSource("title.png",pixel_type="RGB32") black=BlankClip(clip) clip=resize(black, clip, \ 0, 5, 5, \ 300, 1280, 720, \ clip.Width/2, clip.Height/2) Layer(a,clip) trim(0,500) |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,625
|
It's because the alpha channel is not resized in the same manner. If you view the alpha separately, you will see the problem
not a very smooth zoom either ; I think someone made a smoother zoom function here, maybe riffraff42 or gavino ? Eitherway it's a lot smoother in a NLE or compositing tool https://forum.doom9.org/showthread.php?t=168266 Code:
a=FFVideoSource("video.mp4").converttorgb32 function res(clip clip, clip "LClip", int "width", int "height", \ int "centerX", int "centerY") { LClip = BicubicResize(LClip, width, height) Overlay(clip, LClip, centerX-LClip.Width/2, centerY-LClip.Height/2) } function resize(clip clip, clip "LClip", \ int "start_frame", int "start_width", int "start_height", \ int "end_frame", int "end_width", int "end_height", \ int "centerX", int "centerY") { return Animate(start_frame, end_frame, "res", \ clip, LClip, start_width, start_height, centerX, centerY, \ clip, LClip, end_width, end_height, centerX, centerY) } b = ImageSource("title.png",pixel_type="RGB32").assumefps(framerate(a)) black=BlankClip(b) b2=resize(black, b, \ 0, 5, 5, \ 300, 1280, 720, \ b.Width/2, b.Height/2) b3=resize(black, b.showalpha, \ 0, 5, 5, \ 300, 1280, 720, \ b.Width/2, b.Height/2) overlay(a, b2, mask=b3) trim(0,500) |
![]() |
![]() |
![]() |
#3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,137
|
Perhaps something of interest here:- https://forum.doom9.org/showthread.php?t=174127
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
Tags |
animate, transparency, zoom |
Thread Tools | Search this Thread |
Display Modes | |
|
|