On this page
DocsGuides
Blur a region
Blur rectangles of the picture, or the whole frame, to hide faces, plates or private data.
blur blurs up to 4 rectangles of the picture and leaves the rest sharp, or the whole frame.
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-private.mp4",
"blur": {
"strength": 20,
"regions": [
{
"x": 100,
"y": 600,
"width": 400,
"height": 200
}
]
}
}'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-private.mp4",
"blur": {
"strength": 20,
"regions": [
{
"x": 100,
"y": 600,
"width": 400,
"height": 200
}
]
}
}),
});
const job = await response.json();Copy failed. The text is selected; copy it with your keyboard.
ffmpeg \
-i https://example.com/talk.mp4 \
-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];[o0s0]split[o0r0a][o0r0b];[o0r0b]crop=400:200:100:600,boxblur=lr='min(20,min(w,h)/2-1)':cr='min(20,min(cw,ch)/2-1)'[o0r0c];[o0r0a][o0r0c]overlay=x=100:y=600[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-private.mp4Copy failed. The text is selected; copy it with your keyboard.
talk-private.mp4: a 400 by 200 pixel area, 100 pixels from the left and 600 from the top, blurred in every frame.
Regions use the pixels of the frame after resize. strength is 1 to 50. The rectangles are
fixed: following a moving face is not available.
The whole frame#
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-blurred.mp4",
"blur": {
"strength": 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-blurred.mp4",
"blur": {
"strength": 10
}
}),
});
const job = await response.json();Copy failed. The text is selected; copy it with your keyboard.
ffmpeg \
-i https://example.com/talk.mp4 \
-map 0:v:0 \
-vf "scale='min(trunc(iw/2)*2,min(7680,min(trunc(7680*iw/ih/2)*2,trunc(sqrt(33554432*iw/ih)/2)*2)))':-2,boxblur=lr='min(10,min(w,h)/2-1)':cr='min(10,min(cw,ch)/2-1)'" \
-c:v libx264 -preset veryfast -crf 23 -pix_fmt yuv420p \
-map "0:a:0?" \
-c:a aac -b:a 128k -movflags +faststart \
talk-blurred.mp4Copy failed. The text is selected; copy it with your keyboard.