Asset Management

Upload Assets

The Video Library is crucial for managing your video assets, especially when creating VOD encoding or a Livestream. It serves as a central repository for your video files, offering a streamlined way to access these assets for encoding purposes or deletion when they are no longer required. This efficient management of video assets helps optimize storage space usage.

Adhering to certain specifications is important when uploading files to the Video Library. The library accepts specific file formats and sizes for different types of files:

File Type Accepted Formats Maximum Size
Video .mp4, .mpg, .mov, .mkv, AVI, .m2ts, .ts 70 GB
Subtitle .srt, .vtt 3 MB
Image .png, .jpg, .jpeg 5 MB

 

1. Upload the asset

We offer three options to provide your asset sources:

  • Upload the asset file from the local storage
  • Copy the asset file from your cloud storage

If you'd like to upload the asset file, you can use the following API with the file type, file source, and file size to request an upload.

POST /bv/cms/v1/library/files:upload

Here is the example of the request body:

"file":{
  "type":"FILE_TYPE_VIDEO",
  "source":"FILE_SOURCE_ADD_VOD",
  "name":"file_name",
  "size":"file_size_in_bytes"
}

Upon successful response, you will receive the upload ID of your file, the number of parts into which you should split the file, and one-time presigned URLs for uploading each part.

Here's an example of the response:

"upload_data":{
  "id":"upload_id_of_your_file",
  "parts":[
    {
      "part_number":0,
      "presigned_url":"string"
    },
    {
      "part_number":1,
      "presigned_url":"string"
    }
  ]
}

You can then use these presigned URLs to upload the split files to the AWS S3 bucket for BlendVision One. Note that the part size should be 5 MiB to 5 GiB, and the last part of your multipart upload has no minimum size limit.

 

Notify the uploads completed

Once all parts of the file have been uploaded, you must notify the system that the upload is complete and the asset file is ready to access. You can do this using the following API:

POST /bv/cms/v1/library/files/{id}:complete-upload

Here's an example of the request body:

"complete_data":{
  "checksum_sha1":"pdDzow0HQgS+BeLRmgWFL6/Zccw=",
  "id":"rIRIDq829eK9VqjlX7K0iSRRwpLBa6F2Qea0ojXKOCp0cExQEg.0XayecVa_hEV2uW4hsN5DDFBKNiYQIGHRTrEgUXS072GsMBMA49eJXAMBVvK68mQGeLGNafXkNvkLuupz_tuo07gcw5OCEuqEBA--",
  "parts":[
    {
      "etag":"5021b3b7c402468d5b018a8b4a2b448a",
      "part_number":1
    }
  ]
}

The checksum_sha1 is the base64-encoded, 160-bit SHA-1 digest of the object, and the etag can be obtained from the response header for the uploaded presigned URL.

Below is a diagram illustrating the entire process:

mermaid-diagram-2023-05-29-234938.svg

Updated