VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. I'm looking for a way to add logos/icons/images to the screen for 5 seconds at the beginning of the video, like this:

    Image
    [Attachment 64750 - Click to enlarge]


    I'm using this script that does what I need:

    Code:
    clip1=LWLibavVideoSource("video.mp4").ConvertToRGB32()
    clip2=ImageSource("1432193.jpg").ConvertToRGB32().BilinearResize(1280,720)
    maskclip = ColorKeyMask(clip2, $00B140, 0)
    Overlay(clip1, clip2, mask=ShowAlpha(maskclip), mode="blend", opacity=1)
    On top of that I want to add two logos to the right of the screen, I did try something like the code bellow to se if it would show up:

    Code:
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    layer(icon1, icon2)
    Instead, the final video is 80x80 with the logo2.png on top, I also try "Overlay" but it end up with the exact same result.

    How do I do that?

    Thank you.
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Remember that for many compositing processes with images (text is usually excluded here), all images' canvases/frames need to be the same size. So if you have an 80x80 logo sprite to overlay on top of a 1920x1080 video, you will need to apply borders to the 80x80 to expand it out to 1920x1080 (and you would also want to include additional padding with the mask, so that those borders don't show up).


    Scott
    Quote Quote  
  3. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Change "layer(icon1, icon2)" to:

    Code:
    Overlay(icon1, x=50, y=200)
    Overlay(icon2, x=50, y=300)
    Adjust x y coords [top left corner] to your needs.
    Quote Quote  
  4. Originally Posted by pokoloko View Post
    On top of that I want to add two logos to the right of the screen, I did try something like the code bellow to se if it would show up:

    Code:
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    layer(icon1, icon2)
    Instead, the final video is 80x80 with the logo2.png on top, I also try "Overlay" but it end up with the exact same result.
    What you are doing is overlaying icon2 onto icon1 and returning the result -- an 80x80 image that is just icon2. You want to layer each of the icons on top of the earlier video, which is named "last" since you didn't name it:

    Code:
    # assuming last is the output of the previous code
    
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    layer(last, icon1, x=?, y=?)
    layer(last, icon2, x=?, y=?)
    Set the x and y coordinates as needed.

    Remember, when you don't specify a clip by name the name "last" is assumed, both for input and output.
    Quote Quote  
  5. Originally Posted by Cornucopia View Post
    Remember that for many compositing processes with images (text is usually excluded here), all images' canvases/frames need to be the same size. So if you have an 80x80 logo sprite to overlay on top of a 1920x1080 video, you will need to apply borders to the 80x80 to expand it out to 1920x1080 (and you would also want to include additional padding with the mask, so that those borders don't show up).

    Scott
    Thank you mate.

    Originally Posted by VoodooFX View Post
    Change "layer(icon1, icon2)" to:

    Code:
    Overlay(icon1, x=50, y=200)
    Overlay(icon2, x=50, y=300)
    Adjust x y coords [top left corner] to your needs.
    That does it, thank you.

    Code:
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    
    Overlay(icon1, x=1159, y=276)
    Overlay(icon2, x=1159, y=362)
    Image
    [Attachment 64751 - Click to enlarge]


    PS: How to make that fadeout after 5 seconds at the beginning of the video?

    Originally Posted by jagabo View Post
    Originally Posted by pokoloko View Post
    On top of that I want to add two logos to the right of the screen, I did try something like the code bellow to se if it would show up:

    Code:
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    layer(icon1, icon2)
    Instead, the final video is 80x80 with the logo2.png on top, I also try "Overlay" but it end up with the exact same result.
    What you are doing is overlaying icon2 onto icon1 and returning the result -- an 80x80 image that is just icon2. You want to layer each of the icons on top of the earlier video, which is named "last" since you didn't name it:

    Code:
    # assuming last is the output of the previous code
    
    icon1=ImageSource("logo1.png").ConvertToRGB32().BilinearResize(80,80)
    icon2=ImageSource("logo2.png").ConvertToRGB32().BilinearResize(80,80)
    layer(last, icon1, x=?, y=?)
    layer(last, icon2, x=?, y=?)
    Set the x and y coordinates as needed.

    Remember, when you don't specify a clip by name the name "last" is assumed, both for input and output.
    Thank you sir, works like a charm.

    Code:
    layer(last, icon1, x=1159, y=276)
    layer(last, icon2, x=1159, y=362)
    Image
    [Attachment 64751 - Click to enlarge]


    PS: How to make that fadeout after 5 seconds at the beginning of the video?
    Quote Quote  
  6. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by pokoloko View Post
    PS: How to make that fadeout after 5 seconds at the beginning of the video?
    You better use some plugin for logos, like logo.avsi from Dogway: https://github.com/Dogway/Avisynth-Scripts
    I see there are options to do fade ins and outs.
    Quote Quote  
  7. Originally Posted by VoodooFX View Post
    Originally Posted by pokoloko View Post
    PS: How to make that fadeout after 5 seconds at the beginning of the video?
    You better use some plugin for logos, like logo.avsi from Dogway: https://github.com/Dogway/Avisynth-Scripts
    I see there are options to do fade ins and outs.
    Thank you, I'll give a try.
    Quote Quote  
  8. This is the changes done to make the logo 1 and logo 2 to fadein and fadeout at the beginning of the video:

    Code:
    icon1=ImageSource("logo1.png", start=0, end=150).ConvertToRGB32().BilinearResize(80,80).FadeIn(10).FadeOut(15)
    icon2=ImageSource("logo2.png", start=0, end=150).ConvertToRGB32().BilinearResize(80,80).FadeIn(10).FadeOut(15)
    Define the amount of frames (start, end) and set FadeIn, FadeOut at the end.

    Thank you all for the help.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!