How to add 2 watermarks to one image using ffmpeg. This is the command I am using for adding single watermark
ffmpeg -i actual-image.jpg -i watermark.png -filter_complex "overlay=5:5" output.jpg
But i am not able to add 2 arguments for this. Thanks for help in advance
Apply 2 overlays. The 2nd overlay will use the result of the first overlay as its base input.
ffmpeg -i actual-image.jpg -i watermark1.png -i watermark2.png -filter_complex "[0][1]overlay=5:5[vid1];[vid1][2]overlay=300:300" output.jpg
Related
ffmpeg -i tmp3.mp4 -i sucai/s4.jpg -i sucai/s1.mp4 -filter_complex "[1]scale=500:500[b];[0][b]overlay=x=0:y=0:enable='between(t,0,5)',overlay=x=0:y=0:enable='between(t,8,15)'" o.mp4 -y
This command can only process the first inserted picture, and will not work for the second one.
could you help me?
thank you for your help
Add another scale, use ; instead of , to join non-linear sets of filters, and consider adding shortest=1 to the last overlay:
ffmpeg -i tmp3.mp4 -i sucai/s4.jpg -i sucai/s1.mp4 -filter_complex "[1]scale=500:500[b];[2]scale=500:500[c];[0][b]overlay=x=0:y=0:enable='between(t,0,5)'[bg];[bg][c]overlay=x=0:y=0:enable='between(t,8,15)':shortest=1" o.mp4
Is there some way to use libav/avconv to duplicate the effect of the tile filter in FFMPEG?
I'm trying to create a strip of images from left to right with one image for every ten seconds of video input.
My plan is to first generate the images and then create the image strip. Preferably I want to use libav over ffmpeg. So far I have created this:
avconv -i video.mp4 -vf scale=320:-1,fps=1/10 -q:v 6 img%03d.jpg
which creates the images. But then I only know how create the image with ffmpeg using:
ffmpeg -i img%03d.jpg -filter_complex tile=6x1 output.jpg
So if anyone has any tips on how to rewrite the just the second or both commands to use avconv I welcome any advise :)
As libav/avconv did not have any filters supporting my requirements in any easy way switching to a static build of ffmpeg was the simplest solution.
The commands then became:
ffmpeg -i video.mp4 -vf scale=320:-1,fps=1/10 -q:v 6 img%03d.jpg
and
ffmpeg -i img%03d.jpg -filter_complex tile=6x1 output.jpg
How am I supposed to add two transition animations to the same image in the video with ffmpeg command? I want the image to slide from left to right and after a while back from right to left... This command is for left to right
ffmpeg -i input.mp4 -i image.png -filter_complex "[0:v][1:v]overlay=x='min(-1.5*w+5*w*t,5)':y=H/2-h/2'" -y output.mp4
There are two methods to do this. One is to provide a clipped oscillating function, similar to the expression for x used in the drawtext filter here.
The other method is use a conditional expression, shown below.
ffmpeg -i input.mp4 -i image.png
-filter_complex
"[0:v][1:v]overlay=x='if(lt(t,8),min(-1.5*w+5*w*t,5),5-5*w*(t-8))':y=H/2-h/2'"
-y output.mp4
Here's the slide out starts at t=8s.
I know it’s possible to get a part of a file using the command:
ffmpeg -ss 00:02:00.000 -i input.mp4" -t 00:00:05.000 out.mp4
But is it possible to combine multiple videos with text and other effects?
I want to create a output from the following
File1.mp4:
Read from 00:02:00.000 to 00:02:05.000
File2.mp4
Read from 00:00:00.000 to 00:01:30.000
Insert overlay image “logo.png” for 20 seconds
File3.mp4
Insert the whole file
Insert text from 00:00:10.000 to 00:00:30.000
It can be done with FFmpeg, but it isn't really an 'editor' so the command will get long, unwieldy and prone to execution errors the more the number of input clips and effects you apply.
That said, one way to do this is using the concat filter.
ffmpeg -i file1.mp4 -i file2.mp4 -i file3.mp4 -loop 1 -t 20 -i logo.png \
-filter_complex "[0:v]trim=120:125,setpts=PTS-STARTPTS[v1];
[1:v]trim=duration=90,setpts=PTS-STARTPTS[vt2];
[vt2][3:v]overlay=eof_action=pass[v2];
[2:v]drawtext=enable='between(t,10,30)':fontfile=font.ttf:text='Hello World'[v3];
[0:a]atrim=120:125,asetpts=PTS-STARTPTS[a1];
[1:a]trim=duration=90,setpts=PTS-STARTPTS[a2];
[v1][a1][v2][a2][v3][2:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
I haven't specified any encoding parameters like codec or bitrate..etc. Assuming you're familiar with those. Also, haven't specified arguments for overlay or drawtext like position..etc. Consult the documentation for a guide to those.
Hi everyone,
I want to add a watermark to a video use a picture.
here is the problem
and this is my command:
c:\ffmpeg.exe -y -i c:\ffmpeg\input\walk.mp4 -acodec copy -b 300k -vf "movie=w1.jpg [watermark];[in][watermark] overlay=5:5 [out]" c:\ffmpeg\output\walk.mp4
What am I doing wrong?
You can use the overlay filter, but first you need to use a recent build because the version you are using is considered to be absolutely ancient due to how active the FFmpeg project is. You can get builds for Windows at Zeranoe FFmpeg builds.
Now that you are not using a graybeard ffmpeg here is the most basic example:
ffmpeg -i background.avi -i watermark.jpg -filter_complex overlay output.mp4
The overlay filter documentation will show how to position the watermark. This example will place the watermark 10 pixels from the bottom right corner of the main video and copy your audio as in your example:
ffmpeg -i background.avi -i watermark.jpg -filter_complex overlay=main_w-overlay_w-10:main_h-overlay_h-10 -codec:a copy output.mp4