Method and device for scheduling video transcoding task, electronic equipment, storage medium and program product

The method addresses inefficiencies in traditional transcoding task scheduling by predicting resource needs based on video features and parameters, optimizing resource allocation and enhancing server cluster efficiency in video streaming.

CN119094807APending Publication Date: 2024-12-06BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411074649.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Traditional video transcoding task scheduling methods struggle to adapt to changing network environments and video stream characteristics, leading to resource waste and system performance degradation due to inefficient resource allocation and real-time performance issues.

Method used

A method for scheduling video transcoding tasks that involves determining image features of input videos, predicting resource occupancy and memory usage based on these features and target transcoding parameters, and dynamically allocating computing resources to optimize server cluster utilization.

Benefits of technology

Enables flexible and efficient scheduling of transcoding tasks, improving server cluster utilization and reducing the likelihood of freezes in live video streaming by accurately predicting resource requirements based on video content complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094807A_ABST
    Figure CN119094807A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for scheduling a video transcoding task, electronic equipment, a storage medium and a program product, and relates to the technical field of data processing, in particular to artificial intelligence and streaming media technologies. According to the implementation scheme, an input video to be transcoded is determined, wherein the input video comprises at least one image frame; performing image analysis on the at least one image frame to obtain image features of the input video; determining a target transcoding parameter for the transcoded target video; predicting a resource occupation amount required by a transcoding task of the input video and a memory usage amount acceptable for the transcoding task based on image features of the input video and the target transcoding parameter; and scheduling computing resources for the transcoding task based on the predicted resource occupation amount and memory usage amount.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, in particular to artificial intelligence and streaming media technology, and specifically to a method, device, electronic device, computer-readable storage medium and computer program product for scheduling video transcoding tasks. Background Art

[0002] Artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] With the rapid development of the Internet, video communication has become an important form of content dissemination.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides a method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for scheduling video transcoding tasks.

[0006] According to one aspect of the present disclosure, a method for scheduling video transcoding tasks is provided, comprising: determining an input video to be transcoded, wherein the input video includes at least one image frame; performing image analysis on the at least one image frame to obtain image features of the input video; determining target transcoding parameters for the target video after transcoding; predicting the resource occupancy required for the transcoding task of the input video and the acceptable memory usage for the transcoding task based on the image features of the input video and the target transcoding parameters; and scheduling computing resources for the transcoding task based on the predicted resource occupancy and memory usage.

[0007] According to another aspect of the present disclosure, there is provided an apparatus for scheduling video transcoding tasks, comprising: an input unit, configured to determine an input video to be transcoded, wherein the input video comprises at least one image frame; a video analysis unit, configured to perform image analysis on the at least one image frame to obtain image features of the input video; a transcoding parameter determination unit, configured to determine target transcoding parameters for a target video after transcoding; a prediction unit, configured to predict, based on the image features of the input video and the target transcoding parameters, the resource occupancy required for the transcoding task of the input video and the acceptable memory usage for the transcoding task; and a scheduling unit, configured to schedule computing resources for the transcoding task based on the predicted resource occupancy and memory usage.

[0008] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method according to an embodiment of the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, where the computer instructions are used to cause the computer to execute the method according to the embodiment of the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is further provided, including a computer program, wherein the computer program implements the method according to the embodiment of the present disclosure when being executed by a processor.

[0011] According to one or more embodiments of the present disclosure, the computing resources required to perform a transcoding task can be predicted based on the image features and transcoding parameters of the input video to be transcoded, thereby enabling flexible scheduling of transcoding tasks and improving the utilization rate of the server cluster used to perform transcoding tasks.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0014] Figure 1A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0015] Figure 2 A flowchart of a method for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown;

[0016] Figure 3 An exemplary process for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown;

[0017] Figure 4 An exemplary block diagram of a device for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown;

[0018] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0022] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0023] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0024] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the method for scheduling video transcoding tasks according to an embodiment of the present disclosure.

