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.
- Generate a
multipartsignature if your file size is at least5MB. - Generate a
singlesignature if your file size is below5MBor if you don't know the file size.
# multipart
VzaarApi::Signature::Multipart.create(filename: 'video.mp4', filesize: 10000000000)
# single
VzaarApi::Signature::Single.create2. Upload your video to S3
The upload process you follow depends on the signature you generated.
A
multipartsignature 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.A
singlesignature 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)