Audio and video playback control method, device, equipment, storage medium and program product
By detecting the number of effective spikes and jitter values of audio and video frames, the audio and video buffer settings are optimized, and the problems of audio and video playback lag and delay in weak network environments are solved, real-time and balance of audio and video playback are achieved.
Patent Information
- Application Number
- CN202211559689.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-12-06
AI Technical Summary
In a weak network environment, the prior art has problems of lag and high delay when setting buffers for audio and video playback, making it difficult to achieve real-time and balance of audio and video playback.
By detecting the effective number of spikes in audio and video frames, the first interval quantile value of the decoded frame interval within the preset time is determined, and combined with the pull-up height value and the current jitter value, the jitter value is corrected to set the audio and video buffer to avoid frequent adjustment of the jitter value caused by singular spikes.
It realizes the real-time performance of audio and video playback while reducing lag, avoids high latency or lag caused by improper buffer settings, and ensures smooth playback and real-time performance.
Smart Images

Figure CN115883920B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of audio and video technology, and in particular to an audio and video playback control method, apparatus, device, storage medium, and program product. Background Art
[0002] With the development of streaming media technology and the popularization of computing devices, audio and video have become the mainstream means of information interaction. To ensure smooth audio and video playback in different network environments, how to avoid audio and video lag in weak network environments has become a major research topic.
[0003] In related technologies, the purpose of reducing lag can be achieved by setting a buffer for caching audio and video. However, with the rise of the live broadcast industry and various real-time audio and video transmission applications, the mechanism of preventing lag by setting a buffer will bring about the problem of high audio and video playback delay. Therefore, how to reduce audio and video playback lag while ensuring the real-time performance of audio and video playback is an issue that needs to be solved urgently. Summary of the Invention
[0004] The embodiments of the present application provide an audio and video playback control method, apparatus, device, storage medium, and program product, which improve the real-time performance of audio and video playback while reducing audio and video playback jams, achieving a good balance between reducing jams and real-time playback, avoiding the high audio and video playback delay caused by setting a larger buffer, and the audio and video playback jams caused by setting a smaller buffer, while avoiding frequent and large adjustments to the buffer.
[0005] In a first aspect, an embodiment of the present application provides an audio and video playback control method, the method comprising:
[0006] When it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition, determining a first interval percentile value of the decodable frame interval in the audio and video frames within a preset time length;
[0007] Obtaining a set pull-up height value and a currently set jitter value, and determining a jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value;
[0008] The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value.
[0009] In a second aspect, an embodiment of the present application further provides an audio and video playback control device, comprising:
[0010] an interval value determination module configured to determine a first interval percentile value of a decodable frame interval in the audio and video frames within a preset duration when it is detected that the number of valid peaks in the audio and video frames meets the jitter value adjustment condition;
[0011] a correction value determination module configured to obtain a set pull-up height value and a currently set jitter value, and determine a jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value;
[0012] The jitter correction module is configured to correct the jitter value based on the jitter target correction value and set the audio and video buffer based on the corrected jitter value.
[0013] In a third aspect, an embodiment of the present application further provides an audio and video playback control device, the device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the audio and video playback control method described in the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the audio and video playback control method described in the embodiment of the present application.
[0018] In a fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the audio and video playback control method described in the embodiment of the present application.
[0019] In an embodiment of the present application, when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment conditions, the first interval percentile value of the decodable frame interval in the audio and video frames within a preset duration is determined, the set pull-up height value and the currently set jitter value are obtained, and the jitter target correction value is determined based on the first interval percentile value, the pull-up height value and the jitter value. The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value. In this processing method, effective peaks are used to determine whether the jitter value adjustment conditions are triggered, avoiding the frequent adjustment of jitter values caused by singular spike samples. When adjusting the jitter value, adjustments are made based on the determined peak percentile value and the set pull-up height value. On the basis of covering most of the peaks, extremely individual higher peaks are prevented from raising the jitter value to an unreasonable range, and the jitter value pull-up range is controlled within a cost-effective and controllable range. The setting of the audio and video buffer based on the jitter value improves the real-time performance of the audio and video playback process, achieves a good balance between reducing jams and real-time playback, avoids the high audio and video playback delay caused by setting a larger buffer, and the audio and video playback jams caused by setting a smaller buffer, and avoids frequent and large adjustments of the buffer. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of an audio and video playback control method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of a method for correcting a jitter value based on a jitter target correction value provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of a spike judgment standard and a method for performing effective spike recording provided in an embodiment of the present application;
[0023] Figure 4 A structural block diagram of an audio and video playback control device provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an audio and video playback control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the embodiments of the present application, rather than all structures.
[0026] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0027] The audio and video playback control method provided in the embodiments of this application can be applied to terminal devices such as smartphones, tablets, laptops, desktop computers, or customized terminals. In scenarios where real-time audio and video playback is required, such as live video broadcasts and audio and video calls, audio and video playback can be controlled based on this audio and video playback control method, thereby improving the real-time performance of audio and video playback and achieving a good balance between reducing lag and ensuring real-time playback.
[0028] Figure 1 A flowchart of an audio and video playback control method provided in an embodiment of the present application specifically includes the following steps:
[0029] Step S101: when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition, determine a first interval percentile value of the decodable frame interval in the audio and video frames within a preset duration.
[0030] The number of valid peaks is the number of valid peaks determined. In one embodiment, a peak determination criterion is set to determine the presence of a peak based on the decodable time interval of audio and video. If the peak condition is met, a peak is determined to have occurred. The peak is further determined to be a valid peak and recorded. The peak reflects current network fluctuations and characterizes the length of the decodable frame interval of audio and video frames.
[0031] In one embodiment, when the number of valid peaks satisfies a jitter value adjustment condition, a first interval percentile of a decodable frame interval in audio or video frames within a preset duration is determined. The jitter value adjustment condition is a preset condition for triggering jitter value adjustment. The jitter value may be, for example, a corresponding jitter value in a spike filtering technique.
[0032] Optionally, the jitter value adjustment condition may be: the number of valid spikes is greater than or equal to a set correction trigger threshold, and the time interval since the most recent spike is less than or equal to a first preset time interval. For example, the correction trigger threshold may be 5, and the first preset time interval may be 10 seconds.
[0033] An exemplary value for the preset duration may be 10 seconds, and the first interval percentile value may be the 95th percentile of the decodable frame intervals among the audio and video frames counted within the preset duration. A percentile value is a characteristic number of a random variable. The area enclosed by the random variable distribution curve and the x-axis is divided into n equal parts, resulting in n-1 values (e.g., x_1, x_2, ..., x_n-1). These values are referred to as n percentile values.
[0034] Step S102: Acquire the set pull-up height value and the currently set jitter value, and determine the jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value.
[0035] In one embodiment, after determining the first interval percentile value of the decodable frame interval, the jitter target correction value is further determined in combination with the pull-up height value and the currently set jitter value. Optionally, the pull-up height value can be 200 milliseconds.
[0036] Optionally, the jitter target correction value may be determined based on the first interval percentile value, the pull-up height value, and the jitter value by calculating a first difference between the first interval percentile value and the jitter value, selecting the smaller value between the pull-up height value and the first difference, and summing the result with the jitter value to obtain the jitter target correction value. For example, taking the first interval percentile value as Iat95, the jitter value as jitter, and the pull-up height value as ExtraDelayLimit as an example, the formula for calculating the jitter target correction value is as follows:
[0037] jitter+min(ExtraDelayLimit, Iat95-jitter)
[0038] The jitter target correction value is used to correct the current jitter value to conform to the current network fluctuation. Optionally, the currently set jitter value can be a jitter value calculated by a conventional existing jitter value algorithm for the current decodable frame interval.
[0039] Step S103: correct the jitter value based on the jitter target correction value, and set the audio and video buffer based on the corrected jitter value.
[0040] In one embodiment, after determining the jitter target correction value, the jitter value is corrected based on the jitter target correction value. Alternatively, the jitter target correction value may be directly set as the jitter value, and the audio and video buffer is set based on the corrected jitter value.
[0041] In one embodiment, the length of buffered data in the audio and video buffer corresponding to different jitter values is preset, that is, after each jitter value is updated, the corresponding buffer length is used to buffer and store audio and video frame data.
[0042] From the above, it can be seen that when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment conditions, the first interval percentile value of the decodable frame interval in the audio and video frames within the preset duration is determined, the set pull-up height value and the currently set jitter value are obtained, and the jitter target correction value is determined according to the first interval percentile value, the pull-up height value and the jitter value. The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value. In this processing method, effective peaks are used to determine whether the jitter value adjustment conditions are triggered, avoiding the frequent adjustment of jitter values caused by singular spike samples. When adjusting the jitter value, adjustments are made based on the determined peak percentile value and the set pull-up height value. On the basis of covering most of the peaks, extremely individual higher peaks are prevented from raising the jitter value to an unreasonable range, and the jitter value pull-up range is controlled within a cost-effective and controllable range. The setting of the audio and video buffer based on the jitter value improves the real-time performance of the audio and video playback process, achieves a good balance between reducing jams and real-time playback, avoids the high audio and video playback delay caused by setting a larger buffer, and the audio and video playback jams caused by setting a smaller buffer, and avoids frequent and large adjustments of the buffer.
[0043] Figure 2 A flowchart of a method for correcting a jitter value based on a jitter target correction value provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, specifically including:
[0044] Step S201: When it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition, determine a first interval percentile value of the decodable frame interval in the audio and video frames within a preset duration.
[0045] Step S202: Acquire the set pull-up height value and the currently set jitter value, and determine the jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value.
[0046] Step S203: When the first interval percentile value is greater than or equal to the jitter value, the jitter value is set as the jitter target correction value; when the first interval percentile value is less than the jitter value, the second difference between the jitter target correction value of the previous round and the set descending step value is calculated, and the larger value between the jitter value and the second difference is determined as the jitter target correction value.
[0047] In one embodiment, in the process of correcting the jitter value according to the determined jitter target correction value, the correction processing mechanism is further optimized. Among them, when correcting the jitter value, the size relationship between the first interval percentile value and the jitter value is judged. Optionally, when the first interval percentile value is greater than or equal to the jitter value, the jitter value is set as the jitter target correction value; if the first interval percentile value is less than the jitter value, the second difference between the jitter target correction value of the previous round and the set decline step value is calculated, and the larger value between the jitter value and the second difference is determined as the jitter target correction value. Exemplarily, the decline step value can be 1 millisecond, recorded as JitterDeclineStepMs. For the case where the first interval percentile value is less than the jitter value, the correction formula is as follows:
[0048] jitter=max(jitter,prejitter-JitterDeclineStepMs)
[0049] Among them, prejitter is the jitter target correction value of the previous round.
[0050] Step S204: Setting the audio and video buffer based on the corrected jitter value.
[0051] As can be seen from the above, through the correction method of the jitter value set above, a more appropriate strategy is adopted to control the increase and decrease of jitter, making the overall control method smoother and realizing a fast-rise and slow-fall adjustment strategy. When it is decided that the jitter needs to be corrected and the 95th percentile value of the Iat interval is higher than the current jitter, the jitter is directly raised to the correction target; when the correction decision is not met or the 95th percentile value of the Iat interval is lower than the current jitter, the jitter value is reduced frame by frame. The rapid increase achieved by this method helps to respond in time when the network deteriorates, raising the jitter to an appropriate value, and slowly falling back can make the jitter smoother and improve the smoothness of playback. On the other hand, it can improve the fault tolerance of network jitter. When the network is intermittently stable, resulting in a short-term decrease in the peak frequency, the jitter will not be directly transferred to the original lower range. Therefore, when the peaks become frequent again, possible jamming can be better prevented, the amplitude of the re-regulation will also be smaller, and the jitter value regulation will be smoother.
[0052] Figure 3 A flowchart of a spike judgment standard and a method for performing effective spike recording provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, specifically including:
[0053] Step S301: Determine a second interval percentile value of a decodable frame interval in audio and video frames within a preset time window.
[0054] Optionally, the preset time window may be 10 seconds. That is, when determining the peak, first determine the second interval percentile of the decodable frame intervals in the audio and video frames within the preset time window. The second interval percentile may be the 50th interval percentile of the decodable frame intervals in the audio and video frames within 10 seconds, illustratively denoted as Iat50.
[0055] Step S302: When the decodable time interval of the audio and video frames is greater than the product of the second interval percentile value and the preset coefficient, or greater than the sum of the second interval percentile value and the set peak threshold, determine that a peak occurs.
[0056] When determining whether a peak occurs in the current audio or video frame, the judgment is made based on the second interval percentile value calculated above, the current decodable time interval, and the set peak threshold. Optionally, the preset coefficient can be 2, and the peak threshold can be 200 milliseconds. For example, the peak threshold is recorded as PeakHeightMs, and the method for determining whether a peak occurs is as follows:
[0057] Iat>Iat50+PeakHeightMs||Iat>2*Iat50
[0058] Step S303: When the peak meets the set valid peak condition, the valid peak is recorded and the time of the most recent peak occurrence is updated.
[0059] In one embodiment, after determining that a spike has occurred, it is further determined whether the spike is a valid spike, and the valid spike is recorded. Optionally, the valid spike condition may be: the time interval between the current spike and the last spike is less than or equal to a second preset time interval, wherein the second preset time interval may be 5 seconds, for example. That is, when it is determined that the time interval between the current spike and the last spike is less than or equal to the second preset time interval, the currently identified spike is determined to be a valid spike, recorded, and the last spike occurrence time is updated. Optionally, the valid spikes and the last spike occurrence time can be recorded by creating a record table.
[0060] In one embodiment, during the process of recording valid spikes and updating the time of the most recent spike, the mechanism for updating the time of the most recent spike is further optimized. Optionally, if the time interval between a spike and the most recent spike is greater than a second preset time interval and less than a third preset time interval, the spike time is updated to the time of the most recent spike. Exemplarily, the third preset time interval may be 10 seconds. Accordingly, if the time interval between the currently determined spike and the most recent spike is greater than the third preset time interval, the number of valid spikes recorded is reset to zero.
[0061] As can be seen from the above, since the network environment changes in real time, the detection and status maintenance of peaks are also judged and recorded based on time slices. Specially set peaks and valid peak judgment criteria are used, and valid peaks and corresponding time information are recorded. Subsequently, when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment conditions, the first interval percentile value of the decodable frame interval in the audio and video frames within the preset duration is determined, and the set pull-up height value and the currently set jitter value are obtained. The jitter target correction value is determined according to the first interval percentile value, the pull-up height value and the jitter value, and then the jitter value is corrected based on the jitter target correction value. The audio and video buffer is set based on the corrected jitter value, which improves the real-time performance of audio and video playback and achieves a good balance between reducing jams and real-time playback. It avoids the high audio and video playback delay caused by setting a larger buffer and the audio and video playback jams caused by setting a smaller buffer, while avoiding frequent and large adjustments of the buffer.
[0062] Figure 4 This is a structural block diagram of an audio and video playback control device provided in an embodiment of the present application. The device is used to execute the audio and video playback control method provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 4 As shown, the device specifically includes: an interval value determination module 101, a correction value determination module 102 and a jitter correction module 103, wherein,
[0063] The interval value determination module 101 is configured to determine a first interval percentile value of a decodable frame interval in the audio and video frames within a preset duration when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition 102;
[0064] a correction value determination module configured to obtain a set pull-up height value and a currently set jitter value, and determine a jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value;
[0065] The jitter correction module 103 is configured to correct the jitter value based on the jitter target correction value, and set the audio and video buffer based on the corrected jitter value.
[0066] It can be seen from the above scheme that when it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment conditions, the first interval percentile value of the decodable frame interval in the audio and video frames within the preset duration is determined, the set pull-up height value and the currently set jitter value are obtained, and the jitter target correction value is determined according to the first interval percentile value, the pull-up height value and the jitter value. The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value. In this processing method, effective peaks are used to determine whether the jitter value adjustment conditions are triggered, avoiding the frequent adjustment of jitter values caused by singular spike samples. When adjusting the jitter value, adjustments are made based on the determined peak percentile value and the set pull-up height value. On the basis of covering most of the peaks, extremely individual higher peaks are prevented from raising the jitter value to an unreasonable range, and the jitter value pull-up range is controlled within a cost-effective and controllable range. The setting of the audio and video buffer based on the jitter value improves the real-time performance of the audio and video playback process, achieves a good balance between reducing jams and real-time playback, avoids the high audio and video playback delay caused by setting a larger buffer, and the audio and video playback jams caused by setting a smaller buffer, and avoids frequent and large adjustments of the buffer.
[0067] In a possible embodiment, the correction value determination module 102 is configured to:
[0068] Calculating a first difference between the first interval percentile value and the jitter value;
[0069] A smaller value is selected between the pull-up height value and the first difference value and added to the jitter value to obtain a jitter target correction value.
[0070] In a possible embodiment, the shake correction module 103 is configured as follows:
[0071] If the first interval percentile value is greater than or equal to the jitter value, setting the jitter value as the jitter target correction value;
[0072] When the first interval percentile value is smaller than the jitter value, a second difference between the jitter target correction value of the previous round and the set descending step value is calculated, and the larger value between the jitter value and the second difference is determined as the jitter target correction value.
[0073] In a possible embodiment, the number of valid peaks of the audio and video frame meeting the jitter value adjustment condition includes:
[0074] The number of valid peaks of the audio and video frames is greater than or equal to the set correction trigger threshold, and the time interval from the most recent peak is less than or equal to the first preset time interval.
[0075] In a possible embodiment, the apparatus further includes a peak recording module 104 configured to:
[0076] Before determining the first interval percentile value of the decodable frame interval in the audio and video frames within the preset time length, determining the second interval percentile value of the decodable frame interval in the audio and video frames within the preset time window;
[0077] When the decodable time interval of the audio and video frames is greater than the product of the second interval percentile value and a preset coefficient, or greater than the sum of the second interval percentile value and a set peak threshold, determining that a peak occurs;
[0078] When the spike meets the set valid spike condition, the valid spike is recorded and the time of the most recent spike occurrence is updated.
[0079] In a possible embodiment, the peak satisfies a set valid peak condition, including:
[0080] The time interval between the peak and the most recent peak is less than or equal to a second preset time interval.
[0081] In a possible embodiment, the peak recording module 104 is configured to:
[0082] Record the effective spikes, and when the time interval between the spike and the most recent spike is greater than the second preset time interval and less than the third preset time interval, update the spike occurrence time to the most recent spike occurrence time.
[0083] In a possible embodiment, the peak recording module 104 is configured to:
[0084] In a case where the time interval between the peak and the most recent peak is greater than the third preset time interval, the number of recorded valid peaks is reset to zero.
[0085] Figure 5 A schematic diagram of the structure of an audio and video playback control device provided in an embodiment of the present application is shown as follows: Figure 5 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 5 In the embodiment, a processor 201 is used as an example; the processor 201, the memory 202, the input device 203 and the output device 204 in the device can be connected by a bus or other means. Figure 5The example of the connection via bus is taken. The memory 202, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the audio and video playback control method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, realizes the above-mentioned audio and video playback control method. The input device 203 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0086] An embodiment of the present application further provides a non-volatile storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to perform an audio and video playback control method described in the above embodiment, which includes:
[0087] When it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition, determining a first interval percentile value of the decodable frame interval in the audio and video frames within a preset time length;
[0088] Obtaining a set pull-up height value and a currently set jitter value, and determining a jitter target correction value according to the first interval percentile value, the pull-up height value, and the jitter value;
[0089] The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value.
[0090] It is worth noting that in the embodiment of the above-mentioned audio and video playback control device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of this application.
[0091] In some possible implementations, various aspects of the method provided herein may also be implemented in the form of a program product, which includes program code. When the program product is executed on a computer device, the program code is used to cause the computer device to perform the steps of the method according to the various exemplary embodiments of the present application described above in this specification. For example, the computer device may perform the audio and video playback control method described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.
Claims
1. An audio and video playback control method, characterized in that: include: When it is detected that the number of valid peaks of the audio and video frames meets the jitter value adjustment condition, determining a first interval percentile value of the decodable frame interval in the audio and video frames within a preset time length; Obtaining a set pull-up height value and a currently set jitter value, calculating a first difference between the first interval percentile value and the jitter value, selecting a smaller value between the pull-up height value and the first difference and summing the result with the jitter value to obtain a jitter target correction value; The jitter value is corrected based on the jitter target correction value, and the audio and video buffer is set based on the corrected jitter value.
2. The audio and video playback control method according to claim 1, wherein: The correcting the jitter value based on the jitter target correction value includes: If the first interval percentile value is greater than or equal to the jitter value, setting the jitter value as the jitter target correction value; When the first interval percentile value is smaller than the jitter value, a second difference between the jitter target correction value of the previous round and the set descending step value is calculated, and the larger value between the jitter value and the second difference is determined as the jitter target correction value.
3. The audio and video playback control method according to any one of claims 1-2, characterized in that: The number of valid peaks of the audio and video frames satisfies the jitter value adjustment condition, including: The number of valid peaks of the audio and video frames is greater than or equal to the set correction trigger threshold, and the time interval from the most recent peak is less than or equal to the first preset time interval.
4. The audio and video playback control method according to any one of claims 1-2, characterized in that: Before determining the first interval percentile value of the decodable frame interval in the audio and video frames within the preset duration, the method further includes: Determining a second interval percentile value of a decodable frame interval in audio and video frames within a preset time window; When the decodable time interval of the audio and video frames is greater than the product of the second interval percentile value and a preset coefficient, or greater than the sum of the second interval percentile value and a set peak threshold, determining that a peak occurs; When the spike meets the set valid spike condition, the valid spike is recorded and the time of the most recent spike occurrence is updated.
5. The audio and video playback control method according to claim 4, characterized in that: The peak meets the set valid peak conditions, including: The time interval between the peak and the most recent peak is less than or equal to a second preset time interval.
6. The audio and video playback control method according to claim 5, characterized in that: The recording of effective spikes and the updating of the time of the most recent spike occurrence include: Record the effective spikes, and when the time interval between the spike and the most recent spike is greater than the second preset time interval and less than the third preset time interval, update the spike occurrence time to the most recent spike occurrence time.
7. The audio and video playback control method according to claim 6, characterized in that: In a case where the time interval between the peak and the most recent peak is greater than the third preset time interval, the number of recorded valid peaks is reset to zero.
8. An audio and video playback control device, characterized in that: include: an interval value determination module configured to determine a first interval percentile value of a decodable frame interval in the audio and video frames within a preset duration when it is detected that the number of valid peaks in the audio and video frames meets the jitter value adjustment condition; a correction value determination module configured to obtain a set pull-up height value and a currently set jitter value, calculate a first difference between the first interval percentile value and the jitter value, select a smaller value between the pull-up height value and the first difference, and sum the result with the jitter value to obtain a jitter target correction value; The jitter correction module is configured to correct the jitter value based on the jitter target correction value and set the audio and video buffer based on the corrected jitter value.
9. An audio and video playback control device, comprising: one or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the audio and video playback control method according to any one of claims 1 to 7.
10. A non-volatile storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to execute the audio and video playback control method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the audio and video playback control method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Live broadcast chorus method and device, electronic equipment and storage medium
CN110992920A
Network delay updating method and system, electronic equipment and storage medium
CN112637016A