LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-25-2011, 11:56 PM   #1
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Rep: Reputation: 0
Question ffmpeg - how to add watermark to a video via shell


Hello!
I'm trying to find out how to add watermark to a video using a ffmpeg via console, because I have to do it quick.
There is tutorial on youtube (other forums use also this video tutorial) for this but there is a small problem - in ffmpeg 6.1 there is no more vhook subsystem which is used in tutorial...
I don't know what to do.
Thank you a lot!
 
Old 02-26-2011, 04:46 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Code:
ffmpeg -y -i 'inputFile.mpg' -vhook '/usr/lib/vhook/watermark.so -f /home/user/logo.gif'
This is just a general command. Also make note of the vhook argument, as the path to watermark.so might be different for you.

If ffmpeg 6.1 doesn't have vhook, you will need to change to a different version of ffmpeg.

Cheers,

Josh

Last edited by corp769; 02-26-2011 at 04:47 PM.
 
1 members found this post helpful.
Old 02-27-2011, 03:34 AM   #3
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
It is only thing I can do I guess...
Thank you.
 
Old 02-27-2011, 10:05 AM   #4
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
@Josh
Unfortunatelly I couldn't manage to download previous version of ffmpeg
But after more searching I found that vhook is replaced by libavfilter and on http://www.ffmpeg.org/libavfilter.html there is explanation how to add watermark to a video.
I'll try that.
Thank you anyway
 
Old 02-27-2011, 10:05 AM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
You are greatly welcome!

Cheers,

Josh
 
Old 03-08-2011, 05:36 PM   #6
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
I haven't managed to add watermark to video yet. There is some error, and I can't find answer...

When I type a shell command
Code:
ffmpeg -i input.avi -vf "movie=logo.png [logo]; [in][logo] overlay=main_w:main_h [out]" output.avi
there is an error message
Code:
FFmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jan 21 2011 19:19:43 with gcc 4.5.0 20100604 [gcc-4_5-branch revision 160292]
  configuration: --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib --shlibdir=/usr/lib --enable-pthreads --enable-shared --enable-avfilter --disable-static --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-postproc --enable-shared --enable-libdc1394 --enable-libtheora --enable-libschroedinger --enable-libvpx --enable-gpl --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
  libavutil    50. 36. 0 / 50. 36. 0
  libavcore     0. 16. 1 /  0. 16. 0
  libavcodec   52.108. 0 / 52.108. 0
  libavformat  52. 94. 0 / 52. 92. 0
  libavdevice  52.  2. 3 / 52.  2. 3
  libavfilter   1. 74. 0 /  1. 74. 0
  libswscale    0. 12. 0 /  0. 12. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : MEncoder dev-SVN-r32749-4.5-openSUSE Linux 11.3 (i686)-Packman
  Duration: 00:02:26.76, start: 0.000000, bitrate: 4864 kb/s
    Stream #0.0: Video: mjpeg, yuv420p, 512x384, 25 tbr, 25 tbn, 25 tbc
    Stream #0.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
ffmpeg: relocation error: ffmpeg: symbol av_metadata_copy, version LIBAVFORMAT_52 not defined in file libavformat.so.52 with link time reference
I don't know what to do next...
Has anyone any ideas?

P.S.
I found, with google, one C code (or program) and junk...
Also found Ubuntu forums on how to install and use ffmpeg...

Last edited by HajdukJanko; 03-08-2011 at 05:48 PM.
 
Old 03-08-2011, 06:03 PM   #7
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
Also I've found here that it has something to do with VLC player, but I can't figure out how to fix error...

Last edited by HajdukJanko; 03-08-2011 at 06:07 PM.
 
Old 03-08-2011, 07:04 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Came across this...

http://hack2live.blogspot.com/2009/09/blog-post_21.html

Maybe that would be better for you?
 
Old 03-09-2011, 05:54 AM   #9
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
PROBLEM SOLVED!!!

I have had ffmpeg libraries from different repositories, and have had to reinstall all to be from one and now everything is working.

Thanks to all with good will to help!

P.S.
VLC is still working well but ffmpeg isn't from their repository.
 
Old 03-09-2011, 05:55 AM   #10
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
Special thanks to corp769
 
Old 03-09-2011, 05:58 AM   #11
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Haha thanks man.... You can give me rep if I helped out that much, that's about it.

Cheers,

Josh
 
Old 03-09-2011, 04:06 PM   #12
wrybread
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Rep: Reputation: 1
So what was the command that worked for you?

I'm looking for this too. If you get help with an issue like this, its usually nice to post the eventual solution.
 
Old 03-16-2011, 03:43 PM   #13
HajdukJanko
Member
 
Registered: Sep 2009
Distribution: openSuSE 12.2 LXDE
Posts: 47

Original Poster
Rep: Reputation: 0
I'm sorry I forgot that command above
Code:
ffmpeg -i input.avi -vf "movie=logo.png [logo]; [in][logo] overlay=main_w:main_h [out]" output.avi
won't work, because you are trying to add picture as size of the video.


So it goes like that...

1.You'll need video size. You can get it be typing
Code:
 mplayer input.avi
2.Make a picture of your logo with transparent background with size of a video, for example logo.png
3.Than type
Code:
ffmpeg -sameq -i input.avi -vf "movie=logo.png [logo]; [in][logo] overlay=main_w-overlay_w:main_h-overlay_h [out]" output.avi
And that's it. You will have your video with your logo. Also in this case my video and logo are in the same directory.

Cheers

P.S.
Only difference is that you have to subtract overlay_w from main_w (also for height), or ffmpeg will try to make file quadruple (twice height and twice width) size of originally video file, and of course that's not gonna happen...

Last edited by HajdukJanko; 03-17-2011 at 06:54 PM.
 
Old 08-31-2011, 08:30 AM   #14
aliraj
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
Code:
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 17 2011 00:51:29 with gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
THIS IS MY FFMPEG, I JUST WANT TO ASK HOW TO libavfilter activated with movie and overlay filters on?
ANY HELP WILL REALLY APRICIATED
 
Old 08-31-2011, 12:13 PM   #15
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Quote:
Originally Posted by aliraj View Post
Code:
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 17 2011 00:51:29 with gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
  configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.74. 0 /  1.74. 0
  libswscale     0.12. 0 /  0.12. 0
THIS IS MY FFMPEG, I JUST WANT TO ASK HOW TO libavfilter activated with movie and overlay filters on?
ANY HELP WILL REALLY APRICIATED
Hello,

Please don't thread jack someone else's thread, let alone digging up an old thread. If you have an issue, please search on these forums first, and if you can not find what you need, then create a new thread with your problem.

Cheers,

Josh
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FFmpeg video overlay Nemus Linux - Software 3 11-02-2011 08:22 AM
ffmpeg, problems when cropping video havok1977 Linux - Software 4 02-20-2011 08:39 AM
[SOLVED] FFMPEG video converting, VERY pixelated Helstedxd Linux - Newbie 4 01-20-2011 01:49 PM
need shell script in ffmpeg yajur Programming 3 09-03-2008 08:30 AM
i want to sync my video using ffmpeg Jeon, Chang-Min Linux - Software 0 11-17-2005 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration