Guide

Add a watermark to a video with an API

How do I overlay a logo or watermark on a video over an API?

Send the video and the logo as two inputs and combine them with the overlay filter. W/H are the video's dimensions and w/h the logo's, so overlay=W-w-24:H-h-24 pins it 24px from the bottom-right corner.

The ffmpeg command

What you would run locally, for reference.

ffmpeg -i input.mp4 -i logo.png \
  -filter_complex "[0:v][1:v]overlay=W-w-24:H-h-24" \
  -c:a copy \
  output.mp4

The API request

The same flags, sent as JSON. Authenticate with Authorization: Token <your-api-token>.

POST /api/ffmpeg/job/
{
  "global_options": [
    "-y"
  ],
  "inputs": [
    {
      "input_source": "https://example.com/input.mp4"
    },
    {
      "input_source": "https://example.com/logo.png"
    }
  ],
  "outputs": [
    {
      "filename": "output.mp4",
      "options": [
        "-filter_complex",
        "[0:v][1:v]overlay=W-w-24:H-h-24",
        "-c:a",
        "copy"
      ]
    }
  ]
}

Worth knowing

  • A PNG with an alpha channel keeps its transparency through overlay. A JPEG logo will show its rectangle.
  • Swap the coordinates for another corner: 24:24 is top-left, (W-w)/2:(H-h)/2 centres it.

What it costs

Jobs bill in processing seconds — the CPU time this one actually uses — with a floor of 25 seconds per GB pulled out of storage to run it, so a stream-copy still counts. Uploading the output and downloading it afterwards are free. See the plans.

Related guides

Start free API reference

Ask me for anything

QuickFFmpeg is early and plenty is still missing. Tell me what you need and it goes straight to the top of my list.

This arrives anonymously. Log in first if you'd like an answer.