[0025] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0026] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0027] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to obtain input data for scheduling video transcoding tasks, such as input videos, transcoding parameters of specified target videos, etc. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0028] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0029] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0030] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0031] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0032] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0033] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0034] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0035] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0036] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0037] With the rapid development of the Internet, video dissemination has become an important form of content dissemination. In the process of video dissemination, efficient transcoding is required to ensure the smoothness of video dissemination. Especially for video dissemination scenarios such as live video broadcasting, efficient transcoding and resource management are important. Traditional transcoding task scheduling methods usually rely on manual scheduling and rule-based scheduling. For example, by assigning new video transcoding tasks to servers that are currently idle (such as CPU occupancy is less than a threshold). Regardless of the type of video content, such as simple or complex streams, the same scheduling method is used to schedule them to idle machines. Such a scheduling method is difficult to cope with the changing network environment and video stream characteristics, resulting in resource waste and system performance degradation.

[0038] However, it is not enough to just consider the CPU load, because in the scenario of real-time video processing, the encoding frame rate must reach real-time, such as a constant 25fps. And for videos of different complexity, the computing power required to reach 25fps is different. Therefore, the scheduling scheme in the current related technology may cause a single video stream to freeze (real-time performance cannot meet the requirements), and on the other hand, the imbalance of scheduled resources may cause uneven use of machine computing power.

[0039] In order to improve the resource scheduling efficiency of video transcoding tasks, the present disclosure provides a new method for scheduling video transcoding tasks.

[0040] Figure 2 An exemplary flowchart of a method for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown.

[0041] In step S202, an input video to be transcoded is determined, wherein the input video includes at least one image frame.

[0042] In step S204, image analysis is performed on at least one image frame to obtain image features of the input video.

[0043] In step S206, target transcoding parameters for the transcoded target video are determined.

[0044] In step S208, the resource usage required for the transcoding task of the input video and the acceptable memory usage for the transcoding task are predicted based on the image features of the input video and the target transcoding parameters.

[0045] In step S210, computing resources are scheduled for the transcoding task based on the predicted resource occupancy and memory usage.

[0046] By using the method for scheduling video transcoding tasks provided by the embodiments of the present invention, the computing resources required to execute the transcoding task can be predicted based on the image features and transcoding parameters of the input video to be transcoded, thereby enabling flexible scheduling of transcoding tasks and improving the utilization rate of the server cluster used to execute transcoding tasks.

[0047] The principles of the present disclosure will be described in detail below.

[0048] In step S202, an input video to be transcoded is determined, wherein the input video includes at least one image frame.

[0049] In some embodiments, the input video to be transcoded may be a live video. Since the real-time requirements for video transmission in the live broadcast scenario are high, the method for scheduling video transcoding tasks provided by the embodiments of the present disclosure can effectively improve the utilization rate of transcoding resources for live video, and thus can make the live video transmission smoother. It is understandable that, without departing from the principles of the present disclosure, the method provided by the embodiments of the present disclosure can also be used for video transcoding tasks in any other scenario other than live broadcast.

[0050] In step S204, image analysis is performed on at least one image frame to obtain image features of the input video.

[0051] The image features of the input video can be used to represent the content complexity in the input video. In the example, the image features of the input video may include at least one of the following: resolution, bit rate, group of pictures (GoP) size, frame rate, encoder type (such as the encoding format is H.265 or H.245), time complexity (TI) information, space complexity (SI) information. The above-mentioned image features can be obtained by performing image analysis on the image frames in the input video using any known video parsing method. Without departing from the principles of the present disclosure, any other parameters that can represent the content complexity of the input video can also be used as the image features of the input video.

[0052] In step S206, target transcoding parameters for the transcoded target video are determined.

[0053] The target transcoding parameters of the target video can represent the encoding complexity of the target video, and thus will affect the complexity of the transcoding task. For example, the higher the compression rate of the target video, the smaller the computational load of the transcoding task. Conversely, the lower the compression rate of the target video, the more computing resources the transcoding task requires to complete the required computational load.

[0054] In an example, the target transcoding parameters may include at least one of the following: target resolution, target bit rate, target frame rate, target encoding level. The target encoding level may represent the encoding quality (such as compression rate) of the target video. In an example, the target encoding level may be represented according to the transcoding speed, for example, as "fast", "medium", or "slow". The faster the transcoding speed, the lower the encoding quality of the target video. The target transcoding parameters may be specified by the user before the transcoding task begins or determined according to a rule. Without departing from the principles of the present disclosure, any other parameter capable of representing the encoding complexity of the target video may also be used as the target transcoding parameter of the target video.

