Create Video

Creates a video object in the system and returns a resumable url to upload the video

Expected request payload

The request body must be populated with the video characteristics:

  • content_type: Can be in one of the following formats:
    • mp4 (video/mp4)
    • webm (video/webm)
    • mov (video/mov)
    • mkv (video/mkv)
    • avi (video/avi)
  • total_bytes: The size of the video file (in bytes)
  • name: This is an optional parameter
  • Maximum allowed file size: 500 MB (The upload URL will only accept the exact specified file size)
  • Maximum allowed video resolution: 3000x3000
{
  "content_type": "video/mp4",
  "total_bytes": 953311
}

For more information on video upload requirements, please refer to this page.

Example of a successful response

The response contains two properties:

  • The media_id: serves as an identifier for the video media (to be used on any operation for the video)
  • The resumable_url: this URL is where the video file will have to be upload.
{
  "resumable_url": "https://storage.googleapis.com/upload/storage/v1/b/o?uploadType=resumable&upload_id=",
  "media_id": "0d1aeafa-d360-47c2-afaf-c6149281c202"
}

Upload video file to Cloud Services

In order to upload the video file to the cloud storage, and thus make it eligible for prediction, it is necessary to send a PUT request to the resumable_url. The resumable upload endpoint follows the Google Cloud Storage expected format.

curl -i -X PUT --data-binary '@/path/to/file/video_ad.mp4' \
    -H "Content-Length:YOUR_VIDEO_SIZE" \
    "https://storage.googleapis.com/upload/storage/v1/b/o?uploadType=resumable&upload_id="

This should elicit a successful response with a 200 status, which means that the video has been successfully uploaded.

Language
Credentials
Header
Click Try It! to start a request and see the response here!