On this page
DocsGuides
Watermark
Place a logo or image over every frame, at the position, size, opacity and time you choose.
overlays places an image over every frame: a logo, a watermark, a badge. A PNG with transparency
keeps its edges.
The request#
curl "$VIDEXO_API_URL/v1/transcode" \
-H "Authorization: Bearer $VIDEXO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "https://example.com/talk.mp4",
"filename": "talk-branded.mp4",
"extra_inputs": {
"logo": "https://example.com/logo.png"
},
"overlays": [
{
"input": "logo",
"position": "bottom-right",
"margin": 24,
"width": 160
}
]
}'Copy failed. The text is selected; copy it with your keyboard.
const response = await fetch(`${process.env.VIDEXO_API_URL}/v1/transcode`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VIDEXO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": "https://example.com/talk.mp4",
"filename": "talk-branded.mp4",
"extra_inputs": {
"logo": "https://example.com/logo.png"
},
"overlays": [
{
"input": "logo",
"position": "bottom-right",
"margin": 24,
"width": 160
}
]
}),
});
const job = await response.json();Copy failed. The text is selected; copy it with your keyboard.
ffmpeg \
-i https://example.com/talk.mp4 \
-i https://example.com/logo.png \
-filter_complex "[0:v:0]scale='min(trunc(iw/2)*2,min(7680,min(trunc(7680*iw/ih/2)*2,trunc(sqrt(33554432*iw/ih)/2)*2)))':-2[o0s0];[1:v]scale=160:7680:force_original_aspect_ratio=decrease,tpad=stop=-1:stop_mode=clone[o0l0];[o0s0][o0l0]overlay=x=W-w-24:y=H-h-24:shortest=1[o0s1]" \
-map "[o0s1]" \
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
-map "0:a:0?" \
-c:a aac -b:a 128k -movflags +faststart \
talk-branded.mp4Copy failed. The text is selected; copy it with your keyboard.
talk-branded.mp4: the logo, 160 pixels wide, 24 pixels in from the bottom right corner.
Opacity and timing#
opacity fades the overlay; start and end show it only between two times.
curl "$VIDEXO_API_URL/v1/transcode" \
-H "Authorization: Bearer $VIDEXO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "https://example.com/talk.mp4",
"filename": "talk-marked.mp4",
"extra_inputs": {
"logo": "https://example.com/logo.png"
},
"overlays": [
{
"input": "logo",
"position": "top-left",
"margin": 16,
"width": 120,
"opacity": 0.6,
"start": 0,
"end": 10
}
]
}'Copy failed. The text is selected; copy it with your keyboard.
const response = await fetch(`${process.env.VIDEXO_API_URL}/v1/transcode`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.VIDEXO_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"input": "https://example.com/talk.mp4",
"filename": "talk-marked.mp4",
"extra_inputs": {
"logo": "https://example.com/logo.png"
},
"overlays": [
{
"input": "logo",
"position": "top-left",
"margin": 16,
"width": 120,
"opacity": 0.6,
"start": 0,
"end": 10
}
]
}),
});
const job = await response.json();Copy failed. The text is selected; copy it with your keyboard.
ffmpeg \
-i https://example.com/talk.mp4 \
-i https://example.com/logo.png \
-filter_complex "[0:v:0]scale='min(trunc(iw/2)*2,min(7680,min(trunc(7680*iw/ih/2)*2,trunc(sqrt(33554432*iw/ih)/2)*2)))':-2[o0s0];[1:v]scale=120:7680:force_original_aspect_ratio=decrease,format=rgba,colorchannelmixer=aa=0.6,tpad=stop=-1:stop_mode=clone[o0l0];[o0s0][o0l0]overlay=x=16:y=16:shortest=1:enable='between(t,0,10)'[o0s1]" \
-map "[o0s1]" \
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
-map "0:a:0?" \
-c:a aac -b:a 128k -movflags +faststart \
talk-marked.mp4Copy failed. The text is selected; copy it with your keyboard.
Up to 4 overlays, drawn in order. Positions are the corners, the edges and center; margin is
the distance from the edges the overlay touches. Images, thumbnails and GIFs take overlays too.