A play-out delay control method and apparatus, a storage medium, and an electronic device
By introducing a time wheel mechanism to manage broadcast delay, the problem of stable operation of broadcast delay devices in ordinary network environments is solved, flexible signal selection and switching are realized, and the stability of broadcast delay and multi-channel concurrent support are improved.
Patent Information
- Application Number
- CN202411025658.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing broadcast delay devices are difficult to operate stably in areas with poor network environments, which limits their application scenarios, especially in ordinary network environments where stable broadcast delay control cannot be achieved.
The broadcast delay is managed by a time wheel mechanism. By creating a time wheel that includes a primary signal source, a backup signal source, and a non-signal source wheel layer, the frame decoding time of audio and video frames is converted into a target timestamp, and audio and video frames are mapped and output in the order of frame decoding time, so as to achieve flexible signal selection and switching.
It provides stable broadcast delay control in ordinary network environments, supports multi-channel concurrent broadcasting, simplifies the control process, and improves the stability and flexibility of broadcast delay.
Smart Images

Figure CN119052539B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multimedia, and in particular to a broadcast delay control method and device, a storage medium and an electronic device. BACKGROUND
[0002] A broadcast delay timer is a critical device specifically designed for live programs in radio stations. Its main function is to delay the audio and video signals and intervene when necessary to prevent inappropriate content from being broadcast, ensuring the quality and compliance of live programs. This device is essential for maintaining professional standards and related regulations for broadcasting.
[0003] Currently, the main input types of broadcast delay timers include SDI (Serial Digital Interface) and SDI over IP (SDI over IP), which follows the SMPTE ST 2110 protocol. Both of these input methods transmit uncompressed real-time audio and video data, so they have very high requirements for network environments. Such high standards of network requirements limit the application scenarios of broadcast delay timers, especially in areas with poor network environments.
[0004] Therefore, how to achieve stable broadcast delay control in ordinary network environments has become a technical problem that needs to be solved by those skilled in the art. SUMMARY
[0005] In view of the above problems, the present application provides a broadcast delay control method, device, storage medium and electronic device to overcome the above problems or at least partially solve the above problems, and the technical solutions are as follows:
[0006] A broadcast delay control method, comprising:
[0007] obtaining a broadcast delay duration;
[0008] creating a time wheel using the broadcast delay duration, wherein the time wheel is composed of a plurality of slots, and each slot contains a wheel layer corresponding to a primary signal source, a backup signal source, and a plurality of non-signal sources;
[0009] uniformly converting the frame decoding times of a plurality of target audio and video frames into target timestamps, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames;
[0010] using the target timestamps of each target audio and video frame to map each target audio and video frame to the corresponding slot and wheel layer, respectively;
[0011] filling the frame indices of the target audio and video frames into the frame index list of the wheel layer of the corresponding slot in the order of the frame decoding times;
[0012] start the time wheel and rotate each slot in sequence according to the slot number order when the filling of each slot of the time wheel is completed;
[0013] obtain the frame index list of the wheel layer currently output by the slot when the slot is rotated to any slot, and output the target audio and video frame mapped by the wheel layer according to the frame index list.
[0014] Optionally, the time wheel is created using the broadcast delay duration, including:
[0015] round up the broadcast delay duration to obtain a first integer time;
[0016] divide the first integer time by a preset slot unit duration to obtain the total number of slots of the time wheel, and each slot sequentially contains wheel layers corresponding to frame types of primary signal source, backup signal source, and multiple non-signal sources from outside to inside.
[0017] Optionally, the target audio and video frame is respectively mapped to the corresponding slot and the wheel layer using the target timestamp of each target audio and video frame, including:
[0018] for any target audio and video frame, subtract the timestamp of the first frame of the signal source data stream from the target timestamp of the target audio and video frame to obtain a time difference value;
[0019] round down the time difference value to obtain a second integer time;
[0020] perform a modulo operation on the second integer time and the first integer time to determine the slot to which the target audio and video frame is mapped, and determine the wheel layer to which the target audio and video frame is mapped in the slot according to the frame type of the target audio and video frame.
[0021] Optionally, the slot is configured with a current output layer identifier, which is used to indicate a target wheel layer selected by a current slot signal output, and the target wheel layer is enabled and other wheel layers in the slot except the target wheel layer are disabled.
[0022] Optionally, the method further includes:
[0023] in the case where the wheel layer corresponding to the frame type of the non-signal source is disabled, align the first frame of the corresponding non-signal source audio and video with the slot currently rotated to, so as to synchronize the non-signal source audio and video with the time wheel and dynamically rotate.
[0024] Optionally, after the time wheel is started and each slot is rotated in sequence according to the slot number order, the method further includes:
[0025] obtaining a broadcast signal cutting request, wherein the broadcast signal cutting request comprises a cutting signal specified time range;
[0026] determining first slot positions in the time wheel corresponding to the cutting signal specified time range;
[0027] disabling the wheel layers corresponding to the frame types of the primary signal source in each of the first slot positions, so that the time wheel skips the first slot positions and cuts the primary signal source content.
[0028] Optionally, after the time wheel is started and each slot position is rotated in order, the method further comprises:
[0029] obtaining a broadcast signal replacement request, wherein the broadcast signal replacement request comprises a replacement signal specified time range;
[0030] determining second slot positions in the time wheel corresponding to the replacement signal specified time range;
[0031] enabling the wheel layers corresponding to the frame types of the non-signal source in the second slot positions, so that the time wheel outputs the corresponding non-signal source audio and video frames when rotating to the second slot positions.
[0032] A broadcast delay control device comprises a broadcast delay duration obtaining unit, a time wheel creating unit, a timestamp converting unit, an audio and video frame mapping unit, a frame index filling unit, a time wheel starting unit, and an audio and video frame output unit,
[0033] The broadcast delay duration obtaining unit is configured to obtain a broadcast delay duration.
[0034] The time wheel creating unit is configured to create a time wheel using the broadcast delay duration, wherein the time wheel comprises a plurality of slot positions, and each slot position comprises wheel layers corresponding to frame types of a primary signal source, a backup signal source, and a plurality of non-signal sources.
[0035] The timestamp converting unit is configured to uniformly convert frame decoding times of a plurality of target audio and video frames into target timestamps, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames.
[0036] The audio and video frame mapping unit is configured to map each target audio and video frame to a corresponding slot position and wheel layer using the target timestamp of each target audio and video frame.
[0037] The frame index filling unit is configured to fill the frame index of the target audio / video frame into the frame index list of the wheel layer of the corresponding slot according to the order of the frame decoding time;
[0038] The time wheel starting unit is configured to start the time wheel and rotate each slot according to the slot number order when the filling of each slot of the time wheel is completed.
[0039] The audio / video frame output unit is configured to obtain the frame index list of the wheel layer currently output by the slot when the slot is rotated, and output the target audio / video frame mapped by the wheel layer according to the frame index list.
[0040] A computer readable storage medium having a program stored thereon, the program being executed by a processor to implement the playout delay control method of any of the above.
[0041] An electronic device, comprising at least one processor, and at least one memory connected with the processor via a bus; wherein the processor, the memory complete mutual communication through the bus; the processor is used to call the program instruction in the memory, to execute the playout delay control method of any of the above.
[0042] By the above technical solution, the playout delay control method, device, storage medium and electronic device provided by the application are applied to the field of multimedia technology. The playout delay duration is obtained; the time wheel is created by using the playout delay duration, wherein the time wheel is composed of multiple slots, each slot contains a wheel layer of a primary signal source, a backup signal source and multiple non-signal sources corresponding to the frame type; the frame decoding time of multiple target audio / video frames is uniformly converted into target timestamps, wherein the target audio / video frames are signal source audio / video frames or non-signal source audio / video frames; the target timestamps of the target audio / video frames are used to respectively map each target audio / video frame to the corresponding slot and wheel layer; the frame index of the target audio / video frame is filled into the frame index list of the wheel layer of the corresponding slot according to the order from small to large of the frame decoding time; the time wheel is started when the filling of each slot of the time wheel is completed, and each slot is rotated according to the slot number order; when any slot is rotated, the frame index list of the wheel layer currently output by the slot is obtained, and the target audio / video frame mapped by the wheel layer is output according to the frame index list. The time wheel mechanism is introduced to manage the playout delay, and each slot of the time wheel contains the wheel layer of the primary signal source, the backup signal source and multiple non-signal sources to manage multiple source signals, which provides a flexible signal selection and switching mechanism, simplifies the playout delay control process, and thus can provide stable playout delay control in a normal network environment, and improves the stability of the playout delay control.
[0043] The above description is only a summary of the technical solutions of the present application. In order to enable one skilled in the art to better understand the technical means of the present application, the content of the specification can be implemented, and in order to enable the above and other purposes, features and advantages of the present application to be more apparent and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0044] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not meant to limit the present application. Furthermore, the same reference numerals are used throughout the several views that follow. In the drawings:
[0045] Figure 1 A flow diagram illustrating one embodiment of a method for controlling a broadcast delay according to an embodiment of the present application is shown;
[0046] Figure 2 A structural diagram illustrating a time wheel according to an embodiment of the present application is shown;
[0047] Figure 3 A flow diagram illustrating one embodiment of step S110 of a method for controlling a broadcast delay according to an embodiment of the present application is shown;
[0048] Figure 4 A flow diagram illustrating one embodiment of step S130 of a method for controlling a broadcast delay according to an embodiment of the present application is shown;
[0049] Figure 5 A flow diagram illustrating another embodiment of a method for controlling a broadcast delay according to an embodiment of the present application is shown;
[0050] Figure 6 A flow diagram illustrating another embodiment of a method for controlling a broadcast delay according to an embodiment of the present application is shown;
[0051] Figure 7 A structural diagram illustrating a broadcast delay control device according to an embodiment of the present application is shown;
[0052] Figure 8 A structural diagram illustrating an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0053] Exemplary embodiments of the present application will be described below in greater detail with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present application can be more thoroughly understood and so that the scope of the present application can be accurately conveyed to those skilled in the art.
[0054] There are two main types of existing broadcast delay technologies: one is to add a pure hardware solid-state delay device to the broadcast channel, and the other is to use a dedicated video server to form a delayed broadcast system. Regardless of the implementation method, the main input is still SDI and SDI over IP, and both face the challenge of high network requirements.
[0055] Given the limitations of existing technologies in typical network environments, there is an urgent market need for a new broadcast delay control method that can operate stably in ordinary network environments and provide delay accuracy down to the second level. Furthermore, an ideal broadcast delay control method should also support multi-channel concurrent delay broadcast control, thereby replacing a large number of hardware delay devices to achieve better economic benefits and significantly improve the flexibility of live broadcasting and the operational efficiency of radio stations.
[0056] Based on this, this embodiment of the invention provides a broadcast delay control method. First, the broadcast delay duration is obtained, and a time wheel consisting of multiple slots is created accordingly. Each slot contains different types of wheel layers, corresponding to the primary signal source, backup signal source, and multiple non-signal sources, respectively. Next, the frame decoding times of all target audio and video frames are converted into a unified target timestamp. These target audio and video frames include signal source audio and video frames and non-signal source audio and video frames. Then, according to the target timestamps of each target audio and video frame, they are mapped to the corresponding slots and wheel layers of the time wheel. Afterward, according to the order of frame decoding times, the frame indices of the target audio and video frames are filled into the frame index list of the wheel layer of the corresponding slot. After all slots are filled, the time wheel is started and rotates according to the slot number order. When the time wheel rotates to a certain slot, the frame index list of the wheel layer currently output by that slot is obtained, and the target audio and video frames mapped by the wheel layer are output according to the list. As can be seen, the time wheel mechanism introduced in this invention not only achieves efficient and accurate broadcast delay control, but also supports simultaneous multi-channel concurrent broadcasting, simplifies the broadcast delay control process, and thus provides stable broadcast delay control even in ordinary network environments, improving the stability of broadcast delay control.
[0057] like Figure 1 The diagram shows a flowchart of one embodiment of the broadcast delay control method provided by this invention. The method may include:
[0058] S100, Obtain the broadcast delay duration.
[0059] The play-out delay duration refers to a time interval from when the audio and video signals are processed to when they are finally played out. This time interval is used to delay the play-out of the content so that necessary checks, editing or other processing can be performed before the actual play-out. The purpose of the delay is to ensure that any problems or inappropriate content can be discovered and processed in time during the play-out process, thereby ensuring the quality and safety of the play-out.
[0060] The embodiment of the present application can set the specific value of the play-out delay duration according to the actual delay requirement of the audio and video signals. For example, the play-out delay duration can be set to 120 seconds.
[0061] S110, creating a time wheel using the play-out delay duration, wherein the time wheel is composed of a plurality of slots, and each slot contains a plurality of wheel layers corresponding to the primary signal source, the backup signal source and a plurality of non-signal sources.
[0062] Specifically, the embodiment of the present application can construct a time wheel structure according to the specified play-out delay duration. The time wheel is composed of a plurality of slots, and the unit time length of each slot can be set to 1 second. Each slot contains a plurality of wheel layers, which correspond to different video frame types, including the primary signal source, the backup signal source and a plurality of non-signal sources. Optionally, the structure of the time wheel can be as shown in the following table. Figure 2 The audio and video frames of each wheel layer can be output separately to display the output content of the current wheel layer and the output content after the delay play-out.
[0063] S120, uniformly converting the frame decoding time of a plurality of target audio and video frames into a target timestamp, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames.
[0064] Specifically, the embodiment of the present application can convert the frame decoding time frame_dts of the target audio and video frames into a target timestamp frame_timestamp in seconds, which is accurate to the millisecond level, for example, 10.324 seconds.
[0065] Optionally, the embodiment of the present application can perform normalization processing on the target audio and video in advance to ensure that the GOP (Group of Pictures) and frame rate of all audio and video are consistent. Specifically, the embodiment of the present application can set the GOP to 1 second to maintain the coherence and coding efficiency of the video content. At the same time, the frame rate is set to be consistent with the frame rate of the primary signal source audio and video (usually 25 or 50) to ensure that the video is smooth and synchronized with the primary signal during play-out, and also to ensure that the backup signal source can seamlessly take over when the primary signal source has a problem, maintaining the consistency of the play-out.
[0066] Optionally, the embodiments of the present application can analyze the audio and video streams of the primary signal source and the backup signal source, only unpacking without decoding, to extract the relevant information of the video frames. According to the GOP structure, mark the audio and video frames (for example: I frame (Intra-coded picture), B frame (Bidirectionally predicted picture), P frame (Predictive-coded Picture), B frame, B frame, etc.) and decoding time (frame_dts, i.e. DTS), so as to facilitate subsequent processing and play-out management.
[0067] S130, map each target audio and video frame to the corresponding slot and wheel layer respectively by using the target timestamp of each target audio and video frame.
[0068] Specifically, the embodiments of the present application can calculate the slot in which the target audio and video frame should be placed in the time wheel according to the target timestamp of the target audio and video frame, and determine the specific wheel layer to which the target audio and video frame should be mapped according to the frame type of the target audio and video frame, so that the time wheel can flexibly manage and schedule different types of video frames. For example: if it is a primary signal source audio and video frame, it is mapped to the primary signal source wheel layer. If it is a backup signal source audio and video frame, it is mapped to the backup signal source wheel layer. If it is a material audio and video frame, it is mapped to the material wheel layer.
[0069] S140, fill the frame index of the target audio and video frame into the frame index list of the wheel layer of the corresponding slot in the order of frame decoding time.
[0070] Among them, the frame index list adopts a linked list form, and the structure of the frame index list is "(list index number, frame index number, frame decoding time)".
[0071] According to the frame decoding time (frame_dts) of the audio and video frames, the index of each target audio and video frame is sequentially inserted into the frame index list in the corresponding wheel layer of the corresponding slot of the time wheel in the order of time (from early to late). Thus, the index of the target audio and video frame is correctly organized and stored in the order of its decoding time.
[0072] S150, start the time wheel when the filling of each slot of the time wheel is completed, and rotate each slot in the order of slot number.
[0073] Specifically, in this embodiment of the invention, after the frame index list corresponding to all slots of the time wheel is filled, the time wheel rotation mechanism will begin to run. Initially, the time wheel starts rotating from slot 0. Under normal circumstances, every 1 second (slot unit duration), the time wheel automatically advances to the next slot, continuously performing the aforementioned process to ensure that audio and video frames are processed and played in a predetermined time order.
[0074] S160. When the wheel rotates to any slot, obtain the frame index list of the wheel layer currently output by the slot, and output the target audio and video frames mapped by the wheel layer according to the frame index list.
[0075] Specifically, when the time wheel starts rotating, if there is no frame index data in the frame index list of the corresponding wheel layer in the current slot, the time wheel will immediately move to the next slot. When frame index data is obtained from the frame index list in the wheel layer of the slot, video frames are output at the original frame rate in ascending order of frame decoding time. The original frame rate can be the frame rate of the main signal source audio and video.
[0076] This invention provides a broadcast delay control method, applied in the field of multimedia technology. The invention obtains the broadcast delay duration; creates a time wheel using the broadcast delay duration, wherein the time wheel consists of multiple slots, each slot containing a wheel layer for the corresponding frame type, including a primary signal source, a backup signal source, and multiple non-signal sources; uniformly converts the frame decoding times of multiple target audio and video frames into target timestamps, wherein the target audio and video frames are either signal source audio and video frames or non-signal source audio and video frames; using the target timestamps of each target audio and video frame, each target audio and video frame is mapped to its corresponding slot and wheel layer; according to the ascending order of frame decoding time, the frame indexes of the target audio and video frames are filled into the frame index list of the wheel layer of the corresponding slot; when all slots of the time wheel are filled, the time wheel is started, rotating through each slot according to the slot number order; when rotating to any slot, the frame index list of the wheel layer currently output by the slot is obtained, and the target audio and video frames mapped by the wheel layer are output according to the frame index list. This invention introduces a time wheel mechanism to manage broadcast delay. By managing multi-source signals through a wheel layer in which each slot of the time wheel contains a primary signal source, a backup signal source, and multiple non-signal sources, it provides a flexible signal selection and switching mechanism, simplifies the broadcast delay control process, and thus provides stable broadcast delay control even in ordinary network environments, thereby improving the stability of broadcast delay control.
[0077] Optional, based on Figure 1 The method shown is as follows: Figure 3 The diagram shows a specific implementation of step S110 in the broadcast delay control method provided by this invention. Step S120 may include:
[0078] S300, the broadcast delay time length is rounded up, and a first integer time is obtained.
[0079] S310, the first integer time is divided by a preset slot unit time length, and a total number of slots of the time wheel is obtained, each slot sequentially contains wheel layers corresponding to the frame types of the primary signal source, the backup signal source and the plurality of non-signal sources from outside to inside.
[0080] The total number of slots of the time wheel is determined by rounding up the broadcast delay time length and dividing by the slot unit time length. Each slot contains a plurality of wheel layers, which correspond to different video frame types. From the outer layer to the inner layer, the wheel layers are in turn the primary signal source, the backup signal source, and a plurality of non-signal sources (such as material 1, material 2, and material n).
[0081] The embodiment of the application can flexibly manage and schedule different types of audio and video frames by reasonably allocating slots of the time wheel and using the layered design of the slots to meet the processing needs of different frame types of audio and video frames, thereby facilitating accurate and efficient control of the broadcast delay.
[0082] Optionally, based on Figure 3 As shown in the method, as shown in the embodiment of the application, the step S130 of the broadcast delay control method provided by the embodiment of the application can include: Figure 4
[0083] S400, for any target audio and video frame, subtracting the target timestamp of the target audio and video frame from the first frame timestamp of the signal source data stream to obtain a time difference value.
[0084] S410, rounding down the time difference value to obtain a second integer time.
[0085] S420, performing a modulo operation on the second integer time and the first integer time to determine the slot to which the target audio and video frame is mapped, and determining the wheel layer to which the target audio and video frame is mapped in the slot according to the frame type of the target audio and video frame.
[0086] Specifically, the embodiment of the application can obtain the slot number in which the frame should be placed by calculating the difference between the target timestamp of the current target audio and video frame and the first frame timestamp, rounding down, and then performing a modulo operation on the total time length of the time wheel. The specific formula is: slot number = (down (target timestamp-first frame timestamp)) % time wheel time length. Then, according to the frame type of the target audio and video frame, the corresponding wheel layer is located in the slot with the slot number, and the mapping relationship between the target audio and video frame and the slot and the wheel layer is established.
[0087] The embodiment of the present application simplifies the complexity of time calculation through the standardization processing of the time difference value, ensures the integerization of the time difference value, enables efficient calculation of the slot mapping process, thereby accurately and efficiently mapping the target audio and video frame to the corresponding slot, and determining the wheel layer mapped in the slot according to the frame type of the target audio and video frame, ensuring that the target audio and video frame of different frame types can be accurately mapped to the corresponding wheel layer, improving the processing efficiency and flexibility of the delay control on different frame types, avoiding signal output problems caused by inaccurate time calculation or frame type mapping errors, and ensuring the stability and reliability of the delay control.
[0088] Optionally, in the above Figure 1 Based on one or more embodiments, in another optional embodiment of the present application, the slot is configured with a current output layer identifier, and the current output layer identifier is used to indicate the target wheel layer of the current slot selection signal output, the target wheel layer is enabled, and other wheel layers in the slot except the target wheel layer are disabled.
[0089] In the same time, if there are multiple wheel layers with data in the slot, only one signal can be selected for output. In the slot structure, master_layer is used to identify the main signal source wheel layer number, and output_layer is used to identify the target wheel layer of the current slot selection signal output. The default value of output_layer is master_layer.
[0090] In the time wheel rotation process, each slot is traversed in turn, the frame index list of the corresponding wheel layer is obtained from the output_layer of the slot, and the corresponding audio and video frame is output at the original frame rate according to the preset delay time length.
[0091] Each wheel layer has the options of enabling, disabling or waiting. If a certain wheel layer is set to the disabled state, the signal of the wheel layer will not be output. For example, if a backup signal source is needed, the corresponding backup signal wheel layer will be enabled, output_layer will be adjusted to the number of the backup signal source wheel layer, and other wheel layers will be set to the disabled state. When a filler or material is needed, the corresponding wheel layer will be enabled, output_layer will be adjusted to the wheel layer number corresponding to the filler or material, and other wheel layers will be automatically set to the disabled state. If all wheel layers in the slot are not enabled, the main signal source wheel layer can be selected by default for output, and at this time, output_layer will be set back to master_layer. When the current wheel layer is in the enabled state, the next wheel layer of the time wheel is in the waiting state.
[0092] The embodiment of the present application determines which wheel layer will be selected for output by the slot configuration, and provides corresponding options of enabling, disabling or waiting for each wheel layer, so that the output of the signal can be flexibly switched and accurately controlled in the broadcast delay control process, and the adaptability and reliability of the broadcast delay control are improved.
[0093] Optionally, in the above Figure 1 Based on one or more corresponding embodiments, another optional embodiment of the present application provides that the method can further include:
[0094] In the case that the wheel layer corresponding to the frame type of non-signal source is disabled, the first frame of the non-signal source audio and video is aligned with the slot to which the time wheel is currently rotated, so that the non-signal source audio and video are dynamically rotated in synchronization with the time wheel.
[0095] In order to ensure the integrity of the starting content of the non-signal source audio and video including the filler and the material, the processing mode of the filler and the material when inserted into the corresponding wheel layer of the slot is different from that of the main and backup signals, and when the wheel layer corresponding to the filler and the material is set to the disabled state, a control mechanism similar to a synchronous orbit satellite is adopted. Under this mechanism, the filler and the material are moved synchronously with the dynamic rotation of the time wheel. For example, when the time wheel is rotated to slot 10, the first frame of the filler and the material will be aligned with slot 10; when the time wheel continues to rotate to the next slot 11, the first frame of the filler and the material will continue to be aligned with slot 11.
[0096] The embodiment of the present application controls the non-signal source audio and video to dynamically rotate in synchronization with the time wheel by adopting a synchronous control mechanism, ensures that the filler and the material can be accurately synchronized with the time wheel when inserted into the corresponding wheel layer of the slot, and thus guarantees the continuity and integrity of the starting content of the non-signal source audio and video.
[0097] Optionally, based on Figure 1 As shown in the method shown in Figure 5 After starting the time wheel and rotating each slot in the order of slot number, the method can further include:
[0098] S500, obtaining a broadcast signal cutting request, wherein the broadcast signal cutting request includes a cutting signal specified time range.
[0099] S510, determining a first slot in the time wheel corresponding to the cutting signal specified time range.
[0100] S520, disabling the wheel layer corresponding to the frame type of the main signal source in each first slot, so that the time wheel skips the first slot and cuts the main signal source content.
[0101] Specifically, the embodiment of the present application can set the main signal source wheel layer corresponding to the slot in the specified time range of the cutting signal to the disabled state, so that the playing of the main signal source audio and video in the specified time range of the cutting signal is quickly skipped, and the cutting of the main signal source content is realized.
[0102] The embodiment of the present application can skip the content of the main signal source audio and video that does not meet the playing regulations in the specified time range of the cutting signal by effectively responding to and processing the playing signal cutting request, and ensure the quality and compliance of the playing content.
[0103] Optionally, based on Figure 1 As shown in the method, Figure 6 As shown in the flowchart of another embodiment of the playing delay control method provided by the embodiment of the present application, after the time wheel is started and each slot is rotated in the order of slot number, the method can further include:
[0104] S600, obtaining a playing signal replacement request, wherein the playing signal replacement request includes a replacement signal specified time range.
[0105] S610, determining a second slot in the time wheel corresponding to the replacement signal specified time range.
[0106] S620, enabling the wheel layer corresponding to the frame type of non-signal source in the second slot, so that when the time wheel rotates to the second slot, the corresponding non-signal source audio and video frame is output.
[0107] Specifically, the embodiment of the present application can set the filler wheel layer or the material wheel layer corresponding to the slot in the specified time range of the replacement signal to the enabled state, and set the output_layer of the corresponding slot to the filler or material wheel layer number, so that the filler audio and video or the material audio and video content is played in the specified time range of the replacement signal instead of the signal source audio and video content, thereby realizing the replacement of the playing content.
[0108] The embodiment of the present application can replace the playing signal in the specified time range of the replacement signal by effectively responding to and processing the playing signal replacement request, so as to more effectively utilize the existing playing resources, such as using the time originally planned for playing the signal source audio and video to play the filler or material audio and video content that is more popular or more time-sensitive. At the same time, it is also convenient for the playing party to replace the content that may have problems in time, to ensure that the playing content always maintains high quality and complies with relevant regulations, and to protect the audience from being affected by inappropriate content.
[0109] Optionally, the specified time range of the cutting signal and the specified time range of the replacement signal can support signal cutting or replacement within the first 30 seconds of playing.
[0110] Optionally, the embodiment of the present application supports the push stream and pull stream of multiple protocols, specifically including the push stream of RTMP, RTSP and SRT protocols, and the pull stream of RTMP, RTSP, SRT, HLS and DASH protocols, and accesses signals by supporting both push stream and pull stream modes to adapt to different live broadcast needs and technical environments.
[0111] The play-out delay control method provided by the embodiment of the present application supports the push stream and pull stream operation of multiple mainstream live broadcast protocols, and can realize second-level play-out delay without decoding, is simple and efficient based on the multi-layer time wheel and dynamic switching control, ensures the accuracy and reliability of the play-out delay control, can support hundreds of concurrent delay control using a single play-out delay server, greatly reduces the cost of play-out delay, and adapts to various play-out delay application scenarios.
[0112] Although each operation is described in a particular order, this should not be understood as requiring these operations to be performed in the particular order shown or in a sequential order. In certain circumstances, multitasking and parallel processing can be advantageous.
[0113] It should be understood that each step described in the method embodiment of the present application can be performed in a different order and / or in parallel. In addition, the method embodiment can include additional steps and / or omit the execution of the steps shown. The scope of the present application is not limited in this respect.
[0114] Corresponding to the above-mentioned method embodiment, the embodiment of the present application also provides a play-out delay control device, the structure of which is as shown in Figure 7 which can include a play-out delay duration obtaining unit 10, a time wheel creating unit 20, a timestamp converting unit 30, an audio / video frame mapping unit 40, a frame index filling unit 50, a time wheel starting unit 60 and an audio / video frame output unit 70.
[0115] The play-out delay duration obtaining unit 10 is configured to obtain a play-out delay duration.
[0116] The time wheel creating unit 20 is configured to create a time wheel using the play-out delay duration, wherein the time wheel is composed of multiple slots, and each slot contains a wheel layer corresponding to a frame type of a primary signal source, a backup signal source and multiple non-signal sources.
[0117] The timestamp converting unit 30 is configured to uniformly convert the frame decoding times of multiple target audio / video frames into target timestamps, wherein the target audio / video frames are signal source audio / video frames or non-signal source audio / video frames.
[0118] The audio / video frame mapping unit 40 is configured to map each target audio / video frame to a corresponding slot and wheel layer using the target timestamp of each target audio / video frame.
[0119] The frame index filling unit 50 is used to fill the frame index of the target audio and video frame into the frame index list of the corresponding slot in the wheel layer according to the frame decoding time order.
[0120] The time wheel starting unit 60 is used to start the time wheel when all slots of the time wheel are filled, and to rotate each slot in the order of the slot number.
[0121] The audio / video frame output unit 70 is used to obtain the frame index list of the current output wheel layer when the wheel rotates to any slot, and output the target audio / video frame mapped by the wheel layer according to the frame index list.
[0122] Optionally, the time wheel creation unit 20 can be specifically used to round up the broadcast delay duration to obtain a first integer time. The first integer time is divided by the preset slot unit duration to obtain the total number of slots in the time wheel. Each slot contains, from the outside in, a wheel layer consisting of the primary signal source, the backup signal source, and multiple non-signal sources for the corresponding frame type.
[0123] Optionally, the audio / video frame mapping unit 40 can be specifically used to subtract the first frame timestamp of the signal source data stream from the target timestamp of any target audio / video frame to obtain a time difference value. The time difference value is then rounded down to obtain a second integer time. A modulo operation is performed between the second integer time and the first integer time to determine the slot for mapping the target audio / video frame, and the wheel layer mapped to the target audio / video frame in the slot is determined based on the frame type of the target audio / video frame.
[0124] Optionally, the slot is configured with a current output layer identifier, which is used to indicate the target wheel layer for the current slot to select signal output, enable the target wheel layer and disable other wheel layers in the slot except for the target wheel layer.
[0125] Optionally, the broadcast delay control device may also include a synchronous rotation unit.
[0126] The synchronous rotation unit is used to align the first frame of the corresponding non-signal source audio and video with the slot currently rotated when the wheel layer corresponding to the frame type non-signal source is disabled, so that the non-signal source audio and video rotates synchronously with the time wheel.
[0127] Optionally, the broadcast delay control device may also include a signal cutting unit.
[0128] The signal cutting unit obtains a broadcast signal cutting request after the time wheel starting unit 60 starts the time wheel and rotates each slot in order of slot number, wherein the broadcast signal cutting request comprises a cutting signal specified time range.
[0129] Optionally, the broadcast delay control device can further comprise a signal replacing unit.
[0130] The signal replacing unit obtains a broadcast signal replacing request after the time wheel starting unit 60 starts the time wheel and rotates each slot in order of slot number, wherein the broadcast signal replacing request comprises a replacing signal specified time range. The second slot corresponding to the replacing signal specified time range in the time wheel is determined. The wheel layer corresponding to the frame type of the non-signal source in the second slot is enabled, so that the corresponding non-signal source audio and video frame is output when the time wheel rotates to the second slot.
[0131] The broadcast delay control device provided by the application is applied to the field of multimedia technology. The broadcast delay time length is obtained. The time wheel is created by using the broadcast delay time length, wherein the time wheel is composed of multiple slots, each slot contains wheel layers of the main signal source, the standby signal source and multiple non-signal sources corresponding to the frame type. The frame decoding time of multiple target audio and video frames is uniformly converted into target time stamps, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames. The target audio and video frames are respectively mapped to corresponding slots and wheel layers by using the target time stamps of the target audio and video frames. The frame indexes of the target audio and video frames are filled into the frame index list of the wheel layer of the corresponding slot in order of the frame decoding time from small to large. The time wheel is started when the filling of each slot of the time wheel is completed, and each slot is rotated in order of slot number. The frame index list of the wheel layer currently output by the slot is obtained when any slot is rotated, and the target audio and video frame mapped by the wheel layer is output according to the frame index list. The time wheel mechanism is introduced to manage the broadcast delay, and each slot of the time wheel contains the wheel layer of the main signal source, the standby signal source and multiple non-signal sources, which manages multiple signal sources, provides a flexible signal selection and switching mechanism, simplifies the broadcast delay control process, and thus can provide stable broadcast delay control in a normal network environment, and improves the stability of the broadcast delay control.
[0132] As to the device in the above-mentioned embodiments, the specific manner in which each unit performs the operation has been described in detail in the embodiments related to the method, and will not be described in detail here.
[0133] The broadcast delay control device includes a processor and a memory. The broadcast delay duration acquisition unit 10, time wheel creation unit 20, timestamp conversion unit 30, audio and video frame mapping unit 40, frame index filling unit 50, time wheel start unit 60 and audio and video frame output unit 70 are all stored in the memory as program units. The processor executes the above program units stored in the memory to realize the corresponding functions.
[0134] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, a time wheel mechanism is introduced to manage broadcast delay. Each slot of the time wheel contains a primary signal source, backup signal sources, and multiple non-signal sources, managing multi-source signals in a layered manner. This provides a flexible signal selection and switching mechanism, simplifies the broadcast delay control process, and ensures stable broadcast delay control even in ordinary network environments, thus improving the stability of broadcast delay control.
[0135] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the broadcast delay control method.
[0136] This invention provides a processor for running a program, wherein the program executes the broadcast delay control method during runtime.
[0137] like Figure 8 As shown, this embodiment of the invention provides an electronic device 1000, which includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003. The processor 1001 and the memory 1002 communicate with each other via the bus 1003. The processor 1001 is used to call program instructions in the memory 1002 to execute the aforementioned broadcast delay control method. The electronic device in this document can be a server, PC, PAD, mobile phone, etc.
[0138] The present invention also provides a computer program product that, when executed on an electronic device, is suitable for executing a program that initializes a broadcast delay control method step.
[0139] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the flowchart illustrations and / or block diagrams.Figure 1 one or more processes and / or means for carrying out any one of the Figure 1 Figure 1 one or more processes and / or means for carrying out any one of the
[0140] In one typical arrangement, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device can also include input / output interfaces, network interfaces, and the like.
[0141] The memory can include non-persistent memory in the form of random access memory (RAM) and / or non-volatile memory, such as read only memory (ROM) or flash memory (flash RAM), including at least one memory chip. The memory is an example of computer readable media.
[0142] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0143] In the description of the present application, it should be understood that the orientation or positional relationship indicated by the terms "upper", "lower", "front", "back", "left" and "right" and the like are based on the orientation or positional relationship shown in the drawings, only for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the indicated position or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the present application.
[0144] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting; it is not intended to exclude myriad other embodiments of the present application that other present or future technologies can provide. It is to be understood that the phraseology and the terminology employed herein are for the purpose of description and not of limitation. Any use of sections headings is intended to aid reading the detailed description. An overview of the various embodiments of the application is provided below. The overview is not intended to be exhaustive or to limit the application to the embodiments disclosed therein. Many variations and modifications can be made to the embodiments without substantially departing from the principles of the present application. The embodiments are discussed in the context of the following examples.
[0145] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.
[0146] The above merely provides an embodiment of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. A broadcast delay control method, characterized in that, include: Obtain the broadcast delay duration; A time wheel is created using the broadcast delay duration. The time wheel consists of multiple slots, and each slot contains a wheel layer for the corresponding frame type, which includes a primary signal source, a backup signal source, and multiple non-signal sources. The slot is configured with a current output layer identifier, which is used to indicate the target wheel layer for signal output selected by the current slot, enabling the target wheel layer and disabling other wheel layers in the slot except for the target wheel layer. The frame decoding times of multiple target audio and video frames are uniformly converted into target timestamps, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames; Using the target timestamp of each target audio and video frame, each target audio and video frame is mapped to the corresponding slot and the wheel layer respectively; According to the order of the frame decoding time, the frame index of the target audio and video frame is filled into the frame index list of the corresponding slot of the wheel layer; Once all slots of the time wheel are filled, the time wheel is started, and the slots are rotated in sequence according to their slot numbers. When the rotation reaches any of the slots, obtain the frame index list of the current output of the rotation layer of the slot, and output the target audio and video frame mapped by the rotation layer according to the frame index list.
2. The method according to claim 1, characterized in that, The process of creating a time wheel using the broadcast delay duration includes: The broadcast delay duration is rounded up to obtain the first integer time. Divide the first integer time by the preset slot unit duration to obtain the total number of slots in the time wheel. Each slot contains, from the outside in, a wheel layer consisting of a primary signal source, a backup signal source, and multiple non-signal sources for the corresponding frame type.
3. The method according to claim 2, characterized in that, The step of mapping each target audio / video frame to its corresponding slot and wheel layer using the target timestamp of each target audio / video frame includes: For any of the target audio / video frames, the target timestamp of the target audio / video frame is subtracted from the timestamp of the first frame of the signal source data stream to obtain the time difference value; The time difference is rounded down to obtain a second integer time. The second integer time is moduloed with the first integer time to determine the slot mapped to the target audio / video frame, and the wheel layer mapped to the target audio / video frame in the slot is determined according to the frame type of the target audio / video frame.
4. The method according to claim 1, characterized in that, The method further includes: When the wheel layer corresponding to the non-signal source frame type is disabled, the first frame of the corresponding non-signal source audio / video is aligned with the slot currently rotated to, so that the non-signal source audio / video rotates dynamically in sync with the time wheel.
5. The method according to claim 1, characterized in that, After activating the time wheel and rotating each slot according to its slot number sequence, the method further includes: Obtain a broadcast signal cut request, wherein the broadcast signal cut request includes cutting a specified time range of the signal; Determine the first slot in the time wheel that corresponds to the specified time range of the shearing signal; Disable the wheel layer in each of the first slots that corresponds to the frame type of the primary signal source, so that the time wheel skips the first slot and cuts the content of the primary signal source.
6. The method according to claim 1, characterized in that, After activating the time wheel and rotating each slot according to its slot number sequence, the method further includes: Obtain a broadcast signal replacement request, wherein the broadcast signal replacement request includes a specified time range for the replacement signal; Determine the second slot in the time wheel that corresponds to the specified time range of the replacement signal; When the wheel layer in the second slot that corresponds to the frame type of the non-signal source is enabled, and the time wheel rotates to the second slot, the corresponding non-signal source audio and video frames are output.
7. A broadcast delay control device, characterized in that, include: The system includes a broadcast delay duration acquisition unit, a time wheel creation unit, a timestamp conversion unit, an audio / video frame mapping unit, a frame index filling unit, a time wheel startup unit, and an audio / video frame output unit. The broadcast delay duration acquisition unit is used to acquire the broadcast delay duration; The time wheel creation unit is used to create a time wheel using the broadcast delay duration. The time wheel consists of multiple slots, and each slot contains wheel layers for a corresponding frame type, including a primary signal source, a backup signal source, and multiple non-signal sources. The slot is configured with a current output layer identifier, which is used to indicate the target wheel layer for signal output in the current slot, enable the target wheel layer, and disable other wheel layers in the slot except for the target wheel layer. The timestamp conversion unit is used to convert the frame decoding time of multiple target audio and video frames into a target timestamp in a unified manner, wherein the target audio and video frames are signal source audio and video frames or non-signal source audio and video frames. The audio and video frame mapping unit is used to map each target audio and video frame to the corresponding slot and the wheel layer using the target timestamp of each target audio and video frame; The frame index filling unit is used to fill the frame index of the target audio and video frame into the frame index list of the corresponding slot of the wheel layer according to the order of the frame decoding time. The time wheel starting unit is used to start the time wheel when all the slots of the time wheel are filled, and to rotate each of the slots in the order of the slot numbers. The audio / video frame output unit is configured to obtain the frame index list of the wheel layer currently output by the slot when rotating to any of the slots, and output the target audio / video frame mapped by the wheel layer according to the frame index list.
8. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the broadcast delay control method as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, The electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the broadcast delay control method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for processing delay task
CN114296902A
Method for realizing audio and video delay
CN116233502A