Need Step By Step Tutorial For FFMPEG Hardcoded Watermark
Hello,
I have searched through out the forum for ffmpeg hardcoded watermark.
I couldn't find or i'm unable to find.
All i found was this:
Quote:
If you use ffmpeg for converting you can use the vhook feature (
http://ffmpeg.mplayerhq.hu/hooks.html#SEC7 ) to add image watermarks to your videos.
You will have to read the docs and work it out yourself though....post a guide if you use this way as i dont have time to look into it.
The above link in the qoute is not valid now.
If you have successfully used ffmpeg hardcoded watermark,
Pl post a step by step tutorial here.
Thank you.
FFmpeg 0.6 VIDEO HARDCODED WATERMARK
vhook is obsolete now unless your server is using FFmpeg 0.5 most servers have upgraded to FFmpeg 0.6 . FFmpeg 0.6 uses libavfilterwich instead of adding a subtitle it adds an overlay a PNG with background transparency. So to add a water mark to videos using FFmpeg you need to do the steps below....
**FIRST BACKUP YOUR FILES**
- install FFmpeg 0.6 ( I used Google and found this site Using FFmpeg to add and watermark / overlay on a video )
- make a .png of your logo with background transparency (background transparency must be the same size as the converted videos EG. 320x240). I have uploaded my logo as an example for you.
- add the .png to your folder /include/settings/
- edit your video_conversion.php file with the code below
In /include/settings/video_conversion.php find the code $cmd_all = (towards the end of the file) . replace the code with the code below...
PHP Code:
//ffmpegflv - ffmpeg codec 11-2-10 converts to .flv With Watermark
$cmd_ffmpegflv = "$config[ffmpeg] -i '$video_src' -s 320x240 -f flv -b 900k -acodec libfaac -ab 16k -vf 'movie=0:png:/home/YOUR_USERNAME/public_html/include/settings/watermark_flvideo.png [wm];[in][wm] overlay=1:0:0 [out]' $video_flv > /home/YOUR_USERNAME/public_html/include/settings/flvid.log 2>&1 ";
$cmd_all = $cmd_ffmpegflv;
Replace "YOUR_USERNAME" with your server path username and you can adjust the quality and size to your liking. Also ONLY NEWLY UPLOADED VIDEOS WILL HAVE THE WATERMARK and vShare DOSE NOT CONVERT .FLV FILES, however I can change the file in the vShare script to convert .flv files. I hope this helps PLEASE post your questions / comments on this forum so that everyone can benefit. Thanks
~zelda180~
www.80TOONS.com
New functions_upload.php file to convert .flv files
I would like to first thank bplex for your input, a lot of your previous posts has helped me out when I was having trouble with this script. So thanks again.
As for the functions_upload.php file. I have uploaded the new file and I did test it and it converted the .flv file with the watermark with no issues. I have delete the code below
**REMEMBER TO BACKUP YOUR FILES**
Code:
if ($file_extn == 'flv' || $file_extn == 'mp4')
{
$log_text = "<h2>MOVING UPLOADED FLV: $video_src => $video_flv</h2>";
write_log($log_text, $log_file_name, $debug, 'html');
if (! copy($video_src, $video_flv))
{
$log_text = 'ERROR: moving uploaded file failed';
write_log($log_text, $log_file_name, $debug, 'html');
}
if ($file_extn == 'flv')
{
if (get_config('enable_flvtool') == 1)
{
$cmd_flvtool = $config['flvtool'] . ' -U ' . $video_flv;
$tmp = exec($cmd_flvtool, $exec_result);
$log_text = "<h2>Running flvtool2: $cmd_flvtool</h2>";
write_log($log_text, $log_file_name, $debug, 'html');
}
}
}
else
This tells vshare to skip the encoding process for .flv files and only insert the meta data in to the .flv file. Now vShare wil convert all .flv files and add the watermark to all uploaded videos.
Please let me know if this did or did not work. Thanks