• facebook
  • twitter
  • linkedin

Read time: 4 minutes

Watermark helps you to protect your copyright as it discourages the reproduction, sharing, circulation, publishing, and exploitation of your work without your consent or permission. It also helps you to create, give identification, disperse, and protect your brand. In the present blog, we are going to discuss how to add a watermark to your video.

We shall discuss how to add a watermark to videos.

How to add a watermark to a video using FFMPEG commands?

You can add a watermark to your video using the FFmpeg command-line utility you can download the FFmpeg utility from the link ‘Builds – CODEX FFMPEG @ gyan.dev’

Commands to add watermark differ according to positions, viz. top left or right, bottom left or right, and center of the screen.

Different commands for different positions on the video screen are given below:

All the commands consist of variables and extensions, which may vary. We have listed them for you:

Variables:
  • ‘inputvideo’ – replace the name of the input video.
  • ‘watermarklogo.png’ – replace the name of the watermark file with extensions like.png, .jpeg, .jpg, etc.
  • ‘outputvideo.flv’– replace ‘flv’ with mpeg, mp4, etc.

And the FFmpeg commands to add a watermark vary according to the position on the screen.

  • Top left corner
    ffmpeg –i inputvideo.avi -vf “movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:10 [out]” outputvideo.flv
  • Top right corner
    ffmpeg –i inputvideo.avi -vf “movie=watermarklogo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]” outputvideo.flv
  • Bottom left corner
    ffmpeg –i inputvideo.avi -vf “movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:main_h-overlay_h-10 [out]” outputvideo.flv
  • Bottom right corner
    ffmpeg –i inputvideo.avi -vf “movie=watermarklogo.png [watermark]; [in][watermark] overlay=(main_w-overlay_w-10)/2:(main_h-overlay_h-10)/2 [out]” outputvideo.flv
  • Centre
    ffmpeg -i input.mp4 -i logo.png -filter_complex “overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2” -codec:a copy outputvideo.flv

The process of executing command in FFMPEG

The process of executing command is simple, consisting of 3 basic steps:
steps
Before you start the process, create a new folder to which you will keep adding requisite items as given in the following steps. Also, give a name to this folder.

  1. Create a logo/image file (formats can be .BMP,.JPEG,.PNG etc.) and put it in the new folder mentioned above. Name this logo file.
  2. Copy the source video to which you wish to add a watermark and put it in the folder mentioned above. Name this video file.
  3. Copy the ffmpeg.exe file to the new folder mentioned above.
  4. First, decide which position you wish to add a watermark to, then select the command for that position as mentioned in the table above.
    • To make the process easier, copy the desired command (select from the first table) on the Notepad and edit/modify it by editing variables as explained above.
    • Press Window Key and R together. This will open the Run box.
    • Type ‘cmd’ and press ‘enter.’ This will open the command window.
    • Go back to the new folder you have created. Copy the path of this folder.
    • Return to the Command window; at the blinking white cursor, type ‘cd.’
    • Press ‘space’ and paste the path of the folder.
    • Press’ Enter.’
    • To run the next command, go to Notepad and copy the edited position command.
    • Go back to the command window, and paste the position command copied in step (h) at the cursor. Paste this path. Press’ Enter.’
    • Let the process complete.
    • Go back to your folder, where you will find the output video.
    • Here, you can find the video with the watermark.

Can we add a watermark to a corrupt video?

You cannot add a watermark to a video when it is corrupt. However, you can repair the video using Kernel Video Repair and then add the watermark to it. It’s a simple tool to repair corrupt video files of all formats. It fixes almost all video errors and makes them accessible to different video players. You can try the tool’s trial version to learn more about it.

Conclusion

In the present blog, we learned how to add a watermark to your video. However, it is not possible to add a watermark to a corrupt video file. But you can repair the corrupt video and then add a watermark to it. For this, you can try a professional video repair tool.

Related Posts