First, decide where on the wall the service should start and end. For example, consider a user-generated content site where the average video duration is one minute. The maximum size of each video is small, so there is no need to worry about buffering or stream disruptions; the player should be able to download the whole stream in a few seconds, which means only a couple of renditions are needed, for example, one HD and one SD.
On the other hand, consider a movie service with an average video length of 120 minutes. The files are large, which means the user’s device won’t be able to download the entire stream. In addition, users generally have higher expectations for the quality of feature films. We need to create a number of renditions so users will be able to watch high-quality videos when they have a strong network connection.
Profile defines the complexity of the encoding algorithm required to decode a given rendition ranging from low to high complexity. The three most important profiles are baseline, main and high. Level defines a maximum amount of pixels and bitrate that a certain rendition is guaranteed not to exceed. The three most important levels are 3.0 (SD/legacy mobile), 3.1 (720p/mobile), and 4.1 (1080p/modern devices).
At the bottom rung, we want to provide the widest array of support so that we can always deliver a playable video regardless of the device. That means we should choose either baseline 3.0 or main 3.1, and we should choose a resolution that is fairly modest, most likely between mobile or 640x360. As we move up the ladder, we can gradually increment these values until we reach the top, where we can maximize our video quality with 1080p high 4.1 videos.
Step 4: Formats - Duplicating Ladders
Now that our MP4s have been created, we have a stable base format and customers can watch video on a variety of devices; we created a ladder to scale the wall. While MP4 is a strong baseline format, other formats can improve the user’s experience. For example, HLS allows a user’s device to automatically and seamlessly jump up and down the ladder.
Since we’ve already created MP4s, and because MP4 is a standard format, we can easily repackage it into other formats. In fact, this is such an easy task that Zencoder charges only 25% of a normal job to perform this duplication, or transmuxing, and it can be done nearly instantly alongside a group of MP4 encodings by using “source”, “copy_video”, and “copy_audio.”
The “source” command tells Zencoder to reuse the file created under a given output “label.” So, if we create a file with “label:”:= “MP4_250,” all we need to do is use “source:” “MP4_250” to tell Zencoder to reuse this rendition. “Copy_video” and “copy audio” will then extract the elemental audio and video tracks, and repackage them into an HLS formatted file.
We can do the same thing for smooth streaming as well. And almost instantly, at a fraction of the cost, we’ve created two new ladders that let virtually anybody watch great quality video.