[0055] In step S208, the resource usage required for the transcoding task of the input video and the acceptable memory usage for the transcoding task are predicted based on the image features of the input video and the target transcoding parameters. The resource usage may be the processor resources occupied by the transcoding task, such as the CPU usage. The memory usage may be the highest memory usage when the transcoding task is not stuck. The memory usage may include at least one of the parameters such as the memory delay time and the memory occupied bandwidth. Memory usage is another important factor that affects the processing efficiency of the transcoding task besides the CPU usage. In some cases, even if the CPU usage has not reached the upper limit, if the memory usage is occupied due to the high complexity of other tasks being processed, it will cause abnormal phenomena such as stuck in other transcoding tasks.

[0056] In some embodiments, the image features of the input video and the target transcoding parameters can be processed using a trained machine learning model to output resource usage and memory usage. An exemplary machine learning model can be a regression model (such as linear regression, random forest regression, etc.) or a classification model (such as convolutional neural network, random forest classification, etc.).

[0057] In other embodiments, the image features of the input video and the target transcoding parameters may be matched based on predetermined rules to obtain predicted resource usage and memory usage. In still other embodiments, a generative model such as a large language model may be used to process the image features of the input video and the target transcoding parameters to obtain predicted resource usage and memory usage. Without departing from the principles of the embodiments of the present disclosure, various prediction algorithms may be used to predict the resource usage and memory usage of the transcoding task.

[0058] When a machine learning model is used to predict the resources required for a transcoding task, the machine learning model may be trained by the following method.

[0059] Determine a sample data set, wherein the sample data set includes multiple sample videos to be transcoded. For each sample video in the sample data set, perform image analysis on the image frames in the sample video to determine sample image features of the sample video. Determine corresponding target transcoding parameters for the sample video. Transcode the sample video according to the target transcoding parameters. Mark the actual resource usage required for the transcoding process of the sample video and the actual memory usage acceptable for the transcoding process. Input the sample image features into a machine learning model to obtain a predicted resource usage and a predicted memory usage. Adjust the parameters of the machine learning model based on a first difference between the predicted resource usage and the actual resource usage and a second difference between the predicted memory usage and the actual memory usage.

[0060] The sample data set may include sample videos to be transcoded. Taking the application scenario of live broadcast as an example, the sample video may be a live broadcast video. The sample video may be analyzed to obtain image features of the sample video, such as resolution, bit rate, GOP size, frame rate, encoder type, TI information, SI information, etc. The above image features may be calculated in real time during the encoding process of the sample video. In the example, the sample video may also be preprocessed, such as data cleaning, normalization, etc. In some cases, the average bit rate, average GOP size, average frame rate, etc. of multiple sample videos may be obtained as image features of multiple sample videos.

[0061] Then, target transcoding parameters for transcoding the sample video may be determined, such as the encoding type, resolution, frame rate, bit rate, encoding level, etc. of the target video.

[0062] For the same sample video, transcoding tasks with different target transcoding parameters can be determined for the sample video.

[0063] For each transcoding task, the server can be used to execute the transcoding task, and the CPU occupancy rate, memory usage and other information of the server can be collected while executing the transcoding task. In the example, multiple identical transcoding tasks can be executed in parallel. When the server computing resources are not exhausted, the number of multiple transcoding tasks that are executed in parallel to transcode the sample video based on the target transcoding parameters can be increased until at least one of the multiple transcoding tasks is stuck. The resource occupancy and memory usage of multiple transcoding tasks when the transcoding task of the sample video is stuck can be marked. Among them, the real resource occupancy of each transcoding task can be determined based on the resource occupancy of multiple transcoding tasks and the number of multiple transcoding tasks. For example, the resource occupancy of multiple transcoding tasks can be divided by the number of transcoding tasks to obtain the resource occupancy of each transcoding task. In addition, the real memory usage acceptable to the transcoding process can be determined based on the server memory usage when the stuck occurs.

[0064] It is understandable that the server's memory usage is related to the amount of memory read and write in the transcoding task, and encoding tasks of different complexity will have different memory read and write requirements. Therefore, different transcoding tasks can accept different amounts of memory usage. Due to the differences between the encoding processes of different videos, it is difficult to directly determine the maximum acceptable memory usage without lag in the transcoding process based on the video content.

[0065] Therefore, the embodiments of the present disclosure test the specific memory usage that can be accepted by transcoding tasks of different complexity by executing multiple identical transcoding tasks in parallel until a freeze occurs. It is understandable that as the number of tasks executed in parallel increases, the amount of memory read and writes also increases accordingly, and the memory usage also increases accordingly. When a freeze occurs, it indicates that the transcoding task can no longer be executed smoothly at this time. The memory usage recorded when the freeze occurs is the threshold of the actual memory usage that can be accepted by the transcoding task.

