Introduction: Ali Cloud Function Computing (FC) is the core business code to support users to develop video screenshots of events, realizing the flexible, high-availability, o&M free live video screenshots service, meeting users’ business needs of low development cost and one-click deployment, and perfectly supporting video broadcast during the games to lock the highlights of the Winter Olympics in real time.

The author | west flow, xiao yu jiang

Beijing has become the most-watched Winter Olympics in history on the fourth day of the games, with 6,000 hours of broadcast content set to surpass PyeongChang’s 5,400 hours. “More people are watching the Beijing Winter Olympics than ever before, and the games are expected to be watched by more than 2 billion people worldwide.” That’s according to iannis Exakos, chief executive of Olympic Broadcasting Services (OBS), released on February 10th. There is no doubt that the Beijing Winter Olympics is the “top stream” of the world network in the past month.

The enthusiasm of global audiences to watch the Beijing Winter Olympics events has made the broadcast of the events a high-profile event. By viewing thumbnails of highlights, viewers can quickly find what they are interested in among the many broadcast videos. For broadcasters, it is a difficult problem how to easily and quickly process the massive live video of events in real time and generate thumbnail images at different time points.

Serverless support events to lock the highlights of the Winter Olympics

Video thumbnail is a frame in the video animation thumbnail, equivalent to the cover of the video or one of the picture frame content transformed into image file, select the video thumbnail can be put in the video window screen highlighted, quickly seize the user eyeball, increase the rate of click play, event video thumbnails, unlike ordinary video thumbnail some, Need to do more rapid real-time capture of massive video.

The clients supported by function calculation need to process the massive live games videos of Beijing Winter Olympic Games in real time and take screenshots (the professional term is “video picture capture “) at different points in the live videos. Their requirements are as follows:

  • A periodic event is required to trigger the screen capture operation
  • The customer only wants to focus on specific logic development, the core video screenshot logic code is not large, need to complete the development quickly
  • Customers do not want to manage and deploy virtual machines/physical machines and want to keep it as simple as possible
  • Customers need this core business logic to be flexible, highly available and o&M free

By using Aliyun function computing (FC), the user developed the core business code of video screenshot, with low development cost and one-click deployment, and obtained a flexible, high-availability, o&M free live video screenshot service, which helped realize real-time capture of video highlights of the Winter Olympics.

The image only shows the video thumbnail effect

In fact, during the Tokyo Olympics in 2021, some broadcasting companies have perfectly supported live events with FC video thumbnail service to lock in highlights in real time. During the 15 days of the Olympics, tens of millions of function calls took place, and FC ensured that the service was highly available and resilient.

Stable response to explosive peak traffic, real-time multimedia processing

The public cloud Serverless architecture has the advantage of handling explosive peak traffic. Function computing is the Serverless computing platform provided by Aliyun. Function computing can dynamically allocate execution environment according to request volume and schedule computing resources at the millisecond level to ensure stable delay when load is high and high resource utilization when load is low, and only pay for computing resources used when code is running. Function computing can be seamlessly integrated with the object storage service, facilitating real-time processing of images stored in the object storage.

1. Function calculates live video frame capture service

In the business scene of Yizuapp, a dating product of Beijing Milian Technology Co., LTD., video live broadcasting is the most important link. Based on the framework of video live broadcasting, multiple innovative business models such as online matchmaker can be integrated, which also puts forward high requirements for the content security of video live broadcasting. Whether AI technology is used for intelligent analysis of live video content or regulatory requirements, frames should be cut at a fixed frequency after the start of each live video stream, and the images generated by frame cuts should be processed through unified audit services.

The key responsibility of this requirement is the frame capture service, which not only needs to capture each live video stream through FFmpeg command, but also needs to save the generated image to the object storage OSS and write the frame capture information to Kafka. In this way, the downstream frame capture service can pull the frame capture information from Kafka and obtain the image’s address in OSS from the frame capture information to complete the image audit. In this architecture, Kafka was introduced to ease the load of auditing services during peak business times through asynchronous processing mechanisms.

The App uses function calculation, users do not need to purchase and manage servers and other infrastructure, just write and upload the code. Function computing automatically prepares computing resources, runs tasks flexibly and reliably, and provides log query, performance monitoring, and alarm functions. With functional computation of FC, you can quickly build any type of application and service and only pay for the resources that the task actually consumes. The architecture of the previous frame capture business can be migrated to a functional computing platform with minimal adjustments to enjoy the value of Serverless.

2. Function computing image real-time processing service

Take Sina Weibo for example, the rapid growth of business has caused a great impact on the original technology system of Weibo. How to not affect user experience and not increase server cost is the top priority for microblog developers under the situation of rapid growth of users, surge of hot event traffic and obvious peaks and troughs of requests.

The elastic expansion of function calculation, event triggering and pay-per-quantity features are in tune with Weibo. Sina Weibo decided to use function computing to deploy image processing services.

Sina Weibo uses the elastic expansion, event triggering and pay-per-quantity features of function calculation to deploy picture processing services, store the pictures uploaded by users in object storage, and write functions to realize personalized picture processing. When weibo users obtain pictures through the client, they request aliyun CDN to return them to the function for calculation. The function downloads the original pictures from the object storage, processes them into pictures of the expected specifications in real time according to the client type (such as different mobile phone models), and returns the resulting pictures, which greatly reduces the storage cost.

The function computes millisecond scaling of computing resources to ensure stable latency in the event of hotspot events. The user experience is not affected by the number of access times. Weibo realized continuous cost savings by running the image processing service through function calculation. There is no need to reserve large amounts of idle machine resources in advance to smooth the surge of traffic that comes with business peaks, and without the need to maintain complex machine states, engineers can focus on working with the product team to increase business value rather than spending time managing the infrastructure.

conclusion

Serverless technology will undoubtedly take on more responsibility for allowing users to build applications faster and better. There are many scenarios that can be covered using the Serverless architecture, and here are just a few image processing scenarios. Less is more To entrust the work to reliable platforms (such as cloud vendors), so that developers can focus more on their core business value, which is the philosophy advocated by Serverless.

The original link

This article is the original content of Aliyun and shall not be reproduced without permission.