Add a zoomed detail inset to a video: crop, scale, overlay
Show a magnified product detail in the corner of the same clip using one Sume video-filter graph: split, crop, scale 2.4x, white border, overlay. $0.02.

To put a magnified detail in the corner of the same video, send Sume's video filter a graph that splits the clip, crops a region from one copy, scales it up, adds a white border and overlays it back: split[a][b];[b]crop=w=iw*0.3:h=ih*0.2:x=iw*0.35:y=ih*0.4,scale=w=iw*2.4:h=-2,pad=w=iw+8:h=ih+8:x=4:y=4:color=white[c];[a][c]overlay=x=W*0.04:y=H-h-H*0.04. It costs $0.02 per encode and the check is free.
This is the tool for a callout of a label, a stitch or a button on a clip you already have, for instance a motion clip animated from a Nano Banana 2.1 product still. Timeline compose cannot do it: compose layers one still and one video, so a second view of the same video has to be built inside video filter.
How does the graph work?
Video filter takes filters only; the server supplies the input, so the graph starts at split and ends at overlay with no labels at either end. split[a][b] gives a full-frame branch and a branch to cut up.
On branch [b], crop keeps 30 percent of the width and 20 percent of the height, starting 35 percent across and 40 percent down. Inside the graph those are expressions on iw and ih, the input size of that filter. scale=w=iw*2.4:h=-2 enlarges the crop 2.4 times and keeps the aspect with an even height. pad adds a 4 pixel white frame on every side. Finally overlay places [c] on [a]; W and H are the main frame, h is the inset height, so the inset sits 4 percent from the left and bottom edges.
- The inset width is 0.3 x 2.4 = 72 percent of the frame width, plus the border. Keep crop width times scale under about 0.8 so it does not cover the frame.
- Move the crop with
xandyfractions; the inset shows the same region for the whole clip, so pick a spot where the subject stays still. - Do not use commas inside an expression: Sume refuses backslash escapes, so
min()andmax()calls are out. The recipe needs none.
What does the check return?
Run the check route with the same body. It lists the compiled filter names (split, crop, scale, pad, overlay) and tells you whether to submit or fix the program.
A source that is HDR or not a YUV format fails closed, so convert or regenerate that clip first.
curl -X POST https://api.sume.com/v1/video-filter/check \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/clip.mp4",
"filtergraph": "split[a][b];[b]crop=w=iw*0.3:h=ih*0.2:x=iw*0.35:y=ih*0.4,scale=w=iw*2.4:h=-2,pad=w=iw+8:h=ih+8:x=4:y=4:color=white[c];[a][c]overlay=x=W*0.04:y=H-h-H*0.04"
}'What stays fixed and what can you tune?
Every value is a fraction, so the same graph works on a 480p or 720p source from the same model without edits.
| Value | In the graph | Effect |
|---|---|---|
| Crop size | w=iw*0.3, h=ih*0.2 | Region that gets magnified |
| Crop position | x=iw*0.35, y=ih*0.4 | Where the region starts |
| Zoom | scale w=iw*2.4 | Inset width relative to the crop |
| Border | pad +8, offset 4, white | Frame around the inset |
| Placement | x=W*0.04, y=H-h-H*0.04 | Bottom-left corner |
Where does it fit in the pipeline?
Run the inset on the clip before assembly and place the result in a Timeline slot, then add captions last so they are not magnified or covered. The inset is part of the picture, so the original clip is still available if you want a version without it.
Sources
Related posts
More in Media tools
- How to assemble a long-form video with the Timeline 1.0 API
Timeline 1.0 renders one audio spine plus 1 to 200 ordered video slots into one MP4. Every URL must be Sume-hosted; the plan preflight is unbilled.
- How to burn captions onto a video with the Sume API
Send a public HTTPS video URL to POST /v1/video-captions and get a job-backed captioned video, timed by speech-to-text or by text you supply.
- How to extract frames from a video with the Sume API
POST /v1/video-frames returns stills at the times you name from one Sume-hosted clip, as durable images at source size. The call is unbilled.
- How to use Sume's Timeline compose and Timeline audio APIs
Timeline compose puts one still and one video in the same frame as a new MP4. Timeline audio joins or splits Sume-hosted audio into reusable files.
Written by Sume