Video frame capture
Updated at:2025-11-03
Basic concepts
Baidu AI Cloud Object Storage (BOS) provides a brand-new video frame capture API in the industry, supporting capturing video files stored in BOS by setting url parameters.
Note
- Video frame capture was officially commercialized on April 1, 2022. For billing details, see BOS Price Description -> Data Processing -> Video Frame Capture.
Video frame capture command
Compared to image files, video files are much larger and require more processing time, typically in the range of a few seconds.
- Operation category: video
- Operation name: snapshot
The BOS video processing API is defined as follows:
- Parameter description
| Parameter name | Abbreviation | Types | Value | Command description | Required or not |
|---|---|---|---|---|---|
| time | t | int | Within the video duration | Frame capture time, in milliseconds | Yes |
| format | f | string | [jpg,png,bmp,gif,tif] | Output image format | No |
| width | w | int | [0,4096] | Specify screenshot width | No |
| height | h | int | [0,4096] | Specify screenshot height | No |
| auto-rotate | ar | string | [90,180,270,auto] | Specify the rotation angle. If set to "auto", the video will rotate automatically based on its metadata | No |
| mode | m | string | fast | Screenshot type. If set to fast, it captures the nearest keyframe at the time point | No |
Video frame capture download
- Screenshot download example
Video frame capture and storage to BOS
- BOS transfer example
Request example
- Capture the video content at 7s using default mode. By default, the output format is jpg, and the width and height are those of the original video
The processed URL is: 
- Use the keyframe mode to capture the 7-second mark of the video, outputting the image in PNG format with a width of 800, height of 600, and a rotation of 90 degrees.
The processed URL is: 
Rules and limitations
- Currently, it is only available in Beijing, Suzhou, Guangzhou and Baoding
- Currently, only the mode of capturing by adding URL parameter on the page is supported
- The maximum supported video size for frame capture is 10G. Private object capture is supported by adding authorization signature to URL parameters, generated via IAM tool. Link is as follows: https://cloud.baidu.com/signature/index.html
