1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[share] Script to Batch Watermark a Directory of Videos.

Discussion in 'Black Hat SEO Tools' started by Arthas, Feb 3, 2009.

  1. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    If you are promoting a website, YouTube, Revver etc. are often a good traffic source. People tend to simply download some video and re-upload it with a different text and the URL in the description.
    A much more effective way to promote with videos is to watermark them. That means you directly put your Text/URL on the video.
    I am not going to describe how to do this on windows here since that is easily done with the first program you find on google. A good start is to learn how to watermark under linux (it’s also easier to simply wget the video, watermark and directly upload from your server with 100MBit), and this is what I’m going to teach you today.
    First of all you will need ffmpeg. On debian you can get it with:
    apt-get install ffmpeg
    Once ffmpeg is installed you can start studying it’s options with
    man ffmpeg
    So what we will need is

    • -i to use an existing video (input)
    • -ab to adjust the audio bitrate
    • -ar to adjust the audio sampling frequency
    • -b to adjust the video bitrate (doesn’t have to be too high for stuff like youtube)
    • -s to adjust the size (doesn’t have to be high either, since the video is only going to appear in a small box)
    • -vhook to apply a video hook, this is going to be necessary for watermarking!
    Now let’s look at the vhook in more detail. We are going to use /usr/lib/vhook/watermark.so.
    It has 3 parameters that are going to be useful for us.

    • -f to specify the image we want to use (the text)
    • -m to specify the mode (m = 1 means that it should use the treshold)
    • -t to specify the treshold at which color the watermark should start to become transparent
    So for my example I had to make a watermark for my side-project p0rnbay.org. The image I used for watermarking was this:


    [​IMG]
    p0rnbay.org Watermark​


    It has a 480×320 size because it has to be the same as the size of the video.
    The command I used to watermark a single video was now:
    Code:
    ffmpeg -i 01.flv -ab 56 -ar 22050 -b 500 -s 480×320 -vhook “/usr/lib/vhook/watermark.so -m 1 -t 222222 -f /home/shax/watermark.gif” 01_watermarked.avi
    … assuming that watermark.gif is the Image above and 01.flv is the video that is to be watermarked.
    Since I had a whole bunch of videos that I had to watermark I quickly wrote this little shellscript:


    Code:
    #!/bin/bash  
    export IFS=$'\n'  
    for i in $(find *.flv -type d)  
    do  
    ffmpeg -i $i -ab 56 -ar 22050 -b 500 -s 480x320 -vhook "/usr/lib/vhook/watermark.so -m 1 -t 222222 -f /home/shax/watermark.gif" ./watermarked/$1  
    done
    
    Save this to a file and name it watermark.sh, create a folder called watermarked, give it chmod 0766 and execute ./watermark.sh.
    Of course this will only work for .flv’s right now, but to make it work for any other format simply edit the ‘for i in…’ line.
    Now you will have all your videos watermarked in the folder ‘watermarked’.

    :)
     
    • Thanks Thanks x 1
  2. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    ::bump::

    this kinda got buried earlier but i know ppl need it.
     
  3. lewi

    lewi Jr. VIP Jr. VIP Premium Member

    Joined:
    Aug 5, 2008
    Messages:
    2,309
    Likes Received:
    818
    Nice copy paste LOL but still usefull.... someone now needs to make software for this :) quick
     
  4. Arthas

    Arthas BANNED BANNED

    Joined:
    Jan 5, 2009
    Messages:
    637
    Likes Received:
    322
    its really pretty easy to use as is if you have linux hosting... but it could easily be done in windows bat as there is an ffmpeg binary for windows.