Let's walk through how to transcode a file using Octet. You can also check out the API docs for more detailed information.
In this guide, we're going to transcode a 4k version of Big Buck Bunny into a 1080p, 720p, 480p, and 360p version.
We're going to need a few things:
- A URL for an input file to transcode. We're going to use
https://octet-samples.s3.amazonaws.com/bbb_4k.mp4
for this tutorial - A destination for the output(s) of the job. This is an S3 bucket where the transcoded files are uploaded to.
- Configuration for each of the output(s) of the job.
Create an S3 Bucket
Octet writes the output of transcoding jobs to a user-provided S3 bucket.
This guide shows how to create an S3 bucket along with an IAM user that gives Octet write access to the bucket.
Make a note of the SecretAccessKey
and the AccessKeyId
for your IAM user.
Create a transcode job
Now we can create a job and have Octet transcode our input file.
Create a file called
my_encode_job.json
containing the followingThis tells Octet to use our specified input file, transcode to the four specified resolutions (maintaining aspect ratio), and upload the outputs to our S3 bucket. See the API docs for details on all options (encode parameters, webhooks, etc).
Make sure to replace
bucket
,access_key_id
, andsecret_access_key
with the correct values for your bucket and IAM user.Get your Octet Video API key from your dashboard
Create a new transcoding job:
The response will look like
You can now get the status of your job:
Octet also has support for webhooks to let you know when your job is complete. See the API docs for more details.
Once the job is complete, we can check our S3 bucket and we see the transcoded files: