How fast does api.video encode video? 2H 2020 data
December 3, 2020 - Doug
Once I upload my video, how quickly will it be ready to be viewed?
Our reply to this question has always been “it's really fast.” And it is really fast. But, the dev team gave me access to the backend database, and pointed me to a few tables that might be helpful (thanks to Thomas Persohn for your patient help!)
Thus armed, I waded into a sea of data to better understand how fast our videos are encoded at api.video
When a video is uploaded to api.video, it is re-encoded to a HLS stream, with several different video dimensions and bitrates. This allows api.video to deliver properly sized video to all users - no matter the device or network connection. (Read our post on Responsive video delivery to learn more.)
Summary: All videos are encoded at 240p, 360p, 480p, 720p, 1080p and 2160p. However, the videos are only encoded up to the initial size of the video (so if the original video is 720p, there will not be 1080p or 2160p versions available).
How long does this step take? If a customer uploads a video to our service - they want to know how efficient api.video creates the content for viewing.
Data in the Study
We are constantly making adjustments to our infrastructure to speed the encoding step of our video (and that is one reason this post is dated 2H 2020 - we expect to be faster in early 2021). The last major adjustment was made in mid October, so the data presented in this study from every video uploaded to the api.video service between 15 October and 2 December 2020.
Parameters that affect encoding
There are 2 major parameters that affect the speed of encoding a new video stream: the output dimensions and the length (duration) of the video.
The output video dimensions have a huge impact on video creation - a 3840 × 2160 (or 4K or 2160p) video has millions more pixels than a 320x240 (240p) video, so it takes a lot longer to create. In general, the videos exit the encoding process from smallest to largest.
If a video is 30 frames per second, and is 60 seconds long, there are 1800 frames to be created. If a 30 frame per second video is an hour long 3600s), there are 108,000 frames to be created, so the longer the video - the more time for creation.
To better understand the encoding time, I divided the data by the size of the output video size, and looked at 2 lengths of video - those under 5 minutes, and videos that are 45-75 minutes long (we are often asked how long a 1 hour video takes to encode).
I calculated encoding time for each bucket of video using percentiles.
Quick review - percentiles break the data into 100 evenly sized segments, so the 25th percentile is when 25% of the videos have been encoded. The median is the 50th percentile, and is when 50% of videos have been encoded. We report here to the 95th percentile for video encoding.
Short Videos - under 5 minutes long
Many of the videos uploaded to api.video are short - under 5 minutes long. These videos are generally ready to play in a few seconds:
The above chart has a lot of data, the 25, 50, 75, 90 and 95th percentile encoding times for all 6 variants of the video that api.video creates.
The median video is ready to play (at 240p) in 5.6 seconds, but a 720p version will be ready in 15s after encoding begins, and the 4K version will be ready in 37 seconds.
95% of all videos (under 5 minutes) will be playable in 32.6s, and will have 1080p versions ready in just over 2 minutes (140s).
Long videos - 45 - 75 minutes long
Our most frequently asked question on encoding is "how long for a 1 hour video to be encoded and ready?" Here are the numbers:
Observant viewers will see there are no 4K videos in this report. At this time, there are very few 4K streams that reach the 1 hour timeframe, and the data was quite noisy. Hopefully, more of our 'long uploads' will add 4K support, so we can add this metric in our next update.
The median hour long video (red line) will be ready to play (at 240p) in just over 9 minutes (555s), and a 720p version will be ready about 18 minutes after encoding begins (1099s).
95% of hour long videos will have a 240p version ready in 33 minutes, and 720p in 54 (3230s). the 1080p version will be available for 95% of videos in 108 minutes,
Short videos will be ready to play - even at high resolution - in under a minute: the median 4K encoding for a short video is 37s.
Hour long videos take longer to encode, and the median 720p video will be ready in 18 minutes. 95% of 720p videos will be ready to play in 54 minutes.
This is really fast! You can have responsive streaming video ready for your customers in just a few minutes with a simple upload!
That said, our team is working hard in the background to improve our infrastructure to make our encoding speeds even faster!
We're really excited to have hard numbers to share with you on our encoding speeds, and we cannot wait to re-benchmark this data in 2021 to see how much faster your videos will be encoded as we improve our service.
Do you have questions about api.video or video encoding? Reach out on our community page.