post https://api.neuronsinc.com/predict/v2/videos
Expected request payload
The request body must be populated with the video characteristics:
- content_type: Should be either
video/mp4
,video/webm
orvideo/mov
- 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,
"name": "video_media"
}
For more information on video upload requirements, please refer to this page. (Note: The upload of PDF files is not supported by the Neurons API).
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
curl -X 'PUT' \
'https://storage.googleapis.com/upload/storage/v1/b/o?uploadType=resumable&upload_id=' \
-H 'Content-Length:953311' \
-F 'file=video_media.mp4'
This should elicit a successful response with a 200 status, which means that the video has been successfully uploaded.