[0066] Using the sample image features of the sample video, the real resource usage marked by the above method, and the real memory usage acceptable to the transcoding process, the machine learning model can be trained so that the machine learning model has the ability to predict the computing resources required for the transcoding task.

[0067] The sample image features and target transcoding parameters of the sample video can be input into the machine learning model, and the predicted resource occupancy and predicted memory usage output by the machine learning model can be obtained. The predicted resource occupancy can be compared with the actual resource occupancy marked for the transcoding task corresponding to the target transcoding parameters to obtain a first difference between the predicted resource occupancy and the actual resource occupancy. Similarly, the predicted memory usage can be compared with the actual memory usage acceptable to the transcoding process marked for the transcoding task corresponding to the target transcoding parameters to obtain a second difference between the predicted memory usage and the actual memory usage. The first difference and the second difference can be minimized by adjusting the parameters of the machine learning model, so that the trained machine learning model can predict the computing resources required for the transcoding task.

[0068] In step S210, computing resources are scheduled for the transcoding task based on the predicted resource occupancy and memory usage.

[0069] In some embodiments, the current processor occupancy and current memory usage of each server in a server cluster that performs video transcoding tasks can be obtained, and by comparing the predicted resource occupancy and current processor occupancy, and the predicted memory usage and current memory usage, respectively, a server that meets predetermined scheduling conditions is determined from the server cluster to process the transcoding task.

[0070] The server cluster may include multiple servers, each of which may be used to perform transcoding tasks. The current status of each server in the server cluster may be collected by system monitoring, including the CPU occupancy rate and memory usage of the server. When computing resources need to be allocated for transcoding tasks, the transcoding tasks may be scheduled by matching the predicted resource occupancy of the transcoding tasks with the current resource occupancy of the servers, and by matching the predicted memory usage of the transcoding tasks with the current memory usage of the servers.

[0071] For resource occupancy, it can be determined whether the following scheduling conditions are met: after the current CPU occupancy is added to the resource occupancy of the transcoding task predicted in step S108, whether the CPU occupancy of the server does not exceed the scheduling condition of the CPU occupancy upper limit. For memory usage, it can be determined whether the following scheduling conditions are met: whether the current server's memory usage is less than the acceptable memory usage of the transcoding task predicted in step S208. If both of the above two scheduling conditions are met, the transcoding task can be assigned to the server. If any of the above two scheduling conditions is not met, it can be detected whether another server in the server cluster can meet the above scheduling conditions. If there is no server in the server cluster that can meet the above two scheduling conditions at the same time, the server whose working status is closest to the above two scheduling conditions among all servers can be selected as the server for processing the transcoding task.

[0072] When deploying the method for scheduling transcoding tasks provided by the embodiment of the present disclosure, the performance data of the server system can be collected, including CPU usage, memory usage, bandwidth usage, transcoding time, etc., and the transcoding machine can report the current cluster CPU and memory latency in real time. The prediction model trained using the above method can be deployed in the computing system, and the system resource usage of video transcoding can be predicted in real time using an application programming interface API or batch processing. The scheduler in the system is responsible for scheduling the source video stream in the transcoding task to the corresponding cluster and transcoding it. The model performance can be continuously monitored, and the model and data can be updated regularly.

[0073] By using the method of the embodiments of the present invention, it is possible to analyze and predict the characteristics of the video stream using a predictive model such as a machine learning model, and adjust the transcoding strategy and resource allocation in real time to optimize system performance, reduce the probability of freezes in the live broadcast system, and improve the transcoding resource utilization of the entire video system.

[0074] Figure 3 An exemplary process for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown.

[0075] At step 301, an API is used to control a live stream queue 310. The transcoding tasks can be scheduled to the queue 310 based on the service priority, and the transcoding tasks involved in the higher priority services are ranked higher in the queue.

[0076] At step 302, image analysis may be performed on the video streams in the live stream queue 310 to obtain image features 320 of each video stream. In the example, the image features 320 are normalized.

[0077] At step 303, the status of the servers in the current server cluster may be read, such as CPU load data, memory usage data, and the like.

[0078] The prediction model 330 can be trained using the image features 320. At step 304, the prediction model 330 can be used to predict the encoding complexity of the transcoding task to be processed. For example, the prediction model 330 can be used to predict the resource usage required for the transcoding task and the acceptable memory usage for the transcoding task.

