Search code examples
videotextffmpegcommandwatermark

How to add watermark to video. i.e. both png and text


I want to add a watermark to my video. I want to add both text and a png as watermark. I want to place text at the bottom of the image. I was able to place an image but I am not able to place both image and text.


Solution

  • Is simply, if you have the video with png watemark, now you have to put text in this new video, for example:

    base_video.mp4 with watemark png is called input_with_image.mp4

    ffmpeg -i input_with_image.mp4 -filter_complex "drawtext=text='Hi Usama Shakeel':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=24:fontcolor=white" -c:a copy -strict -2 output.mp4
    

    solution:

    ADD PNG AND TEXT top left side

     ffmpeg -i video.mp4 -i logo.png -filter_complex "[0:v][1:v]overlay=5:5,drawtext=text=:x=(w-0)/8:y=(h-4)/10:fontsize=64:fontcolor=white:thithi" -c:a copy -movflags +faststart output.mp4