VideoHelp Forum
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. hi...i want to learn how to add watermark to a video using megui..(avisynth)
    i've searched for this a lot but didnt get any satisfied answers..

    i've videos of my collage festivals and i want to encode them..but since i am doing this all encoding work i want to add watermark to my videos..

    i did try to change the avisynth file using avisynth script editor..but being a noob in the encoding i dont know much about it..

    any help in this would be very appreciable..!! thank you..
    Quote Quote  
  2. thanks for quick reply buddy..
    actually i just read this post..and got everything cleared..
    Code:
    https://www.videohelp.com/forum/archive/adding-transparent-logos-onto-vob-files-t360155.html
    only thing which is not cleared is that..the watermark stays till the end in the video...
    and i want to add watermark at regular intervals..like say watermark should appear after every 30minutes for 20 seconds..!!

    please help!!
    Quote Quote  
  3. Use trim() to divide up your video , or applyrange to apply filters to segments of video
    Quote Quote  
  4. ok...can you give me the code....here is the code i am using for watermarking..

    a1=avisource("DSC4000015.avi")
    a2=ImageReader("C:\Movies\logo.png")
    a3=ImageReader("C:\Movies\logo.png",pixel_type="RG B32").ShowAlpha(pixel_type="RGB32")
    Overlay(a1,a2,mask=a3, x=40, y=40)
    now if i want watermark to appear at regular intervals..what will be the code..
    sorry if i gave u burden..cause i am noob in scripting...giving me error all the time...
    Quote Quote  
  5. I'm not sure how to do it regularly, except to specify it manually where you want it. You might be able to with conditional reader or some related functions

    If you knew the fps of the video you could script it pretty easily (e.g. lasting 20 seconds every 30 minutes). Unless your video is like super long like 100's of hours long, the line you customize for replacing frames will be very short

    Code:
     
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemapFrames\RemapFrames.dll")
    a1=AVISource("video.avi")
    a2=ImageSource("logo.png",pixel_type="RGB32")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha())
    ReplaceFramesSimple(a1, a3, mappings="[0 299][53999 54299]")
    So in this example, the logo displays for 10 seconds at the beginning, 10 seconds at the 30 minute mark

    The frames 0-299 are replaced, and 53999-54299 are replaced. If it was a 30fps video, 0-299 would be the 1st 10 seconds. The 54000 frame mark would be 30 minutes in (because 30 frames/sec * 60 seconds/minute *30 minutes) - actually it should be 53999, because avisynth starts numbering by 0. If you wanted to add more every 30 minutes, just calculate it and add to the mappings. If your video fps is different, just adjust for it


    Cheers
    Quote Quote  
  6. whoaaa ..thanks a lot buddy..your code worked perfectly..
    i just add the x and y int in overlay and it was perfect...
    u r great man!!\m/..thanks again..
    Quote Quote  
  7. Member
    Join Date
    Jul 2011
    Location
    Isfahan
    Search Comp PM
    hello friends
    i tried this script for adding watermark to .mkv with some litle changes:
    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\remapframes_25_dll_20050826\RemapFrames.dll")
    a1=DirectShowSource("clip.mkv",fps=23.98)
    a2=ImageSource("logo.png",pixel_type="RGB32")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha())
    ReplaceFramesSimple(a1, a3, mappings="[0 299][5999 6299]")
    but it encodes the video.
    do you have any idea.

    the color space of the video is yuy
    Quote Quote  
  8. All AviSynth scripts encode the video (although you can play the script as if it were a video). Any time you add a logo to a video you have to encode the video. The only way to avoid that is to add the logo as a subtitle.
    Quote Quote  
  9. Hey Friends I used this Script to add logo

    HTML Code:
    LoadPlugin("C:\Program Files\[url=https://www.videohelp.com/tools/Avisynth]AviSynth[/url] 2.5\plugins\RemapFrames\RemapFrames.dll")
    a1=AVISource("video.avi")
    a2=ImageSource("logo.png",pixel_type="RGB32")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha()) ReplaceFramesSimple(a1, a3, mappings="[0 299][53999 54299]")
    Its good for watermarking, but I want to resize/crop the image at the same time, so I edited this script and made this new one:

    HTML Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemapFrames\RemapFrames.dll")
    a1=AVISource("video.avi")
    a2=ImageSource("logo.png",pixel_type="RGB32")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha()) ReplaceFramesSimple(a1, a3, mappings="[0 299][53999 54299]")
    crop( 2, 2, -2, -2)
    LanczosResize(640,480) # Lanczos (Sharp)
    But this script didn't worked, It only re sized the Video, but there was no watermark on the Video,

    Can anybody please suggest me any other working Script which can add watermark, crop, resize the video at same time

    Thanks in Advance.
    Quote Quote  
  10. Try this:

    Code:
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemapFrames\RemapFrames.dll") 
    a1=AVISource("video.avi") 
    a2=ImageSource("logo.png",pixel_type="RGB32") 
    a3=Overlay(a1,a2,mask=a2.ShowAlpha()) 
    ReplaceFramesSimple(a1, a3, mappings="[0 299][53999 54299]") 
    crop( 2, 2, -2, -2)
    LanczosResize(640,480)
    I don't really know if that'll fix it, but with yours it never had a chance to get the logo in there. You didn't follow the previous script you copied properly. And, just for the record, I think watermarking/defacing someone else's video is plain stupid.
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by manono View Post
    I don't really know if that'll fix it, but with yours it never had a chance to get the logo in there. You didn't follow the previous script you copied properly.
    Baba101's script is essentially the same as yours, so I don't understand your remark. Note that, although they are conventionally used, newlines are not mandatory between statements.

    Baba101, are you sure your logo has a correct alpha channel, and is not completely transparent?
    Quote Quote  
  12. Originally Posted by Gavino View Post
    Note that, although they are conventionally used, newlines are not mandatory between statements.
    That's where I went wrong then. I figured if he didn't put it in a new line, he'd need a 'dot' to separate the two to make it get used.
    Quote Quote  
  13. Member
    Join Date
    Jul 2004
    Location
    United States
    Search Comp PM
    How do I execute this code?

    Code:
    a1=AVISource("D:\video.mp4")
    a2=ImageSource("D:\Logo.png",pixel_type="RGB32")
    a3=Overlay(a1,a2,mask=a2.ShowAlpha())

    I download AviSynth 2.58, but my plugin doesn't have RemapFrames.
    This is what I have:
    AviSynth\Plugins\
    avss.dll
    colors_rgb.avsi
    DirectShowSource.dll
    TCPDeliver.dll
    VSFilter.dll
    Quote Quote  
  14. That three-line script you showed doesn't use anything from RemapFrames, but you can get it here:

    http://www.avisynth.nl/users/stickboy/

    And most likely you won't be able to open your MP4 video using AVISource.
    Quote Quote  



Similar Threads

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