Home/Video thumbnail picker
Video thumbnail picker

Let your users pick and crop the perfect thumbnail

Drop in one element and your users choose a video's thumbnail from its frames, any moment of it, or their own image, then crop it to the shape you need. Or build your own picker on the same API.

What the thumbnail picker does

<video-piper-thumbnail> embeds the same thumbnail picker that the Video Piper app uses. Your users start from one of the video's frames, any moment of it (they play or scrub the video and press Use this frame), or their own image. Then they crop it: drag the box to move it, drag its corners to resize it, and lock it to the video's shape, 16:9, square or 4:5, or leave it free, with a live preview of the result.

Pressing Save makes it the video's poster everywhere: posterUrl in status and listings, webhooks, <video-piper> and the embed page. Cropping happens in the browser, so saving is instant, and big photos are resized for you.

The thumbnail token model

Like the recorder and the editor, the picker never sees your API key. Your server makes a thumbnail token for the one video the current user may change:

// 1. Your server (Node.js): an endpoint that makes a token (POST /thumbnail-tokens with your API key)
app.post("/api/thumbnail-token", async (req, res) => {
  const videoId = req.query.video;
  if (!(await mayChangeThumbnail(req.user.id, videoId))) return res.status(403).end();   // your own rule
  const r = await fetch(`${API}/thumbnail-tokens`, { method: "POST",
    headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
    body: JSON.stringify({ videoId, expiresIn: 900 }) });
  res.status(r.status).json(await r.json());   // { token: "vpt_…", expiresAt, videoId }
});
<!-- 2. Your page: the picker asks token-url for a token when it loads -->
<script src="https://videopiper.com/thumbnail/thumbnail.js"></script>
<video-piper-thumbnail token-url="/api/thumbnail-token?video=VIDEO_ID"></video-piper-thumbnail>
<script>
  document.querySelector("video-piper-thumbnail")
    .addEventListener("vp-thumbnail-saved", (e) => console.log("new poster", e.detail.posterUrl));
</script>

Both come from the documentation, which also has an ASP.NET Core endpoint. The token body takes videoId (one of your finished videos) and expiresIn (60 to 86400 seconds, default 900).

What a token can and can't do

Can

Read that video's frames, current thumbnail, length and a signed playback link, and save a new thumbnail as often as it likes until it expires.

Can't

Touch any other video, list or delete videos, upload, read your account or make tokens. Those answer 403 THUMBNAIL_TOKEN_SCOPE.

Is fixed by you

Which video it is for, and for how long. Your own rule decides who gets a token at all.

Or build your own picker

The same choices are plain API calls. GET /videos/{id}/thumbnails lists the frames, the current choice and the video's length. POST /videos/{id}/thumbnail takes one of:

{"candidate": 2}                                   // one of the frames
{"image": "<base64>", "contentType": "image/png"}  // your own JPEG or PNG, up to 2 MB
{"time": 42.5}                                     // any moment of the video
{"time": 42.5, "crop": {"x": 0.21875, "y": 0, "w": 0.5625, "h": 1}}   // ...cropped to the middle square

A frame or image without a crop applies at once. A moment or a crop answers 202 and is made by a short job, usually within a minute; the list shows it as processing, then ready.

Attributes, events and styling

Your account page has these snippets filled in with your addresses, and a Try the thumbnail picker button that makes a 15-minute token for your latest finished video.

Which plans include thumbnail choices

Choosing and cropping thumbnails, the picker component and its thumbnail tokens work on every plan, at no extra cost.

PlanPriceProcessing minutesMax qualityThumbnail picker
Free$0/mo30720pIncluded
Starter$49/mo4001080pIncluded
Pro$199/mo1,5004KIncluded
Scale$699/mo6,0004KIncluded

Usage beyond a paid plan is billed at $0.09 per processing minute, $0.15 per GB-month of storage and $0.55 per GB of delivery. Full details are on the pricing page.

In the documentation

Frequently asked questions

What can my users choose from?

The automatic poster and six more frames spread through the video, any moment of it (they scrub the video and press Use this frame), or their own image in any common format. Then they crop it to the video's shape, 16:9, square, 4:5 or freely, with a live preview.

How does it keep my API key safe?

Your server makes a thumbnail token for one video and the page uses that. The browser can only read that video's thumbnail choices and save a new one. Anything else answers 403 THUMBNAIL_TOKEN_SCOPE, and any other video 404.

Can I build my own picker instead?

Yes. POST /videos/{id}/thumbnail takes a candidate frame, your own image, or any moment with time, each optionally with a crop given as fractions of the picture. A moment or a crop is made by a short job and reported as processing, then ready.

Where does the new thumbnail show up?

Everywhere the video's poster does: posterUrl in status and listings, webhooks, the player and the embed page. People can change it again whenever they like.

How big is the script?

thumbnail.js includes the picker itself, about 75 KB compressed, so load it only on the pages that use it.

Start building with Video Piper

Create a free account with just your email, grab an API key and make your first request in minutes.