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.

5 min readSume
All posts

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 x and y fractions; 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() and max() 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.

Tunable values in the inset graph (Sume video filter, read 2026-10-11)
ValueIn the graphEffect
Crop sizew=iw*0.3, h=ih*0.2Region that gets magnified
Crop positionx=iw*0.35, y=ih*0.4Where the region starts
Zoomscale w=iw*2.4Inset width relative to the crop
Borderpad +8, offset 4, whiteFrame around the inset
Placementx=W*0.04, y=H-h-H*0.04Bottom-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

All Media tools posts

Written by Sume