Video Upload

The official SDK libraries make video upload simple. However, if you are building your own workflow then a few extra steps are required.

This workflow is typically used when you build your own application that implements its own video file uploader, or if you want to handle uploading files directly to S3 yourself.

The code examples that follow use the Ruby SDK, but all SDK libraries offer the same functionality.

1. Generate a signature

The API generates 2 types of signature. The signature you need depends on your file and what you know about the file. The SDK will default to a multipart signature, only falling back to a single signature if your file size is below 5MB.

  1. Generate a multipart signature if your file size is at least 5MB.
  2. Generate a single signature if your file size is below 5MB or if you don't know the file size.
# multipart
VzaarApi::Signature::Multipart.create(filename: 'video.mp4', filesize: 10000000000)

# single
VzaarApi::Signature::Single.create

2. Upload your video to S3

The upload process you follow depends on the signature you generated.

  1. A multipart signature requires that you perform a chunked upload to S3. The number and size of chunks are specified in the signature. If you do not use the values specified in the signature your video will not be processed correctly. See the multipart signature documentation for more details.

  2. A single signature requires that you perform a simple file upload to S3. See the single part signature documentation for more details.

3. Process your video

Once your upload has completed successfully, the final step is to tell vzaar that the video is ready for processing. Using the guid specified in the signature:

VzaarApi::Video.create(guid: signature.guid)