Have you ever wanted to watermark your video with your name or company or whatever? I mean like how YouTube stamps its logo an all videos, it is easy that I thought. I have been working on it for a good one hour and guess what it works and its not rocket science, even I can do it.
Platform: the tools used
Platform: the tools used
- platform: Ubuntu Jaunty (9.04)
- media player: mplayer
- image editor: gimp
- watermarking tool: ffmpeg using the vhook library
NOTE: The default ffmpeg on the Ubuntu repository does not have vhook enabled. You may have get the source code and compile it with vhook enabled.
Compiling ffmpeg
- Download the ffmpeg
- Untar it: tar jxfv ffmpeg-xx.xx.tar.bz2
- Get into the untared folder: cd ffmpeg-xx.xx/
- Configure with the vhook enabled: ./configure --enable-gpl --enable-nonfree --enable-vhook. Run ./configure --help to get a full list of options. NOTE: the . in the commands above is part of the command, so put it there.
- Compile and Install: make && make install
- vhook files will be located in the /usr/local/lib/vhook
Ingredients: the verges and spices
Delicious: what goes to the table
See what we served on the table
Try It and tell me! Have fun guys!.
- video to be watermarked:
- the image to watermark the video. NOTE: the image background must be of color: #808080 and of the same size as the video.
Creating the watermarking images
- Play the video from the console/terminal to get the size of the video: mplayer thetrain.mpg
- Read the size of the video from the info displayed when mplayer loads the video, see the image below.
- So the create an image with the same size as the video, in this case it is 640x480 pixels. Remember the background of the image must be #808080, then add all that you want. Here is mine.
- Now we set, its time to cook
- To make it easy, put all the ingredients in on pot, oops sorry, in one folder. The naviget on the terminal to that folder. Here is the generic structure of the command to watermark: ffmpeg -sameq -i original-video -vhook 'path-to-watermark.so-library -f overlaying-image' output-file. The sameq force the ffmpeg to maintain the same quality in and out. There is my cooking: ffmpeg -sameq -i thetrain.mpg -vhook '/usr/local/lib/vhook/watermark.so -f overlayer.png' thetrain.fsp.mpg.
- Prepare the table and save the food. Use mplayer to try your newly watter marked file
Delicious: what goes to the table
See what we served on the table
Try It and tell me! Have fun guys!.
No comments:
Post a Comment