[0079] The scheduler 340 may allocate the transcoding tasks in the live stream queue 310 to the servers in the server cluster 350 for transcoding that meet the predetermined scheduling conditions according to the prediction results of the prediction model 330 .

[0080] During the execution of each transcoding instance 360 ​​by the server cluster 350 , the working status of each server in the cluster is monitored to provide the required information for subsequent transcoding task scheduling.

[0081] Figure 4 An exemplary block diagram of an apparatus for scheduling video transcoding tasks according to an embodiment of the present disclosure is shown.

[0082] like Figure 4 As shown, the apparatus 400 may include an input unit 410 , a video analysis unit 420 , a transcoding parameter determination unit 430 , a prediction unit 440 , and a scheduling unit 450 .

[0083] The input unit 410 may be configured to determine an input video to be transcoded, wherein the input video includes at least one image frame.

[0084] The video analysis unit 420 may be configured to perform image analysis on the at least one image frame to obtain image features of the input video.

[0085] The transcoding parameter determination unit 430 may be configured to determine target transcoding parameters for the transcoded target video.

[0086] The prediction unit 440 may be configured to predict the resource usage required for the transcoding task of the input video and the acceptable memory usage for the transcoding task based on the image features of the input video and the target transcoding parameters.

[0087] The scheduling unit 450 may be configured to schedule computing resources for the transcoding task based on the predicted resource occupancy and memory usage.

[0088] It should be understood that Figure 4 The various modules or units of the apparatus 400 shown in FIG. 4 can be used in conjunction with the reference Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 400 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0089] Although specific functionality is discussed above with reference to specific modules, it should be noted that the functionality of the various units discussed herein may be separated into multiple units, and / or at least some functionality of multiple units may be combined into a single unit.

[0090] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 4 The various units described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these units can be implemented as computer program codes / instructions, which are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these units can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of units 410 to 450 can be implemented together in a system on chip (System on Chip, SoC). SoC may include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and may optionally execute the received program code and / or include embedded firmware to perform functions.

[0091] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method according to an embodiment of the present disclosure.

[0092] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, where the computer instructions are used to cause the computer to execute the method according to the embodiment of the present disclosure.

[0093] According to another aspect of the present disclosure, a computer program product is further provided, including a computer program, wherein the computer program implements the method according to the embodiment of the present disclosure when being executed by a processor.

[0094] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0095] refer to Figure 5 , a block diagram of an electronic device 500 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0096] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0097] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the electronic device 500. The input unit 506 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0098] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0104] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0106] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for scheduling a video transcoding task, comprising: Determining an input video to be transcoded, wherein the input video includes at least one image frame; Performing image analysis on the at least one image frame to obtain image features of the input video; determining target transcoding parameters for the transcoded target video; Predicting the resource usage required for the transcoding task of the input video and the acceptable memory usage for the transcoding task based on the image features of the input video and the target transcoding parameters; Computing resources are scheduled for the transcoding task based on the predicted resource occupancy and memory usage.

2. The method of claim 1, wherein: The image features of the input video include at least one of the following: Resolution; Bit rate; Image group size; Frame rate; Encoder type; Time complexity information; Space complexity information.

3. The method of claim 1, wherein: The target transcoding parameter includes at least one of the following: Target resolution, target bit rate, target frame rate, target encoding level.

4. The method of claim 1, wherein: Scheduling computing resources for the transcoding task based on the predicted resource occupancy and memory usage includes: Get the current processor occupancy and current memory usage of each server in the server cluster that performs the video transcoding task; By comparing the predicted resource occupancy and the current processor occupancy, the predicted memory usage and the current memory usage, respectively, a server that meets a predetermined scheduling condition is determined from the server cluster to process the transcoding task.

5. The method of claim 1, wherein: Predicting the resource occupancy and the memory usage based on the image features of the input video and the target transcoding parameters includes: Processing the image features of the input video and the target transcoding parameters using a trained machine learning model to output the resource usage and the memory usage, Among them, the input video to be transcoded is a live video, and the machine learning model is a regression model or a classification model.

