Extract frames from video and animations
frame extracts a single frame from a video or animated image, which is commonly used to generate covers, thumbnails, and previews. You can apply any other image parameter to the extracted frame, including resize, crop, watermark, and format conversion.
Parameters
| Parameter | Source type | Meaning | Values |
|---|---|---|---|
frame | Video | Timestamp, in milliseconds | Integer, 0 or greater |
frame | Animated image | Frame number, starting from 1 | Integer, 1 or greater |
frame=auto | Video | Automatic cover frame selection | auto |
Video
frame=0: the first frameframe=5000: the frame at 5 secondsframe=60000: the frame at 1 minute
Frames captured from HDR video (including Dolby Vision) keep HDR by default. See HDR images and video.
Animated images
Supported formats: GIF, animated WebP, APNG, and animated AVIF.
frame=1: the first frameframe=n: the nth frame
If the specified frame number exceeds the actual number of frames, the last frame is returned.
Automatic cover frame selection
frame=auto automatically picks a frame from the video that works well as a cover: it avoids black frames, white flashes, and solid-color frames, and favors a sharp, colorful, well-composed frame.
- The selected timestamp is returned in the
x-coreix-frame-timeresponse header, in milliseconds. - If frame selection fails, the first frame is returned.
To extract a segment rather than a single frame (clipping video, converting video to an animation, or extracting part of an animated image), use the range syntax of frame. See Clip video and convert to animations.
Examples
Source video: https://demo.bitiful.com/hdr-img/rainbow.mov
Capture the frame at 4950 ms and resize it to 1000 px wide: https://demo.bitiful.com/hdr-img/rainbow.mov? frame=4950 & w=1000
Automatic cover frame selection:
https://demo.bitiful.com/hdr-img/rainbow.mov?frame=auto&w=1000