百度智能云

All Product Document

          Object Storage

          Multimedia Processing Interface

          Basic Concept

          When users use BOS as the back-end storage source station in the multimedia industry, there are often different usage scenarios by combining with the upper business logic. With the continuous evolution of the user experience in the business layer, the multimedia service has higher and higher requirements for real-time data processing and access and hopes to provide a more simplified way of use.

          Baidu AI Cloud BOS provides a new multimedia processing API in the industry, which supports the file upload in the MP4 format. The system automatically saves the file in the HLS format for reading with the m3u8 style player. It fully meets the usage process of UGC upload - automatic processing - playback, eliminates the original complex video processing logic, and speeds up the business.

          Multimedia Processing Command

          The multimedia files are much larger than image files, and the processing time is long, which is usually in seconds. Therefore, the BOS multimedia processing command adopts the write processing scheme different from the BOS image processing API. Namely, the original multimedia file starts to be processed on demand when it is written into BOS, rather than based on the parameters defined by the user during reading.

          The BOS multimedia processing API is defined as follows:

          • Format conversion parameters

            Parameter Name Abbreviation Type Value Command Description Required?
            format f string [hls] Convert the video to the specified format. Yes
            time t int [6,600] Slicing time, which is 10s by default. No
          • Persistent storage parameters

            Parameter Name Abbreviation Type Value Command Description Required?
            object o string - The Base64-coded object name is limited by the object length. That means that it does not exceed 1,024 characters. Yes

          Request Method

          The parameters are entered in the header form in the POST API of BOS to upload the multimedia files through POST API and implement the encapsulation and storage by following the commands in the header.

          POST /video.mp4 HTTP/1.1
          Content-Length:ContentLength
          Content-Type: ContentType
          x-bce-process=video/format,f_hls

          Request Example

          Encapsulation and Storage Example

          Encapsulate the video.mp4 into HLS and store the results tovideo/demo.hls.

          POST /video.mp4 HTTP/1.1
          Content-Length:ContentLength
          Content-Type: ContentType
          x-bce-process=video/format,f_hls|system/save,o_dmlkZW8vZGVtby5tM3U4

          Rules and Restrictions

          Specifications supported:

          • Original multimedia formats supported: mp4
          • Target multimedia format supported: hls
          • At present, it can be used in the BJ region.
          • At present, it can be only used in the POST style upload API of BOS.

          At present, the BOS multimedia processing only supports the conversion from the MP4 file to the HLS file. BOS gradually supports more types of file code conversions in the future.

          If you want to adopt more extensive processing capabilities in the short term and allow a relatively long processing delay on the business side, you can also make a reference to the Baidu AI Cloud Multimedia Cloud Transcoder (MCT) and Baidu AI Cloud Video On Demand (VOD).

          Previous
          Interface Specifications
          Next
          Multipart Upload Related Interfaces