6. The method of claim 5, wherein: The machine learning model is trained by: Determining a sample data set, wherein the sample data set includes a plurality of sample videos to be transcoded; For each sample video in the sample data set, Performing image analysis on the image frames in the sample video to determine sample image features of the sample video; Determining corresponding target transcoding parameters for the sample video; Transcoding the sample video according to the target transcoding parameters; Mark the actual resource usage required for the transcoding process of the sample video and the actual memory usage acceptable for the transcoding process; Inputting the sample image features into the machine learning model to obtain predicted resource usage and predicted memory usage; Adjust parameters of the machine learning model based on a first difference between the predicted resource occupancy and the actual resource occupancy and a second difference between the predicted memory usage and the actual memory usage.

7. The method of claim 6, wherein: The actual resource usage required for the transcoding process of the sample video and the actual memory usage acceptable for the transcoding process include: Increasing the number of multiple transcoding tasks that are executed in parallel to transcode the sample video based on the target transcoding parameters until at least one of the multiple transcoding tasks is stuck; Marking the resource usage and memory usage of the multiple transcoding tasks when the transcoding task of the sample video freezes; Determine the actual resource occupancy of each transcoding task based on the resource occupancy of the multiple transcoding tasks and the number of the multiple transcoding tasks; The actual memory usage is determined based on the server memory usage when the freeze occurs.

8. A device for scheduling video transcoding tasks, comprising: An input unit, configured to determine an input video to be transcoded, wherein the input video includes at least one image frame; a video analysis unit, configured to perform image analysis on the at least one image frame to obtain image features of the input video; a transcoding parameter determination unit, configured to determine a target transcoding parameter for a transcoded target video; A prediction unit, configured to predict the resource usage required for the transcoding task of the input video and the acceptable memory usage for the transcoding task based on the image features of the input video and the target transcoding parameters; The scheduling unit is configured to schedule computing resources for the transcoding task based on the predicted resource occupancy and memory usage.

9. The device of claim 8, wherein: The image features of the input video include at least one of the following: Resolution; Bit rate; Image group size; Frame rate; Encoder type; Time complexity information; Space complexity information.

10. The device of claim 8, wherein: The target transcoding parameter includes at least one of the following: Target resolution, target bit rate, target frame rate, target encoding level.

11. The device of claim 8, wherein: Scheduling computing resources for the transcoding task based on the predicted resource occupancy and memory usage includes: Get the current processor occupancy and current memory usage of each server in the server cluster that performs the video transcoding task; By comparing the predicted resource occupancy and the current processor occupancy, the predicted memory usage and the current memory usage, respectively, a server that meets a predetermined scheduling condition is determined from the server cluster to process the transcoding task.

12. The device of claim 8, wherein: Predicting the resource occupancy and the memory usage based on the image features of the input video and the target transcoding parameters includes: Processing the image features of the input video and the target transcoding parameters using a trained machine learning model to output the resource usage and the memory usage, Among them, the input video to be transcoded is a live video, and the machine learning model is a regression model or a classification model.

13. The device of claim 12, wherein: The machine learning model is trained by: Determining a sample data set, wherein the sample data set includes a plurality of sample videos to be transcoded; For each sample video in the sample data set, Performing image analysis on the image frames in the sample video to determine sample image features of the sample video; Determining corresponding target transcoding parameters for the sample video; Transcoding the sample video according to the target transcoding parameters; Mark the actual resource usage required for the transcoding process of the sample video and the actual memory usage acceptable for the transcoding process; Inputting the sample image features into the machine learning model to obtain predicted resource usage and predicted memory usage; Adjust parameters of the machine learning model based on a first difference between the predicted resource occupancy and the actual resource occupancy and a second difference between the predicted memory usage and the actual memory usage.

14. The device of claim 13, wherein: The actual resource usage required for the transcoding process of the sample video and the actual memory usage acceptable for the transcoding process include: Increasing the number of multiple transcoding tasks that are executed in parallel to transcode the sample video based on the target transcoding parameters until at least one of the multiple transcoding tasks is stuck; Marking the resource usage and memory usage of the multiple transcoding tasks when the transcoding task of the sample video freezes; Determine the actual resource occupancy of each transcoding task based on the resource occupancy of the multiple transcoding tasks and the number of the multiple transcoding tasks; The actual memory usage is determined based on the server memory usage when the freeze occurs.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Video transcoding method and device, electronic equipment, storage medium and program product

    CN119520908A

  • Distributed video transcoding method and device, equipment and storage medium

    CN119603481A

  • Video transcoding task scheduling method and device, equipment and storage medium

    CN120455776A