Progressive video upload
api.video provides different ways to upload your videos. There are two ways to upload with tokens, and then there are two ways to upload depending on whether your video is over 200MB or under. This guide walks through how to do progressive video upload. Options covered in this guide include:
- Progressive upload for a video that's 200MiB or more
- Progressive upload for a video that's 200MiB or more using
byterange in the
Megabyte (MB) and Mebibyte (MiB) are both used to measure units of information on computer storage. 1 MB is 1000Kb (kilobytes), and 1 MiB is 1048.576Kb. api.video uses MiB.
Create an account
Before you can start uploading your first video, you need to create an api.video account.
Once you are logged in to the Dashboard, select the environment of your choice (sandbox or production) and copy your API key.
Choose an API client
The clients offered by api.video include:
To install your selected client, do the following:
Progressive upload in file chunks
When the video file you want to upload is too large to send in one request, you need to do a progressive upload. To upload the entire video, you must broken into chunks, and send each chunk in separate requests. The smallest chunk size allowed is 5 MiB.
- When you do a progressive upload using one of the api.video clients, you must indicate when you send the last part.
- If you implement this functionality without an api.video client, you do not need to indicate the last part of the progressive upload. api.video can track the chunk numbers based on your header which indicates
Content-Range, for example : part 3/3, according to the number of chunks you sent.
Progressive upload with byte range in the content-range header
A slightly more complicated way to upload a video that's 200 MiB or larger is to use
bytes in the
content-range header. This method requires that you define the exact byte ranges correctly, otherwise the entire upload to fail. When done correctly, your header will look like this:
Content-Range: bytes 0-5242879
And then continue from there. By default, the api.video clients handle uploads for you using this method. If you want to try it yourself without the client, the sample will look like this in cURL:
All api.video clients automatically use the
Content-Range: bytes method to upload big videos for you. You don't have to set it up yourself if you use a client!
Check out api.video's blog content on video upload:
Video upload with cURL - cURL
Upload a video with Laravel - PHP Create a form that uploads a video to api.video using Laravel.
Upload a video with the api.video PHP client - PHP A tutorial about how to upload a video with the PHP API client, this will work for large or small files and uses the Content-Range header method.
Progressively upload large video files without compromising speed - Python A tutorial that walks you through using progressive uploads without using an API client.
Upload a big video file using Python - Python Learn how to break a large video file into chunks and upload each chunk using Python.
Upload a video from your computer with the api.video API - Python Upload a video from your computer using Python.
Upload a video to api.video using a public URL - Python Learn how to upload a video from a public mp4 link.
Upload a video with the api.video Python Client - Python Upload a video of any size using api.video's Python client.
Use Flask with Dropzone.js to upload videos under 200 MiB (no client) - Python Learn how to do an upload for files under 200 MiB without using an api.video client.
Was this page helpful?