Method and device for transcoding audio and video bitstream, electronic equipment and storage medium
By acquiring the quality data of audio and video bitstreams, analyzing and migrating transcoding tasks to suitable devices, the problem of unpredictable and unavoidable playback stuttering in existing technologies is solved, achieving more stable audio and video playback.
Patent Information
- Application Number
- CN202310350647.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-03-29
AI Technical Summary
Existing technologies cannot predict and avoid stuttering issues during the transcoding process of audio and video streams before viewers experience playback stuttering, leading to abnormal playback.
By acquiring the bitstream quality data of the target audio and video bitstream in the transcoding device processing link, we can analyze the factors that may cause playback stuttering and migrate the transcoding task to a transcoding device with higher processing power or stability.
It enables the prediction and prevention of buffering before it occurs on the viewer's client, improving the stability and quality of audio and video playback and avoiding playback buffering caused by network or equipment failure.
Smart Images

Figure CN116389799B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio and video processing technology, and in particular to a transcoding processing method, apparatus, electronic device and storage medium for audio and video streams. Background Technology
[0002] In recent years, with the widespread application of Real-Time Communication (RTC) technology in education, office work, entertainment, and social scenarios, applications such as online education, video conferencing, and live streaming have experienced explosive growth. Taking live streaming as an example, the audio and video streams are sent from the broadcaster's device, processed by an audio and video platform, and then distributed to the viewer's device. After the broadcaster sends the audio and video stream, but before the viewer receives it, the stream needs to be transcoded according to the viewer's specific needs before being distributed to their device. During the transcoding process, technical malfunctions in the network or transcoding equipment can frequently cause playback stuttering and other abnormalities on the viewer's device.
[0003] In related technologies, playback stuttering is typically detected only after the viewer's client reports that the playback is stuttering. The operation data of the playback node is then obtained to determine the cause of the stuttering and to eliminate such abnormal factors. However, it is impossible to predict the factors that may cause playback stuttering before the viewer experiences the audio and video stuttering, and it is also impossible to avoid the occurrence of playback stuttering. Summary of the Invention
[0004] This application provides a transcoding method, apparatus, electronic device, and storage medium for audio and video streams to solve one or more of the aforementioned technical problems.
[0005] In a first aspect, embodiments of this application provide a transcoding method for audio and video streams, including:
[0006] Acquire the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device;
[0007] Based on the acquired bitstream quality data, it is determined that the target audio and video bitstream has issues causing playback stuttering in the processing link of the first transcoding device.
[0008] A second transcoding device is selected whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device. The at least a portion of the transcoding tasks are then transferred to the second transcoding device for processing based on the second transcoding device.
[0009] Secondly, embodiments of this application provide an audio / video stream transcoding processing apparatus, comprising:
[0010] The quality data acquisition module is used to acquire the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device;
[0011] The problem factor determination module is used to determine, based on the acquired bitstream quality data, the problem factors that cause playback stuttering in the processing link of the target audio and video bitstream in the first transcoding device.
[0012] The transcoding task transcoding module is used to select a second transcoding device whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, and transcode the at least a portion of the transcoding tasks to the second transcoding device so as to process the transcoded transcoding tasks based on the second transcoding device.
[0013] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method described in any of the above-mentioned embodiments.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in any of the above-mentioned embodiments.
[0015] Compared with related technologies, this application has the following advantages:
[0016] According to the embodiments of this application, the bitstream quality data of the target audio / video bitstream at at least one time point in the processing link of the first transcoding device is first obtained. Bitstream (also known as data rate or bitrate) can be the amount of data used by an audio / video file per unit time, generally calculated in kb / s or Mb / s. At the same resolution, the larger the bitstream of the audio / video file, the higher the sampling rate per unit time, the higher the accuracy, and the higher the picture quality. By monitoring the bitstream quality data, the potential quality differences that may occur during the processing of the target audio / video bitstream by the transcoding device can be reflected. Furthermore, the processing link of the target audio / video bitstream can be adjusted based on these quality differences to ensure the processing quality of the target audio / video bitstream.
[0017] Based on the acquired bitstream quality data, it can be determined that there are factors causing playback stuttering in the processing link of the target audio and video bitstream in the first transcoding device. In other words, by comparing the differences in bitstream quality data at at least one time point under the set quality dimension, it is possible to determine the factors that may cause playback stuttering at different nodes in the processing link of the first transcoding device during the transcoding process of the target audio and video bitstream. This allows for the prediction of potential problems and the implementation of targeted measures to avoid such problems.
[0018] By selecting a second transcoding device whose audio / video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, at least a portion of the transcoding tasks are transferred to the second transcoding device for processing. The second transcoding device can have higher processing capabilities or stability than the first transcoding device. The at least a portion of the transcoding tasks can be transcoding tasks not processed by the first transcoding device, or it can be all transcoding tasks of the first transcoding device. Transferring at least a portion of the transcoding tasks to the second transcoding device allows the use of a transcoding device with higher processing capabilities or stability to process the transcoding tasks, ensuring the processing quality of the target audio / video bitstream and avoiding potential playback stuttering issues.
[0019] By taking the above steps, acquiring quality data, identifying problem factors, and performing transcoding tasks, the above solution can identify potential problem factors that may cause stuttering before the client experiences stuttering, and migrate the video stream with the problem factor to a suitable transcoding device to prevent potential stuttering.
[0020] Meanwhile, this application embodiment can acquire bitstream quality data of the target audio / video bitstream at multiple time points in the processing link. This bitstream quality data can be stored in a bitstream quality data set, which may include the acquired bitstream quality data at multiple time points in the processing link, the bitstream quality data collected before the target audio / video bitstream is pushed to the first transcoding device, and the bitstream quality data collected after the target audio / video bitstream is pushed from the first transcoding device to other devices. This allows for the connection of the upstream and downstream of the target audio / video bitstream transcoding processing link, and enables the monitoring of bitstream quality data at different time points in the processing link as a whole, allowing for a systematic quality perception of the transcoding processing link.
[0021] Furthermore, in this embodiment, based on the popularity information of the target audio / video stream, if it is determined that the target popularity information of the target audio / video stream is not lower than a set first popularity level, and the first transcoding device is an edge device in the transcoding cluster, then a second transcoding device whose audio / video stream processing capability matches at least a portion of the transcoding tasks of the first transcoding device is selected, and at least a portion of the transcoding tasks are transferred to the second transcoding device for processing. That is, taking a live streaming scenario as an example, if the number of online viewers of the target audio / video stream is large, exceeding the set first popularity level, in order to avoid subsequent transcoding tasks from becoming choppy, not only will the current transcoding task of the audio / video stream be transferred to a transcoding device with higher processing capability, but subsequent transcoding tasks will also be prevented from being scheduled to edge devices in the same transcoding cluster (here, edge devices can be regarded as abnormal nodes in the live stream), so as to avoid choppy audio / video streams with high popularity levels.
[0022] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0023] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.
[0024] Figure 1 This illustration shows an architectural diagram of an application scenario for the audio and video stream transcoding processing scheme provided in the embodiments of this application.
[0025] Figure 2 This paper illustrates a flowchart of an application scenario for the audio and video stream transcoding processing scheme provided in the embodiments of this application.
[0026] Figure 3 A flowchart of a transcoding method for audio and video streams provided in an embodiment of this application is shown;
[0027] Figure 4 This invention illustrates a structural block diagram of an audio / video stream transcoding processing apparatus provided in an embodiment of this application; and
[0028] Figure 5 A block diagram of an electronic device used to implement embodiments of this application is shown. Detailed Implementation
[0029] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0030] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.
[0031] In a related technology prior to this application, after a client-side stutter occurs in the audio / video stream, the root cause of the anomaly is determined by comparing the runtime data of the audio / video stream within a certain period before and after the stutter. However, this approach is not designed for the upstream and downstream of the audio / video stream transcoding chain, lacks a systematic quality awareness, and cannot migrate the audio / video stream to a suitable transcoding device before the client-side stutter occurs.
[0032] In another related technology prior to this application, when the client reports that stuttering has occurred in the audio / video stream, the runtime data of the playback node is obtained, features are extracted from the runtime data and compared with the features of the runtime data when the playback node previously experienced an anomaly, and the cause of the stuttering is determined based on the comparison result. This solution cannot migrate the audio / video stream to a suitable transcoding device before the client experiences stuttering, and the determination of the cause of the stuttering must be based on previously experienced stuttering data. Even after determining the cause of the anomaly, it cannot automatically migrate the audio / video stream to other devices, nor can it prevent subsequent tasks from being scheduled to the same abnormal playback node.
[0033] In view of this, embodiments of this application provide a new transcoding processing scheme for audio and video streams to solve all or part of the above-mentioned technical problems.
[0034] This application relates to an audio / video stream transcoding processing scheme, which can be applied to scenarios such as live audio / video streaming or audio / video communication (e.g., online education, video conferencing). The audio / video stream transcoding module involved can be deployed on the server side. In the scenario of live audio / video streaming, the audio / video stream transcoding processing scheme provided in this application can be used to analyze the bitstream quality data of the real-time transmitted audio / video stream at multiple time points in the processing link. Based on the analysis results, the factors causing playback stuttering in the processing link can be identified. Then, by selecting a transcoding device whose audio / video stream processing capabilities match the transcoding task, the audio / video stream transcoding task can be migrated to that transcoding device for processing. Since the transcoding task is migrated to a matching transcoding device when the factors causing playback stuttering are discovered by analyzing the bitstream data, this scheme can migrate the audio / video stream to a suitable transcoding device before stuttering occurs on the client side, thus preventing potential stuttering on the client side. Meanwhile, this solution can systematically assess the quality of the upstream and downstream of the audio and video stream transcoding link, and can automatically migrate the current transcoding task of the audio and video stream to other devices. It can also prevent subsequent transcoding tasks from being scheduled to the same abnormal playback node. It is understood that the audio and video stream transcoding processing solution provided in this application embodiment can also be applied to offline processing scenarios to transcode offline audio and video streams.
[0035] Figure 1This is an exemplary architectural diagram illustrating an application scenario for implementing the audio / video stream transcoding processing scheme provided in the embodiments of this application. For example... Figure 1 As shown, the transcoding system architecture used in the transcoding of audio and video streams and related upstream and downstream processing links can be mainly divided into four parts: live streaming center, live streaming awareness service, core scheduling, and infrastructure. The live streaming center is primarily responsible for communicating with the audio and video platform, distributing the audio and video streams obtained from the platform to transcoding devices, receiving the transcoded audio and video streams from the transcoding devices, and pushing the transcoded audio and video streams back to the audio and video platform. The live streaming awareness service can acquire data from all relevant processing links in the live streaming center, core scheduling, and infrastructure, and make corresponding scheduling decisions based on this data. For example, by acquiring and comparing the quality data of the audio and video streams at different time points in the processing links, it can decide whether to migrate the audio and video stream to a more suitable transcoding device. The core scheduling is mainly used to schedule transcoding tasks or transcoding processing devices, and the scheduling can be based on the scheduling decisions of the live streaming awareness service. The infrastructure mainly consists of processing devices for transcoding audio and video streams, which can include cloud processing devices and local processing devices.
[0036] Specifically, the live streaming center is mainly used to receive audio and video streams sent by broadcaster user devices or transmitted from audio and video platforms. The live streaming center can obtain the number of online viewers (popularity, which can determine whether the audio and video stream belongs to a hot stream and its level), the frame rate or PTS (display timestamp) and other quality data of the audio and video stream input to the live streaming center (hereinafter referred to as "source stream"), and the frame rate or PTS and other quality data of the audio and video stream output from the live streaming center to the transcoding device (hereinafter referred to as "transcoded stream"). For example, the live streaming center can perform super hot stream event distribution, source stream input frame rate query, hot stream level query, transcoded stream output frame rate query, and stream interruption reconstruction, etc. The core scheduling component can be used to schedule transcoding tasks or transcoding processing devices. For example, in managing transcoding tasks, it can redirect corresponding transcoding tasks according to the task migration module list in the live streaming awareness service, following the instructions of the live streaming awareness service. This can be done by redirecting the tasks to devices with higher processing capabilities in the transcoding cluster (such as the central device of the cluster), to other devices in the transcoding cluster (e.g., transcoding in the sales area), or to devices with lower audio / video stream processing capabilities (e.g., edge devices in the cluster). The infrastructure refers to the processing devices that transcode audio / video streams. Since the infrastructure typically consists of multiple processing devices, which can be deployed locally or in the cloud, the infrastructure can provide elastic services (computing power, storage, and network resources, etc.) based on these processing devices. Simultaneously, it can monitor virtual computing servers in the cloud, perform real-time monitoring using logs as the primary data source, and conduct non-intrusive log monitoring to obtain relevant information about the processing devices in the infrastructure. This information is then sent to the live streaming awareness service to promptly identify potential transcoding stuttering issues caused by abnormal processing devices.
[0037] The live streaming awareness service is the core of this solution. It acquires data from all relevant processing links in the live streaming center, core scheduling, and infrastructure. Based on this data, it identifies which nodes are causing playback stuttering and makes decisions about whether to migrate transcoding tasks to a suitable transcoding device, and which transcoding device to migrate to. The live streaming awareness service is implemented through four modules: the live streaming center hot stream event handling module, the engine reporting stuttering event handling module, the infrastructure event handling module, and the task migration module. These modules acquire and analyze data from all relevant processing links in the live streaming center, core scheduling, and infrastructure to determine whether to migrate the corresponding audio and video streams to a suitable transcoding device. The live streaming center hot stream event handling module communicates with the live streaming center to obtain data such as hot stream delivery events and source / transcoding stream frame rates. The engine reporting stuttering event handling module can communicate with the core scheduler and infrastructure to obtain relevant data and determine whether there are stuttering events such as encoding stuttering events, streaming stuttering events, pushing streaming stuttering events, high CPU usage events, high LOAD (load, the average CPU consumption of a computing device over a certain period of time) events, high memory usage events, limited network bandwidth events, and special template stuttering events. The infrastructure event handling module can communicate with the infrastructure to obtain proactive maintenance events, system installation failure events, system crash events, virtual machine migration events, container eviction events, and container maintenance events obtained through infrastructure monitoring. The aforementioned three modules can transfer the acquired data to the task migration module. The task migration module determines whether to migrate transcoding tasks related to this data, i.e., whether to reassign transcoding tasks to other processing devices. Reasons for migrating transcoding tasks can include hot stream pulling stuttering events, hot stream pushing stuttering events, hot stream transcoding stuttering events, ultra-hot stream events at edge processing devices, engine-reported hot stream transcoding stuttering events, engine-reported hot stream pulling stuttering events, engine-reported hot stream pushing stuttering events, engine-reported cold stream stuttering events, and infrastructure anomalies awaiting migration. In addition, the live streaming awareness service also includes a hot configuration center, a data analysis center, and a priority queue for tasks awaiting migration, used for analyzing relevant data and sorting transcoding tasks in the transcoding task queue.
[0038] Under the above architecture, the specific transcoding process for audio and video streams can be found in [link to relevant documentation]. Figure 2 The illustration shows a flowchart of an application scenario for an audio / video stream transcoding processing scheme provided in an embodiment of this application. For example... Figure 2As shown, firstly, the bitstream quality data of the audio and video streams at at least one time point in the processing link of the first transcoding device can be obtained. After the live broadcast center receives the audio and video streams sent by the broadcaster's user device or transmitted from the audio and video platform, it can receive global load balancing hot flow event notifications from the live broadcast center at certain time intervals (e.g., 30 seconds per cycle). These hot flow event notifications can include bitstream quality data such as the number of online viewers (popularity), frame rate, and PTS of the audio and video streams, and transmit this data to the live broadcast perception service. After receiving this data, the live broadcast perception service can query the distribution of transcoded streams from the livetranscode module (transcoding task scheduling module) of the core scheduling part, that is, which processing devices(s) are assigned to one or more transcoded streams corresponding to the same audio and video stream for transcoding processing. These processing devices can be referred to as "first transcoding devices", and the service can obtain the corresponding first transcoding device's operating data, as well as the transcoded stream's frame rate, PTS, and other bitstream quality data. The live broadcast perception service can then analyze and process the obtained quality data. Correspondingly, the method of determining the transcoded stream corresponding to the audio and video bitstream can be identified through attribute information such as the region identifier of the audio and video bitstream. This attribute information constitutes the unique ID of the audio and video bitstream. The live streaming perception service can query the distribution of transcoded streams with the same attribute information in the livetranscode module based on the attribute information of the audio and video bitstream.
[0039] Secondly, based on the acquired bitstream quality data, it can be determined that factors causing playback stuttering exist in the processing link of the audio and video bitstream at the first transcoding device. Based on the hot stream event notifications received from the live streaming center, the audio and video bitstreams can be divided into three levels of popularity: super hot stream, hot stream, and cold stream. This classification can be based on the number of viewers watching the audio and video bitstream. For example, audio and video bitstreams with more than 2000 viewers can be defined as "super hot stream" or "H3 or higher level hot stream"; audio and video bitstreams with 1000 to 2000 viewers can be defined as "hot stream" or "H2 level hot stream"; and video bitstreams with fewer than 1000 viewers can be defined as "cold stream" or "H1 level cold stream".
[0040] The subsequent migration judgment methods differ for audio and video streams of different levels. Specifically, for extremely popular streams, the judgment method is as follows: based on the popularity information corresponding to the audio and video stream, if it is determined that the target popularity information of the audio and video stream is not lower than the set first popularity level (which can be H3 or higher), and the first transcoding device is an edge device in the transcoding cluster, then a second transcoding device whose processing capability matches at least part of the transcoding tasks of the first transcoding device is selected, and at least part of the transcoding tasks are transferred to the second transcoding device for processing. In other words, if the audio and video stream is an extremely popular stream, and its corresponding transcoding stream is detected to be processed on the processing device of the edge cluster (the transcoding stream is in the edge cluster), then the transcoding stream can be transferred to the processing device of the central cluster for subsequent transcoding processing. In addition, for ultra-hot streaming, after the current transcoding task is redirected, all subsequent new transcoding tasks can be scheduled to the processing devices of other device clusters outside the edge cluster. For example, all subsequent new transcoding tasks can be scheduled to the processing devices of the central cluster to prevent playback stuttering of ultra-hot streaming due to insufficient audio and video processing capabilities of the edge cluster's processing devices.
[0041] For hot streams, the judgment method can be as follows: determine the difference data between at least two bitstream quality data in the bitstream quality data set, obtain two time points corresponding to the difference data, find the difference threshold configured for the two time points, and then determine that there are factors causing playback stuttering in the processing link of the audio / video bitstream on the first transcoding device if at least one difference data exceeds the difference threshold. After determining the problem factors, the number of times the audio / video bitstream has problems causing playback stuttering in the processing link of the first transcoding device can be counted. If the counted number exceeds the count threshold, it is decided to transfer the transcoding task to the corresponding second transcoding device. The bitstream quality data set here can include bitstream quality data at multiple time points in the obtained processing link, bitstream quality data collected before the audio / video bitstream is pushed to the first transcoding device, and bitstream quality data collected after the audio / video bitstream is pushed from the first transcoding device to other devices.
[0042] In other words, based on the aforementioned hot stream event notification received from the live streaming center, when the audio and video stream is identified as a hot stream, and one of its corresponding transcoding streams is located on the processing device of the edge cluster, the live streaming awareness service can query the live streaming center for the frame rate or PTS and other stream quality data of the audio and video streams, and query the edge node corresponding to the infrastructure part, i.e. the first transcoding device, for the frame rate or PTS and other stream quality data of the transcoding stream, in a 5-second cycle. If the frame rate (or PTS) of the audio and video stream and the transcoding stream exceeds the set threshold for several consecutive cycles, the transcoding stream will be added to the list to be migrated. For example, comparing the frame rate of the audio and video streams obtained from the live streaming center with the frame rate or PTS of the transcoding task assigned to the first transcoding device before transcoding, if the frame rate difference is greater than 3 frames / s or the edge difference of the PTS is greater than 3 seconds for three consecutive cycles (15s), then the transcoding link corresponding to the transcoding task can be judged as having streaming stuttering; comparing the frame rate of the transcoding task before transcoding with the frame rate after transcoding, if the transcoding stuttering is more than 3 frames / second for one consecutive cycle (5s), then it can be judged as transcoding stuttering; comparing the frame rate after transcoding... If the frame rate of the stream and the stream after transcoding are pushed back to the live streaming center are both considered to be stuttering, and if there are more than 3 frames per second of transcoding stuttering for one consecutive cycle (5s), then it can be determined as push streaming stuttering. If the frame rate or PTS of the audio / video stream obtained from the live streaming center is compared with the stream after transcoding is pushed back to the live streaming center, and if the difference in frame rate or the edge difference in PTS exceeds a certain threshold for three consecutive cycles (15s), such as a frame rate difference greater than 3 frames / s or a PTS edge difference greater than 3 seconds, then it can be determined as end-to-end push streaming stuttering. The above-mentioned pull streaming stuttering, transcoding stuttering, push streaming stuttering, and end-to-end push streaming stuttering are all factors that can be identified as causing playback stuttering in the processing link of the audio / video stream at the first transcoding device. After these factors occur, the transcoding task can be transferred to the processing device in the central cluster for subsequent transcoding processing.
[0043] For cold streams, if the above judgment methods may still result in issues such as streaming stuttering, transcoding stuttering, push streaming stuttering, or end-to-end push streaming stuttering that cause playback stuttering, the transcoding task can be temporarily not migrated; only an alarm can be triggered, and continuous monitoring can be performed.
[0044] Finally, a second transcoding device whose audio / video stream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device can be selected. At least a portion of the transcoding tasks are then transferred to the second transcoding device for processing. Specifically, selecting a second transcoding device whose audio / video stream processing capabilities match at least a portion of the transcoding tasks of the first transcoding server can be achieved by adding at least a portion of the transcoding tasks to a transcoding task queue and obtaining a list of candidate transcoding devices to handle the transferred tasks. The transcoding task queue is sorted according to at least one of the popularity and / or processing priority of the corresponding audio / video streams. The candidate transcoding devices in the list are then sorted according to their audio / video stream processing capabilities, and further sorted according to the transcoding tasks in the transcoding task queue. A second transcoding device whose audio / video stream processing capabilities match the transcoding tasks is then selected from the list of candidate transcoding devices. The specific migration steps can be as follows: First, the live streaming awareness service determines which processing devices to migrate the transcoded stream to for further processing based on the popularity of the transcoded stream and the comparison results of the corresponding bitstream quality data at different popularity levels, and then adds the transcoded stream to the migration list according to its popularity. The core scheduling part migrates the transcoded streams to the designated processing devices one by one according to the migration list, i.e., the background task calls the livetranscode module to migrate the transcoding task.
[0045] In addition, this solution can monitor infrastructure anomalies. Specifically, the live streaming awareness service can obtain relevant data from the infrastructure. If an infrastructure anomaly occurs, including machine downtime, container eviction, or proactive maintenance events, the corresponding processing device (hereinafter referred to as the "abnormal machine") can be marked offline (marked with an offline tag), indicating that the abnormal machine is about to be taken offline and preventing new transcoding tasks from being scheduled to it. Then, the live streaming awareness service can obtain the existing tasks of the abnormal machine from the infrastructure, i.e., all existing transcoding tasks. The live streaming awareness service then decides which processing devices(s) to migrate the existing transcoding tasks of the abnormal machine to, and adds the migration tasks to the migration list. The designated scheduling unit then migrates the existing transcoding tasks of the abnormal machine to the designated processing devices. After all transcoding tasks have been migrated, the abnormal machine is taken offline. Thus, this solution can connect with the infrastructure deployed by the transcoding service, enabling it to work in conjunction with the infrastructure, detect infrastructure anomalies, and thereby avoid the impact of infrastructure anomalies on the audio and video transcoding service, improving service quality.
[0046] The execution entity in this application embodiment can be an application, service, instance, functional module in software form, virtual machine (VM), container, or cloud server, or hardware device with data processing function (such as server or terminal device) or hardware chip (such as CPU, GPU, FPGA, NPU, AI accelerator card, or DPU). The device for implementing audio and video stream transcoding can be deployed on the computing device of the application providing the corresponding service or on a cloud computing platform providing computing power, storage, and network resources. The cloud computing platform can provide services in the following modes: IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software as a Service), or DaaS (Data as a Service). Taking SaaS (Software as a Service) as an example, the cloud computing platform can utilize its own computing resources to provide the functional execution of the audio and video stream transcoding module. The specific application architecture can be built according to service requirements. For example, the transcoding service, live streaming awareness service, or upstream and downstream services of the entire chain in the aforementioned solution of this application can all be deployed in the cloud.
[0047] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0048] The technical solution of this application and how it solves the aforementioned technical problems are described in detail below with specific embodiments. The listed specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0049] This application provides a transcoding method for audio and video streams, such as... Figure 3 The diagram shown is a flowchart of an audio / video stream transcoding method 300 according to an embodiment of this application. Method 300 may include:
[0050] In step S301, the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device is obtained.
[0051] According to the audio and video stream transcoding method provided in this application, the audio and video stream can be transcoded. By comparing the stream quality data at at least one time point in the set quality dimension of the transcoding process, it can be determined whether there are any factors causing playback stuttering in the audio and video stream processing chain. Therefore, before playback stuttering occurs on the viewer's client, at least a portion of the transcoding tasks on the first transcoding device is redirected to a second transcoding device that matches the at least a portion of the transcoding tasks, thereby avoiding potential client playback stuttering events. The target audio and video stream may include the audio and video stream in the transcoding process chain, or it may include audio and video streams upstream and downstream of the transcoding process chain; it may be the source audio and video stream to be transcoded in the transcoding chain, or it may be the transcoded stream entering the transcoding device. This application does not impose any limitations on this.
[0052] The transcoding devices involved in this application embodiment can be computing devices with transcoding capabilities. These transcoding devices can be deployed locally or in the cloud. All of the above-mentioned transcoding devices can be located in the central cluster, edge cluster, or other device clusters within a transcoding cluster. That is to say, a transcoding device can be a central device in a central cluster, an edge device in an edge cluster, or a transcoding device in another device cluster. Specifically, an edge cluster can be a deployment form where cloud computing capabilities are pushed down to the edge. It is a transcoding cluster closer to the user end. Compared to the central device in a central cluster, the computing power and stability of the edge device in an edge cluster may not be as strong. In contrast to the edge cluster, the central cluster is a transcoding cluster farther from the user end. The central device in a central cluster is easier to maintain, and the computing power and stability of the central device in a central cluster are better, and it can handle data that requires more computing power, storage, or network services. Other device clusters can refer to computing resources other than edge clusters and central clusters. These computing resources can be expanded by purchasing and have unlimited expansion capabilities. As described above, computing devices in edge clusters have lower stability but are closer to the user and therefore lower cost, while computing devices in central clusters have better stability but are farther from the user and therefore higher cost. Therefore, when using transcoding clusters to transcode target audio and video streams, it is preferable to prioritize using the lower-cost computing devices in edge clusters. However, if issues arise that might cause playback stuttering, the transcoding task can be transferred to the computing devices in the central cluster. Similarly, the transcoding task can be transferred to other computing devices in the more stable edge cluster, or other device clusters can be used to handle the transcoding task.
[0053] Transcoding refers to the function of converting the original audio and video stream into another audio and video stream. Transcoding can change the encoding format, resolution, bit rate, and other parameters of the original audio and video stream, thereby adapting to playback on different terminals and network environments, to accommodate different network bandwidths, different terminal processing capabilities, and different latency requirements, and to meet different user needs.
[0054] The audio and video stream processing chain involved in this application embodiment can include multiple time points such as streaming, transcoding, and transcoding pushback. By comparing the quality data of the same quality dimension of the stream at different time points, it is possible to infer whether there are potential factors causing playback stuttering. Streaming can be the process of pulling the audio and video stream from the audio and video platform into the audio and video stream processing chain, or it can be the process of pushing the audio and video stream encapsulated in the acquisition stage to the computing device upstream of the transcoding processing chain that communicates with the audio and video platform through audio and video broadcaster push. The audio and video stream pulled into the upstream processing chain is the source audio and video stream, that is, the stream acquired before being pushed to the transcoding device. The same source audio and video stream is pushed to different transcoding devices for transcoding according to the needs of different viewers. This can be referred to as a "transcoded stream." During this process, due to factors such as limited network bandwidth, the quality data of the transcoded stream distributed to the transcoding device may differ from that of the source audio and video stream, potentially causing streaming stuttering. Transcoding can be the process of transcoding the stream on a transcoding device. The quality data of the transcoded stream before and after transcoding may differ, potentially causing transcoding stuttering. Transcoding pushback is the process of pushing the transcoded stream back to the computing device downstream of the audio and video stream processing link that communicates with the audio and video platform. During this process, the quality data of the transcoded stream and the audio and video stream pushed back downstream of the audio and video stream processing link may differ, potentially causing streaming stuttering. In addition, comparing the quality data of the source audio and video stream with the transcoded audio and video stream pushed back downstream of the audio and video stream processing link may cause end-to-end streaming stuttering. Correspondingly, the "stuttering" here refers to situations that may cause playback stuttering, rather than actual stuttering experienced by the audience on the audio / video playback end (the audio / video frame rate that could cause playback stuttering for the audience on the audio / video playback end might be less than 10 frames / s). This solution can redirect the transcoding task to a suitable transcoding device for processing before the audience on the audio / video playback end experiences playback stuttering, thereby improving the user experience.
[0055] The bitstream quality data set may include bitstream quality data at multiple time points in the acquired processing link, bitstream quality data collected before the target audio / video bitstream is pushed to the first transcoding device, and bitstream quality data collected after the target audio / video bitstream is pushed from the first transcoding device to other devices.
[0056] Correspondingly, the bitstream quality dimension can refer to all quality dimensions related to audio and video bitstream quality data, such as the frame rate and PTS of the audio and video bitstream. Frame rate refers to the number of frames displayed per second in the audio and video bitstream; assuming the human eye can perceive this, a higher frame rate results in a smoother viewing experience. PTS (Presentation Time Stamp) refers to the timestamp at which the audio and video stream is displayed, indicating when the player should display that frame. Bitstream quality data can include all data related to the audio and video bitstream, such as whether the frame rate is 30 frames / s or 20 frames / s, or whether the PTS is 3 seconds or 6 seconds.
[0057] Optionally, to obtain the bitstream quality data of the target audio / video bitstream at at least one time point in the processing link of the first transcoding device, one can first determine at least one audio / video bitstream corresponding to the source audio / video bitstream (the transcoded stream corresponding to the source audio / video bitstream). Different audio / video bitstreams may correspond to different data formats. Then, using at least one of these audio / video bitstreams as the target audio / video bitstream, the bitstream quality data of the target audio / video bitstream at at least one time point in the processing link of the first transcoding device is obtained. Alternatively, one can first determine a certain audio / video bitstream (transcoded stream) in the first transcoding device as the target audio / video bitstream, then determine the corresponding source audio / video bitstream through the target audio / video bitstream, and then obtain the bitstream quality data of the target audio / video bitstream and the corresponding source audio / video bitstream at at least one time point in the processing link of the first transcoding device, and then compare the bitstream quality data. The correspondence between the target audio / video bitstream and the source audio / video bitstream can be determined through attribute information such as the region identifier of the audio / video bitstream. This attribute information constitutes a unique ID for the target audio / video bitstream and the source audio / video bitstream.
[0058] In step S302, based on the acquired bitstream quality data, it is determined whether the target audio / video bitstream has any issues causing playback stuttering in the processing link of the first transcoding device. This can be achieved by comparing the bitstream quality data acquired at different time points in the preceding steps, such as pull streaming, transcoding, and transcoding pushback. Further comparison can be made between two or more time points, focusing on the differences in quality data within the same quality dimension. Based on set conditions, it is determined whether the target audio / video bitstream has any issues causing playback stuttering in the processing link of the first transcoding device. These issues can refer to the aforementioned pull streaming stuttering, transcoding stuttering, push streaming stuttering, or end-to-end push streaming stuttering; they can also be determined based on the popularity of the audio / video bitstream, identifying that the target audio / video bitstream exceeding a set popularity threshold is not being processed on a device with strong processing capabilities or high stability; or they can be determined based on data parameters of the transcoding device obtained from the transcoding cluster, identifying whether the target transcoding device has any issues that might cause playback stuttering, such as high CPU usage on the target transcoding device. Therefore, after identifying these problematic factors, the corresponding transcoding tasks can be transferred to suitable processing devices for further processing, thereby avoiding actual playback stuttering.
[0059] In one possible implementation, the method described above for determining that the target audio / video bitstream has a problem factor causing playback stuttering in the processing link of the first transcoding device based on the acquired bitstream quality data can be achieved by determining the difference data between at least two bitstream quality data in the bitstream quality data set, simultaneously obtaining two time points of the two bitstream quality data corresponding to the difference data, finding the difference threshold configured for the two time points, and then determining that the target audio / video bitstream has a problem factor causing playback stuttering in the processing link of the first transcoding device based on at least one difference data exceeding the difference threshold.
[0060] In some embodiments, the bitstream quality data set in the above-described manner may include bitstream quality data at multiple time points in the acquired processing link, bitstream quality data collected before the target audio / video bitstream is pushed to the first transcoding device, and bitstream quality data collected after the target audio / video bitstream is pushed from the first transcoding device to other devices.
[0061] Specifically, the difference thresholds configured for different time points can be adjusted based on actual needs or empirical data. For example, in cases of streaming stuttering, the difference in bitrate data between the original source audio / video stream and the transcoded stream distributed to the transcoding device can be compared. The set difference threshold could be a frame rate difference greater than 3 frames / s, or a PTS difference greater than 3 seconds. Alternatively, the difference threshold could be a frame rate difference greater than 4 frames / s, or a PTS difference greater than 4 seconds. If any one of these quality data differences exceeds the set threshold, it can be determined that there is a factor causing playback stuttering. For transcoding stuttering and streaming stuttering, the difference between the transcoded stream before and after transcoding can be compared. The frame rate difference between the bitstream and the audio / video bitstream pushed back to the processing device communicating with the audio / video platform within a certain time period can be defined as follows: if the frame rate difference is greater than 3 frames per second for 5 consecutive seconds, it can be determined as transcoding stuttering or streaming stuttering. For the case of end-to-end streaming stuttering, the difference in bitstream quality data between the original source audio / video bitstream and the transcoded audio / video bitstream pushed back to the processing device communicating with the audio / video platform can be compared. The difference threshold can be that the frame rate difference is greater than 3 frames / second and / or the difference in PTS is greater than 3 seconds. If one of these conditions is met or both of the quality data differences in the two quality dimensions are greater than the set threshold, it can be determined that there are factors causing playback stuttering.
[0062] The bitstream quality data at multiple time points in the processing link can refer to the quality data of the transcoded stream before or after transcoding by the first transcoding device; the bitstream quality data collected before the target audio / video bitstream is pushed to the first transcoding device can refer to the bitstream quality data of the source audio / video bitstream obtained from the audio / video platform or pushed by the audio / video broadcaster on the processing device communicating with the audio / video platform during the streaming process; the bitstream quality data collected after the target audio / video bitstream is pushed from the first transcoding device to other devices can refer to the bitstream quality data of the audio / video bitstream pushed back to the processing device communicating with the audio / video platform by the first transcoding device after transcoding processing.
[0063] Optionally, after determining, based on the acquired bitstream quality data, that the target audio and video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the number of times the target audio and video bitstream has issues causing playback stuttering in the processing link of the first transcoding device can be counted. If the counted number exceeds the threshold, at least part of the transcoding tasks can be transferred to the second transcoding device for processing.
[0064] For example, a certain time range can be set as a period. Within each period, if the target audio / video bitstream has a problem causing playback stuttering in the processing link of the first transcoding device, this can be counted as one instance. If the problem causes playback stuttering in multiple consecutive periods, at least a portion of the transcoding tasks can be transferred to a second transcoding device for processing. The specific threshold for this can be three instances. For instance, a 5-second time range can be set as a period. If a problem causing playback stuttering exists in three consecutive periods (15 seconds), and the first period might be due to a frame rate difference exceeding a set threshold, while the second and third periods might be due to a PTS difference exceeding a set threshold, then it can be determined that the number of times the target audio / video bitstream has had a problem causing playback stuttering in the processing link of the first transcoding device exceeds the threshold, and thus at least a portion of the transcoding tasks are transferred to a second transcoding device for processing. Of course, in the above example, the frame rates compared at the same time point in the three periods may all differ by more than a set threshold, or the bitstream quality data compared at different time points in the three periods may differ by more than a set threshold. For example, there may be stuttering during the first period, stuttering during the second period, and stuttering during the third period. This application does not impose any restrictions on this.
[0065] In step S303, a second transcoding device is selected whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, and at least a portion of the transcoding tasks are transferred to the second transcoding device for processing based on the second transcoding device.
[0066] The first transcoding device can refer to the initial transcoding device that performs the transcoding task, or it can refer to the current transcoding device that performs the transcoding task after modulation. The second transcoding device can be any other transcoding device besides the first transcoding device that performs subsequent processing on the same transcoding task. Compared with the first transcoding device, the second transcoding device can have stronger processing capabilities and higher stability for audio and video streams. The strength or stability of the transcoding device can be determined by comparing CPU / GPU computing power, the age of the transcoding device, etc. Accordingly, the second transcoding device and the first transcoding device can be different devices in the same transcoding cluster, such as belonging to the central cluster or the edge cluster, or they can be devices in different transcoding clusters, such as the second transcoding device belonging to the central cluster and the first transcoding device belonging to the edge cluster. This application does not impose any restrictions in this regard.
[0067] The method of transferring at least a portion of transcoding tasks to a second transcoding device can be achieved through smooth migration. Smooth migration means that the processing of transcoding tasks can be seamlessly continued before and after the transfer to the second transcoding device, without data loss. Furthermore, the second transcoding device can resume processing the same transcoding task from where the first transcoding device left off. Since the transcoding devices in this solution can communicate directly, the aforementioned smooth migration process can be achieved. Specifically, in this embodiment, the live streaming awareness service can send a smooth migration switching command to the core scheduling part. The core scheduling part then sends a stop task instruction to the first transcoding device and a start task instruction to the second transcoding device. After receiving the stop task instruction, the first transcoding device will delay and exit the transcoding task processing. Before exiting, it will synchronize relevant transcoding task data (such as streaming information, transcoding information, etc.) to the second transcoding device. During this period, the first transcoding device will also send the synchronization message to the slave task of the second transcoding device. After receiving the message, the slave will forward the message to the master task of the second transcoding device. After the first transcoding device completes the synchronization of transcoding task-related data, the slave stops forwarding messages, thus confirming that the synchronization transcoding task is complete.
[0068] In one possible implementation, selecting a second transcoding device whose audio / video stream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device can be achieved by first adding at least a portion of the transcoding tasks to a transcoding task queue and obtaining a list of candidate transcoding devices that can undertake the transcoding tasks. This transcoding task queue can be sorted according to the popularity and / or processing priority of the corresponding audio / video streams. The candidate transcoding devices in this list can be sorted according to their audio / video stream processing capabilities. Then, the transcoding devices are sorted according to the transcoding tasks in the transcoding task queue, and a second transcoding device whose audio / video stream processing capabilities match the transcoding tasks is selected from the list of candidate transcoding devices.
[0069] In this embodiment, the transcoding task queue can be deployed in the live streaming awareness service portion of the architecture. This transcoding task queue can be a processing module within the live streaming awareness service, specifically designed for sorting transcoding tasks. The sorting method can be based on the popularity and / or priority of the target audio / video stream corresponding to the transcoding task. The core scheduling component in this architecture can sequentially transcode the tasks according to the transcoding task queue. Simultaneously, the live streaming awareness service portion can also obtain a list of candidate transcoding devices for the transcoding tasks. These candidate transcoding devices can be sorted according to their audio / video stream processing capabilities, and further sorted according to the transcoding tasks in the transcoding task queue. A second transcoding device whose audio / video stream processing capability matches the target transcoding task in the transcoding task queue can be selected from the list of candidate transcoding devices.
[0070] In some embodiments, at least some transcoding tasks can be determined by, when searching for other audio and video streams on the first transcoding device whose corresponding heat information is greater than the target heat information of the target audio and video stream, treating the transcoding tasks corresponding to the target audio and video stream and the other searched audio and video streams as transcoding tasks to be transcoded. For example, if the target video stream has a hot stream heat information, and it can be determined through the aforementioned method that there are factors causing playback stuttering in the processing link of the target audio and video stream on the first transcoding device, then for other audio and video streams with heat information greater than the hot stream heat information (such as ultra-hot streams), if processing continues on the first transcoding device, there is a high probability that such factors causing playback stuttering will also occur. In this case, the transcoding tasks corresponding to the target audio and video stream and the other searched audio and video streams can all be treated as transcoding tasks to be transcoded. Similarly, if the target video stream heat information is a cold stream heat information, then the transcoding tasks corresponding to other hot streams, ultra-hot streams, and other audio and video streams on the first transcoding device, along with the transcoding tasks corresponding to the cold streams, can all be treated as transcoding tasks to be transcoded.
[0071] The at least some transcoding tasks involved in the embodiments of this application may be some or all of the transcoding tasks in the same transcoding task in the same first transcoding device, or some or all of the transcoding tasks in different transcoding tasks in different first transcoding devices. This application does not impose any restrictions on this.
[0072] In other embodiments, at least some transcoding tasks may be determined by taking all transcoding tasks on the first transcoding device as transcoding tasks to be transcoded if an abnormal operation event is detected in the first transcoding device.
[0073] Among them, abnormal events in the operation of the transcoding device can refer to events such as high CPU usage, high LOAD (load, the average CPU consumption of the calculation device within a certain period of time), high memory usage, limited network bandwidth, and special template stuttering events on the first transcoding device obtained by the engine reporting stuttering event processing module in the architecture of this application embodiment, or active maintenance events, system installation failure events, system crash events, virtual machine migration events, container eviction events, container maintenance events, QUOTA (resource consumption record, when a task or process consumes CPU during runtime, it can be expressed as %CPU), container crashes, container evictions, and other abnormal events.
[0074] When the aforementioned operational anomaly occurs, it indicates that the first transcoding device itself may have experienced an infrastructure-level failure, making it unsuitable for continuing to process transcoding tasks. Therefore, by marking the first transcoding device offline (adding an offline tag), it can be indicated that the abnormal machine is about to be taken offline, preventing new transcoding tasks from being scheduled to this machine. Then, all transcoding tasks on the first transcoding device are added to the transcoding task queue as transcoding tasks awaiting transfer. A smooth migration method can then be used to transfer these transcoding tasks to the second transcoding device. After the transfer is completed, the first transcoding device is taken offline. This avoids the impact of infrastructure failures on the transcoding service of the target audio and video streams, improving service quality.
[0075] In one possible implementation, before determining, based on the acquired bitstream quality data, whether the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the corresponding popularity information of the target audio / video bitstream can be obtained to determine if the target popularity information is lower than a set first popularity level. When the target popularity information of the target audio / video bitstream is lower than the set first popularity level, the aforementioned scheme can be used to determine the issues causing playback stuttering in the processing link of the first transcoding device; when the target popularity information of the target audio / video bitstream is higher than or equal to the set first popularity level, other schemes can be used to determine the issues causing playback stuttering in the processing link of the first transcoding device. The aforementioned first popularity level can be set as needed, and this application does not impose any restrictions on it.
[0076] Correspondingly, the first popularity level can be set as "super hot stream". As mentioned earlier, audio and video streams with more than 2,000 online viewers can be set as "super hot stream". When the target popularity information of the target audio and video stream is lower than the set first popularity level, such as hot stream and cold stream, the aforementioned scheme can be used to determine the factors causing playback stuttering in the processing link of the target audio and video stream in the first transcoding device. For target audio and video streams that are super hot streams or have popularity information higher than super hot streams, other schemes can be used to determine the factors causing playback stuttering in the processing link of the target audio and video stream in the first transcoding device.
[0077] Specifically, if it is determined that the target popularity information of the target audio / video stream is not lower than the set first popularity level, and the first transcoding device is an edge device in the transcoding cluster, then a second transcoding device whose audio / video stream processing capability matches at least part of the transcoding tasks of the first transcoding device can be selected. At least part of the transcoding tasks can then be transferred to the second transcoding device for processing. For example, if the first transcoding device currently processing the audio / video stream is an edge device in the transcoding cluster (i.e., a processing device located in the edge cluster), the transcoding tasks corresponding to the audio / video stream can be directly transferred to the second transcoding device located in the central cluster for subsequent transcoding processing.
[0078] In addition, for super hot streams or other audio and video streams with a higher popularity level, after the current transcoding task is rerouted, all subsequent new transcoding tasks can be scheduled to the processing devices of the central cluster or other device clusters outside the edge cluster. For example, all subsequent new transcoding tasks can be scheduled to the processing devices of the central cluster to prevent playback stuttering of super hot streams due to insufficient processing capacity of audio and video streams in the edge cluster.
[0079] In one possible implementation, the first transcoding device can be configured not to schedule other audio and video streams with higher popularity information than the target popularity information, based on the target popularity information corresponding to the target audio and video stream.
[0080] When the aforementioned scheme determines that the target audio / video stream has factors causing playback stuttering in the processing link of the first transcoding device, the first transcoding device can be configured not to schedule other audio / video streams with higher popularity information than the target popularity information, based on the target popularity information corresponding to the target audio / video stream. That is, if the current target audio / video stream is a super-hot stream, the first transcoding device can be configured not to schedule other super-hot streams or other audio / video streams with popularity information exceeding super-hot streams; if the current target audio / video stream is a hot stream, the first transcoding device can be configured not to schedule other super-hot streams; if the current target audio / video stream is a cold stream, the first transcoding device can be configured not to schedule other hot streams or super-hot streams. Since the first transcoding device has issues that cause playback stuttering when processing target audio and video streams with the target popularity, it may be even more likely to cause playback stuttering when newly imported audio and video streams have a higher popularity than the target. Therefore, the first transcoding device can be configured not to schedule other audio and video streams with higher popularity than the target, thereby ensuring the transcoding quality of audio and video streams and improving the user experience.
[0081] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide an audio / video stream transcoding processing apparatus. For example... Figure 4 The diagram shown is a structural block diagram of an audio / video stream transcoding processing apparatus 400 according to an embodiment of this application. The apparatus 400 may include:
[0082] The quality data acquisition module 401 is used to acquire the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device.
[0083] The problem factor determination module 402 is used to determine, based on the acquired bitstream quality data, the problem factors that cause playback stuttering in the processing link of the target audio and video bitstream in the first transcoding device.
[0084] The transcoding task transcoding module 403 is used to select a second transcoding device whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, and transcode the at least a portion of the transcoding tasks to the second transcoding device so as to process the transcoded transcoding tasks based on the second transcoding device.
[0085] In one possible implementation, the aforementioned problem factor determination module 402 may include:
[0086] The difference data determination submodule is used to determine the difference data between at least two bitstream quality data in the bitstream quality data set. The bitstream quality data set may include bitstream quality data at multiple time points in the acquired processing link, bitstream quality data collected before the target audio / video bitstream is pushed to the first transcoding device, and bitstream quality data collected after the target audio / video bitstream is pushed from the first transcoding device to other devices.
[0087] The difference threshold lookup submodule is used to obtain two time points of the two bitstream quality data corresponding to the difference data, and to find the difference threshold configured for the two time points.
[0088] The problem factor determination submodule is used to determine, based on at least one difference data exceeding the difference threshold, that there are problem factors causing playback stuttering in the processing link of the target audio and video bitstream in the first transcoding device.
[0089] In some embodiments, after determining, based on the acquired bitstream quality data, that the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the above apparatus may further include:
[0090] The problem factor frequency statistics submodule is used to count the number of times that the target audio and video bitstream has problem factors that cause playback stuttering in the processing link of the first transcoding device.
[0091] The "Count Threshold Exceeds Determination" submodule is used to determine if the counted number of times exceeds the count threshold.
[0092] In one possible implementation, the aforementioned transcoding task conversion module 403 may include:
[0093] The transcoding task adding submodule is used to add at least some of the transcoding tasks to the transcoding task queue and obtain a list of candidate transcoding devices that will undertake the transcoding tasks. The transcoding task queue is sorted according to at least one of the popularity and / or processing priority of the corresponding audio and video bitstreams, and the candidate transcoding devices in the list are sorted according to their audio and video bitstream processing capabilities.
[0094] The transcoding device selection submodule is used to select a second transcoding device from the list of candidate transcoding devices, based on the transcoding tasks in the transcoding task queue, whose audio and video bitstream processing capabilities match the transcoding tasks.
[0095] In one possible implementation, the aforementioned transcoding task conversion module 403 may include the following sub-module for determining at least a portion of the transcoding task:
[0096] The task lookup submodule is used to find other audio and video streams on the first transcoding device whose corresponding popularity information is greater than the target popularity information corresponding to the target audio and video stream.
[0097] The transcoding task determination submodule is used to identify the target audio / video stream and the transcoding tasks corresponding to other searched audio / video streams as transcoding tasks to be transcoded.
[0098] In another possible implementation, the aforementioned transcoding task conversion module 403 may include the following sub-module for determining at least a portion of the transcoding task:
[0099] The transcoding device anomaly detection submodule is used to treat all transcoding tasks on the first transcoding device as transcoding tasks to be transcoded if an abnormal operation event is detected in the first transcoding device.
[0100] In one possible implementation, before determining, based on the acquired bitstream quality data, that the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the apparatus may further include:
[0101] The transcoding task popularity determination module is used to obtain the target popularity information corresponding to the target audio and video bitstream, and determine that the target popularity information of the target audio and video bitstream is lower than the set first popularity level.
[0102] In some embodiments, the transcoding task popularity determination module may further include:
[0103] The transcoding task transcoding submodule is used to select a second transcoding device whose audio / video stream processing capability matches at least a portion of the transcoding tasks of the first transcoding device if it is determined that the target popularity information of the target audio / video stream is not lower than a set first popularity level, and the first transcoding device is an edge device in the transcoding cluster. The at least a portion of the transcoding tasks are transcoded to the second transcoding device so that the transcoded transcoding tasks are processed based on the second transcoding device.
[0104] In one possible implementation, the above-mentioned apparatus may further include:
[0105] The non-scheduling configuration module is used to configure the first transcoding device to not schedule other audio and video streams with higher heat information than the target heat information, based on the target heat information corresponding to the target audio and video stream.
[0106] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.
[0107] Figure 5This is a block diagram of an electronic device used to implement embodiments of this application. Figure 5 As shown, the electronic device includes a memory 501 and a processor 502. The memory 501 stores a computer program that can run on the processor 502. When the processor 502 executes the computer program, it implements the method described in the above embodiments. The number of memories 501 and processors 502 can be one or more.
[0108] The electronic device also includes:
[0109] The communication interface 503 is used to communicate with external devices and perform data exchange and transmission.
[0110] If the memory 501, processor 502, and communication interface 503 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0111] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.
[0112] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.
[0113] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform the method provided in this application.
[0114] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.
[0115] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.
[0116] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0117] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0118] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0119] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0120] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0121] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0122] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0123] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0124] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A transcoding method for audio and video streams, comprising: Acquire the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device; The time points include: the time points during the pull streaming phase, the time points during the transcoding phase, and the time points during the push streaming phase; Based on the acquired bitstream quality data, it is determined that the target audio and video bitstream has a problem factor causing playback stuttering in the processing link of the first transcoding device; the problem factor includes at least one of the following: streaming stuttering, transcoding stuttering, streaming stuttering, and end-to-end streaming stuttering; the method for determining the problem factor includes: determining the difference data between at least two bitstream quality data, obtaining two time points of the two bitstream quality data corresponding to the difference data, finding the difference threshold configured for the two time points, and then determining the problem factor based on at least one difference data exceeding the difference threshold; A second transcoding device is selected whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device. The at least a portion of the transcoding tasks are then transferred to the second transcoding device for processing. The processing capability or stability of the second transcoding device is higher than that of the first transcoding device.
2. The method according to claim 1, wherein, The step of determining, based on the acquired bitstream quality data, that the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device includes: Determine the difference data between at least two bitstream quality data in the bitstream quality data set, wherein the bitstream quality data set includes bitstream quality data at multiple time points in the acquired processing link, bitstream quality data collected before the target audio and video bitstream is pushed to the first transcoding device, and bitstream quality data collected after the target audio and video bitstream is pushed from the first transcoding device to other devices; Obtain two time points of the two bitstream quality data corresponding to the difference data, and find the difference threshold configured for the two time points; Based on at least one difference data exceeding the difference threshold, it is determined that the target audio / video bitstream has a problem factor causing playback stuttering in the processing link of the first transcoding device.
3. The method according to claim 2, wherein, After determining, based on the acquired bitstream quality data, that the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the method further includes: The number of times that the target audio and video bitstream has problems causing playback stuttering in the processing link of the first transcoding device is counted; It was determined that the number of counts exceeded the count threshold.
4. The method according to claim 1, wherein, The second transcoding device, whose audio / video stream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, includes: The at least some transcoding tasks are added to the transcoding task queue, and a list of candidate transcoding devices that undertake the transcoding tasks is obtained. The transcoding task queue is sorted according to the popularity and / or processing priority of the corresponding audio and video streams, and the candidate transcoding devices in the list are sorted according to the audio and video stream processing capabilities. According to the transcoding tasks in the transcoding task queue, a second transcoding device whose audio and video bitstream processing capabilities match the transcoding task is selected from the list of candidate transcoding devices.
5. The method according to claim 1, wherein, The at least part of the transcoding task is determined through the following steps: Find other audio and video streams on the first transcoding device whose corresponding heat information is greater than the target heat information corresponding to the target audio and video stream; The transcoding tasks corresponding to the target audio / video stream and other searched audio / video streams are used as transcoding tasks to be transcoded.
6. The method according to claim 1, wherein, The at least part of the transcoding task is determined through the following steps: If an abnormal operation event is detected in the first transcoding device, all transcoding tasks on the first transcoding device will be treated as transcoding tasks to be transcoded.
7. The method according to claim 1, wherein, Before determining, based on the acquired bitstream quality data, that the target audio / video bitstream has issues causing playback stuttering in the processing link of the first transcoding device, the method further includes: Obtain the target popularity information corresponding to the target audio and video bitstream, and determine that the target popularity information of the target audio and video bitstream is lower than the set first popularity level.
8. The method according to claim 7, wherein, The method further includes: If it is determined that the target popularity information of the target audio and video stream is not lower than the set first popularity level, and the first transcoding device is an edge device in the transcoding cluster, then a second transcoding device whose audio and video stream processing capability matches at least part of the transcoding tasks of the first transcoding device is selected, and the at least part of the transcoding tasks are transferred to the second transcoding device for processing based on the second transcoding device.
9. The method according to claim 1, wherein, The method further includes: Based on the target popularity information corresponding to the target audio and video bitstream, the first transcoding device is configured not to schedule other audio and video bitstreams with popularity information higher than the target popularity information.
10. A transcoding processing apparatus for audio and video streams, comprising: The quality data acquisition module is used to acquire the bitstream quality data of the target audio and video bitstream at at least one time point in the processing link of the first transcoding device; The time points include: the time points during the pull streaming phase, the time points during the transcoding phase, and the time points during the push streaming phase; The problem factor determination module is used to determine, based on the acquired bitstream quality data, the problem factors that cause playback stuttering in the processing link of the target audio and video bitstream in the first transcoding device; the problem factors include at least one of the following: streaming stuttering, transcoding stuttering, streaming stuttering, and end-to-end streaming stuttering; the method of determining the problem factors includes: determining the difference data between at least two bitstream quality data, obtaining two time points of the two bitstream quality data corresponding to the difference data, finding the difference threshold configured for the two time points, and then determining the problem factor based on at least one difference data exceeding the difference threshold; The transcoding task transcoding module is used to select a second transcoding device whose audio and video bitstream processing capabilities match at least a portion of the transcoding tasks of the first transcoding device, and transcode the at least a portion of the transcoding tasks to the second transcoding device so as to process the transcoded transcoding tasks based on the second transcoding device. The processing capability or stability of the second transcoding device is higher than that of the first transcoding device.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1-9.
12. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1-9.
Citation Information
Patent Citations
Transcoding control method and device thereof, video live broadcast method and system thereof
CN106817588A
Video transcoding method and device, equipment and medium
CN112954354A
