![]() ![]() $ time MP4Box -add input.mp4 -dash 2000 -profile dashavc264:onDemand -out manifest.mpdĠ.36s user 2.22s system 95% cpu 2.690 total The following terminal command times show that it takes only 0.36 seconds to generate a manifest file and repackage the video frames into an ABR-capable file structure for the same input video. This would virtually eliminate the cost of generating our basic ABR encodings. Then it dawned on us: We could replace our basic ABR encodings with the progressive encodings’ video frames by repackaging them into an ABR-capable file structure. They used the same codec with only minor differences in the encoding profile and preset. We noticed that the settings of the two sets of encodings were similar. ![]() But this process hogs compute resources: As the following terminal command shows, it takes 86.17 seconds of CPU time to transcode a 23-second video to 720p. ![]() Traditionally, we have created both ABR and progressive encodings from the original file the client uploaded to our back end. We rarely deliver progressive encodings, the other minimum functionality type, but we continue to produce them to maintain compatibility with old versions of the Instagram app that don’t support ABR playback. For the steadiest playback, clients can select the version that best fits their connection speed to prevent stalling caused by changes in bandwidth - a technique called adaptive bit rate streaming. For every video, we generate basic adaptive bit rate (ABR) encodings - our most-watched minimum functionality type. Instagram creates two classes of minimum functionality encodings. Our advanced encodings covered only 15 percent of total watch time, and we projected that spending all our compute on minimum functionality versions would soon prevent us from being able to provide advanced video encoding watch time. As a result, videos would start to take longer to publish - or fail to publish altogether. If we stayed on that trajectory, minimum functionality would monopolize our resources within a year. The problem was that we were spending more than 80 percent of our resources processing minimum functionality encodings. In the example below, close-ups of two video frames show that we can provide sharper detail with fewer bits (note the clarity of the video on the right compared with that on the left). Advanced encodings use newer compression technologies for higher-quality playback.Their lower-efficiency compression is easier for older devices to decode and play. Minimum functionality encodings are compatible with all Instagram clients.We generate two types of video encoding for each video uploaded to Instagram: With more resources available, we can produce more advanced encodings - allowing more people to experience clearer video with smoother playback. By repurposing one type of video encoding to help generate another type, we reduced the compute resources we spend on less-watched video encodings by 94 percent. Instagram creates multiple encoded versions of uploaded videos, each with different characteristics. ![]() But in our never-ending quest to prioritize efficiency, we uncovered a way to handle this increasing demand and scale our infrastructure by doing more with the machines we already have. In early 2021, we ran projections that showed that within 12 months we would not have enough capacity to provide video uploads for everyone. Instagram’s growing user base of more than 2 billion monthly active users requires us to get the best possible performance from our fleet of servers. This is especially beneficial for people in countries that have slower internet connections. This frees up resources so more people can watch advanced encodings, which provide clearer video that plays more smoothly.With this method in place, Meta’s video infrastructure can continue to scale without needing to add more machines.In our constant quest to prioritize efficiency, Instagram’s engineers have developed a way to process new videos that reduces the cost to produce basic video encodings by 94 percent. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |