Multimedia cloud processing
Basic concepts
When users in the multimedia cloud industry use BOS as a backend storage source server, they often have different usage scenarios combined with upper-level application logic. With the continuous evolution of user experience at the application layer, the real-time requirements for data processing, handling and access in multimedia cloud services are becoming increasingly high. Users hope to provide a more simplified way of use.
Baidu AI Cloud Object Storage (BOS) provides an innovative multimedia cloud processing API that supports uploading MP4-format files. The system automatically converts them to HLS format, enabling playback through M3U8-style players. This fully aligns with the "UGC upload - automatic processing - playback" workflow, simplifying previously complex video operations and processing logic, and accelerating application performance.
Multimedia cloud processing commands
Multimedia cloud files are much larger than image files, and their processing time is longer, usually at the second level. Therefore, BOS multimedia cloud processing commands adopt a write-time processing scheme that differs from the BOS Image Processing API. That is, the original multimedia cloud files are processed on demand when written to BOS, rather than being processed based on parameters defined when users read them.
The BOS multimedia cloud processing API is defined as follows:
- Format conversion parameter
| Parameter name | Abbreviation | Types | Value | Command description | Required or not |
|---|---|---|---|---|---|
| format | f | string | [hls] | Convert the video to a specified format | Yes |
| time | t | int | [6,600] | Segment duration, defaulting to 10 s | No |
- Persistent storage parameter
| Parameter name | Abbreviation | Types | Value | Command description | Required or not |
|---|---|---|---|---|---|
| object | o | string | - | An object name encoded with base64 is subject to the object length limit, i.e., it must not exceed 1,024 characters | Yes |
Request method
In the BOS POST API, parameters can be configured in the headers to achieve the transcapsulation and storage of multimedia cloud files uploaded via POST.
1POST /video.mp4 HTTP/1.1
2Content-Length: ContentLength
3Content-Type: ContentType
4x-bce-process: video/format,f_hls
Request example
Example of transcapsulation and storage
Repackage the video.mp4 file into HLS format and save the result in video/demo.hls.
1POST /video.mp4 HTTP/1.1
2Content-Length: ContentLength
3Content-Type: ContentType
4x-bce-process: video/format,f_hls|system/save,o_dmlkZW8vZGVtby5tM3U4
Rules and limitations
- Supported original audio/video format: mp4
- Supported target audio/video format: hls
- The size of the video supported for processing does not exceed 100 MB
- Currently, it is available in the regions of Beijing, Guangzhou, Suzhou and Baoding
- At present, it can only be used in the POST-style upload API of BOS
Currently, BOS multimedia cloud processing supports only the conversion of MP4 files to HLS files. In the future, BOS will expand its support to include more file types, transcoding, and additional features.
If you need more extensive processing capabilities in the short term and your application can tolerate relatively longer processing delays, please refer to Baidu AI Cloud’s Multimedia Cloud Transcoding (MCP) and Baidu AI Cloud Video On Demand (VOD) .
