Only 12 left badge over a product clip: compose overlay, $0.02

A low-stock badge on a product clip is $0.02 per variant with Sume compose overlay. Set position, width_ratio and margin_ratio; re-render as stock drops.

5 min readSume
All posts

How do I put 'Only 12 left' on a product clip?

Use Timeline compose with operation: "overlay". The still is your badge image, the video is your product clip, and both must already be on media.sume.com; import external files first with POST /v1/media-imports. The overlay is laid out by position (top, center or bottom), width_ratio (0.05 to 1, default 0.9) and margin_ratio (0 to 0.45 of the height, default 0.05).

Compose is a flat $0.02 per job, and an Idempotency-Key is required.

curl -X POST https://api.sume.com/v1/timeline-1.0/compose \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: sku1001-badge-12-left" \
  -d '{"operation":"overlay",
       "image":{"url":"https://media.sume.com/artifacts/artf_demo/only-12.png"},
       "video":{"url":"https://media.sume.com/artifacts/artf_demo/product.mp4"},
       "layout":{"position":"bottom","width_ratio":0.5,"margin_ratio":0.08},
       "output":{"width":720,"height":1280}}'

What does a stock countdown cost?

Each count is its own badge image and its own compose job. Badges for 12, 7 and 3 left are three compose jobs, $0.06 in total, on top of however you make the three images. A badge hosted elsewhere needs a media import ($0.15 each) before compose will accept it.

Cost of three low-stock variants from one product clip, Sume docs prices
StepCountPriceSubtotal
Compose overlay3$0.02$0.06
Media import (if the badge is hosted elsewhere)3$0.15$0.45
Total, badges already on media.sume.com$0.06
Total, badges imported$0.51

What does the result look like?

The output length always comes from the video layer, up to 300 seconds, and the badge shows for the whole clip. The result is a timeline_compose job with video_url and duration_seconds. If you ask for more length than the clip has, the job clamps with a compose_duration_clamped_to_source warning; see that warning explained.

A badge that shows a number needs a legible plate. Keep width_ratio near 0.5 on a 9:16 frame so it does not cover the product.

When should I re-render?

Re-render when the number crosses a threshold you chose, such as 12, 5 and 1, not on every sale. When stock reaches zero, switch to the sold-out message in the back-in-stock post.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume