A streaming media audio and video synchronization method and terminal equipment, control device, medium
By calculating the delay length of the audio and video cache data in the terminal device and adjusting the playback speed, the problem of audio and video data mismatch in streaming media playback is solved, efficient audio and video synchronization playback is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202211043840.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-08-26
AI Technical Summary
During the streaming media playback process, due to abnormal conditions such as network fluctuations, the cached playback time of audio and video data does not match the required playback time, resulting in the delay time of audio and video being greater than the synchronization playback delay threshold, affecting the user experience. Existing technology Complex to process and stressful on the processor.
By generating audio and video acquisition requests that require playback time in the terminal device, the delay length of the audio and video cache data is calculated. If the synchronization playback delay threshold is exceeded, the playback speed of the audio or video cache data is adjusted to delay it. The duration is less than the threshold, enabling synchronous playback of audio and video data.
It simplifies the processing process of synchronous playback of audio and video data, reduces processor pressure, and effectively reduces the audio and video delay time by adjusting the playback speed, ensuring the synchronization of playback and improving the user experience.
Smart Images

Figure CN115484483B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a streaming media audio and video synchronization method, terminal equipment, a control device, and a medium. Background Art
[0002] Streaming media refers to the form of transmitting multimedia files such as audio data and video data in a streaming manner over the Internet. The typical feature of streaming media is that continuous audio data and video data are compressed and put on a network server, and the audio data and video data are obtained from the network server after the client sends a request. However, there is no need to wait for the audio data and video data to be completely downloaded. Instead, part of it can be cached and played.
[0003] However, when there are network fluctuations or other abnormal situations, the video and audio playback may be stuck, and even cause each frame of the audio and video to not correspond. This error gradually accumulates, seriously affecting the user experience. Therefore, during the playback process, the cached audio data and video data need to be synchronized. In the past, the audio data was generally processed and played according to the time frame of the video data, or the video data was processed and played according to the sampling rate of the audio data. However, in streaming media, both audio data and video data are only part of the cached data. The above methods are relatively complicated and require a large amount of processing, which puts a lot of processing pressure on the processor. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a streaming media audio and video synchronization method and terminal equipment, control device, and medium, which are efficient in processing and can better achieve synchronous playback of audio and video data.
[0005] A streaming media audio and video synchronization method according to an embodiment of the first aspect of the present invention includes the following steps: sending an audio acquisition request and a video acquisition request, both of which have a required playback duration of a first time value; acquiring audio cache data and video cache data, wherein the audio cache playback duration of the audio cache data is a second time value, and the video cache playback duration of the video cache data is a third time value; calculating the difference between the audio cache playback duration and the required playback duration to obtain an audio delay duration, and if the audio delay duration is greater than a synchronous playback delay threshold, adjusting the playback speed of the audio cache data so that the audio delay duration is less than the synchronous playback delay threshold; calculating the difference between the video cache playback duration and the required playback duration to obtain a video delay duration, and if the video delay duration is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data so that the video delay duration is less than the synchronous playback delay threshold.
[0006] A streaming media audio and video synchronization method according to an embodiment of the present invention has at least the following beneficial effects:
[0007] The streaming media audio and video synchronization method of the present invention uses a local client clock to generate and send an audio acquisition request and a video acquisition request whose required playback durations are both first time values. At this time, the network server will respond to the request of the local client and send the transmission audio cache data and the video cache data to the local client. However, due to network fluctuations or other situations, the cache playback duration of the audio cache data and the video cache data is not necessarily equal to the required playback duration. Since the same required playback duration is used to request and obtain the audio and video respectively, the duration deviation of the audio cache data and the video cache data will not be too large. At this time, the same synchronous playback delay threshold is used to judge the audio delay duration and the video delay duration respectively. If it is greater than the synchronous playback delay threshold, the playback speed of the audio cache data or the video cache data is adjusted accordingly, and finally the audio delay duration and the video delay duration are made less than the synchronous playback delay threshold. At this time, although there is still a deviation in the playback duration of the audio cache data and the video cache data, after the above processing, the deviation has been reduced to a smaller value, which can meet the playback requirements and achieve basic synchronization. The design is efficient and simple in processing and can better achieve synchronous playback of audio and video data.
[0008] According to some embodiments of the present invention, in calculating the difference between the audio cache playback duration and the required playback duration to obtain the audio delay duration, if the audio delay duration is greater than the synchronous playback delay threshold, adjusting the playback speed of the audio cache data includes: S310, calculating the difference between the audio cache playback duration and the required playback duration to obtain the audio delay duration; S320, determining whether the audio delay duration is greater than the synchronous playback delay threshold; S330, if the audio delay duration is greater than the synchronous playback delay threshold, adjusting the playback speed of the audio cache data to update the audio cache playback duration; and looping S310-S330 until the audio delay duration is less than the synchronous playback delay threshold.
[0009] According to some embodiments of the present invention, in S330, the playback speed of the audio cache data is adjusted by adjusting the audio sampling rate of the audio cache data, wherein the audio sampling rate is the sampling amount of the audio analog signal per unit time.
[0010] According to some embodiments of the present invention, in calculating the difference between the video cache playback time and the required playback time to obtain the video delay time, if the video delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data includes: S410, calculating the difference between the video cache playback time and the required playback time to obtain the video delay time; S420, determining whether the video delay time is greater than the synchronous playback delay threshold; S430, if the video delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data to update the video cache playback time; looping S410-S430 until the video delay time is less than the synchronous playback delay threshold.
[0011] According to some embodiments of the present invention, in S430, the playback speed of the video cache data is adjusted by adjusting the number of image frames played per unit time in the video cache data.
[0012] According to some embodiments of the present invention, the synchronization method further includes: setting the required playback duration before sending the audio acquisition request and the video acquisition request; and correcting the synchronous playback delay threshold according to the required playback duration.
[0013] According to some embodiments of the present invention, the required playback duration and the synchronous playback delay threshold are in a linear relationship.
[0014] According to the second aspect of the present invention, the terminal device includes: a transmission module, which is used to send an audio acquisition request and a video acquisition request, both of which have a required playback duration of a first time value, and obtain audio cache data and video cache data; a processing module, which is used to calculate the difference between the audio cache playback duration and the required playback duration to obtain an audio delay duration, and if the audio delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the audio cache data so that the audio delay duration is less than the synchronous playback delay threshold; and calculate the difference between the video cache playback duration and the required playback duration to obtain a video delay duration, and if the video delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data so that the video delay duration is less than the synchronous playback delay threshold; and a playback module, which plays the audio cache data and the video cache data at the adjusted playback speed.
[0015] The terminal device according to the embodiment of the present invention has at least the following beneficial effects:
[0016] The terminal device of the present invention utilizes the clock of the local client to generate and transmits an audio acquisition request and a video acquisition request whose required playback durations are both the first time value through a transmission module. At this time, the network server will respond to the request of the local client and transmit the audio cache data and the video cache data to the local client. However, due to network fluctuations or other situations, the cached playback duration of the audio cache data and the video cache data is not necessarily equal to the required playback duration. Since the same required playback duration is used to request the audio and video respectively, the duration deviation of the audio cache data and the video cache data will not be too large. At this time, the processing module uses the same synchronous playback delay threshold to judge the audio delay duration and the video delay duration respectively. If it is greater than the synchronous playback delay threshold, the playback speed of the audio cache data or the video cache data is adjusted accordingly, and finally the audio delay duration and the video delay duration are less than the synchronous playback delay threshold. At this time, although there is still a deviation in the playback duration of the audio cache data and the video cache data, after the above processing, the deviation has been reduced to a smaller value, which can meet the playback requirements and achieve basic synchronization. The design is efficient and simple in processing and can better achieve synchronous playback of audio and video data.
[0017] According to an embodiment of the third aspect of the present invention, the control device includes: one or more memories; one or more processors, used to execute one or more computer programs stored in the one or more memories, and also used to execute a streaming media audio and video synchronization method disclosed in any of the above embodiments.
[0018] According to the computer-readable storage medium of the fourth aspect of the present invention, the computer-readable storage medium includes instructions, which, when executed on a computer, enables the computer to execute a streaming media audio and video synchronization method disclosed in any of the above embodiments.
[0019] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0021] Figure 1 This is a main flow chart of one embodiment of the streaming media audio and video synchronization method of the present invention;
[0022] Figure 2 A flowchart of processing audio cache data of one embodiment of the streaming media audio and video synchronization method of the present invention;
[0023] Figure 3A flowchart of processing video cache data of one embodiment of the streaming media audio and video synchronization method of the present invention;
[0024] Figure 4 It is a principle structure block diagram of one embodiment of the terminal device of the present invention;
[0025] Figure 5 This is a principle structural block diagram of one embodiment of the control device of the present invention.
[0026] Reference numerals:
[0027] Transmission module 100; processing module 200; playback module 300; memory 400; processor 500. DETAILED DESCRIPTION
[0028] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0029] In the description of the present invention, it should be understood that descriptions involving orientation, such as the orientations or positional relationships indicated by terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside” and “outside” are based on the orientations or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0030] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0031] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0032] like Figure 1 As shown in FIG. 3 , a streaming media audio and video synchronization method according to an embodiment of the first aspect of the present invention comprises the following steps:
[0033] S100, sending an audio acquisition request and a video acquisition request, both of which require a playback duration of the first time value;
[0034] S200, obtaining audio cache data and video cache data, wherein the audio cache playback duration of the audio cache data is a second time value, and the video cache playback duration of the video cache data is a third time value;
[0035] S300, calculating the difference between the audio cache playback time and the required playback time to obtain the audio delay time, and if the audio delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the audio cache data so that the audio delay time is less than the synchronous playback delay threshold;
[0036] S400, calculating the difference between the video cache playback time and the required playback time to obtain the video delay time; if the video delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data so that the video delay time is less than the synchronous playback delay threshold.
[0037] Among them, it should be noted that the audio acquisition request and the video acquisition request whose required playback duration are both the first time value are formulated with reference to the local clock of the client, and the network server provides the client with corresponding audio cache data and video cache data based on the audio acquisition request and the video acquisition request.
[0038] The streaming media audio and video synchronization method of the present invention utilizes a local client to send an audio acquisition request and a video acquisition request, both of which have a required playback duration of a first time value. At this time, the network server will respond to the request of the local client and send the transmission audio cache data and the video cache data to the local client. However, due to network fluctuations or other situations, the cache playback duration of the audio cache data and the video cache data may not be equal to the required playback duration. Since the same required playback duration is used to request and obtain the audio and video respectively, the duration deviation of the audio cache data and the video cache data will not be too large. At this time, the same synchronous playback delay threshold is used to judge the audio delay duration and the video delay duration respectively. If it is greater than the synchronous playback delay threshold, the playback speed of the audio cache data or the video cache data is adjusted accordingly, and finally the audio delay duration and the video delay duration are made less than the synchronous playback delay threshold. At this time, although there is still a deviation in the playback duration of the audio cache data and the video cache data, after the above processing, the deviation has been reduced to a smaller value, which can meet the playback requirements and achieve basic synchronization. The design is efficient and simple in processing and can better achieve synchronous playback of audio and video data.
[0039] In some embodiments of the present invention, Figure 2 As shown, when calculating the difference between the audio cache playback time and the required playback time to obtain the audio delay time, if the audio delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the audio cache data includes:
[0040] S310, calculating the difference between the audio cache playback time and the required playback time to obtain the audio delay time;
[0041] S320, determining whether the audio delay duration is greater than the synchronous playback delay threshold;
[0042] S330: If the audio delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the audio buffer data to update the audio buffer playback duration;
[0043] S310 - S330 are repeated until the audio delay duration is less than the synchronous playback delay threshold.
[0044] Specifically, the first time value of the required playback time is T0, the second time value of the audio cache playback time is T1, the third time value of the video cache playback time is T2, the audio delay time ΔT1 = T1 - T0, and the audio delay time ΔT1 and the synchronous playback delay threshold are used for judgment. When the audio delay time is greater than the synchronous playback delay threshold, the playback speed of the audio cache data is adjusted, and then the audio cache playback time can be updated. The process of S310-S330 is continuously repeated until the final audio delay time meets the synchronous playback delay threshold.
[0045] In some embodiments of the present invention, the playback speed of the audio cache data can be adjusted by adjusting the acquisition rate, sampling format, channel layout, etc. Specifically, in S330, the playback speed of the audio cache data is adjusted by adjusting the audio sampling rate of the audio cache data, wherein the audio sampling rate is the sampling amount of the audio analog signal per unit time.
[0046] The audio sampling rate can be adjusted according to the following formula: audio playback time Ty of one frame = total number of audio samples Samples / audio sampling rate. The audio playback time Ty is adjusted by changing the audio sampling rate, thereby adjusting the playback speed of the audio cache data.
[0047] In some embodiments of the present invention, Figure 3 As shown, when calculating the difference between the video cache playback time and the required playback time to obtain the video delay time, if the video delay time is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data includes:
[0048] S410, calculating the difference between the video cache playback time and the required playback time to obtain the video delay time;
[0049] S420, determining whether the video delay duration is greater than the synchronous playback delay threshold;
[0050] S430: If the video delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data to update the video cache playback duration;
[0051] S410 - S430 are repeated until the video delay duration is less than the synchronous playback delay threshold.
[0052] The video delay duration ΔT2=T2-T0, and the video delay duration ΔT2 and the synchronous playback delay threshold are used for judgment. When the video delay duration is greater than the synchronous playback delay threshold, the playback speed of the video cache data is adjusted, and then the video cache playback duration can be updated. S410-S430 is continuously cycled until the final video delay duration meets the synchronous playback delay threshold.
[0053] In some embodiments of the present invention, in S430, the playback speed of the video cache data is adjusted by adjusting the number of image frames played per unit time in the video cache data. Specifically, the number of image frames played per unit time can be increased to increase the playback speed, thereby reducing the video cache playback time.
[0054] In some embodiments of the present invention, when obtaining audio cache data and video cache data in step S200, the client pulls the stream from the network server, selects one of the server's streaming protocols, and then starts pulling the stream. The application layer protocol is HLS, RTSP and RTMP, the transport layer protocol is RTCP and RTP, and the network layer protocol is RSVP. Secondly, hard coding and soft coding are used for decoding. The video data format is finally YUV and RGB, and the audio data format is PCM.
[0055] In some embodiments of the present invention, the synchronization method further includes: setting a required playback duration before sending an audio acquisition request and a video acquisition request; and correcting a synchronization playback delay threshold according to the required playback duration.
[0056] Among them, the required playback time can be set by the user or the manufacturer according to the actual situation. The required playback time should not be too long and can generally be set to about 500ms. As the required playback time changes, the audio delay time and the video delay time will also change accordingly. Therefore, the synchronous playback delay threshold also needs to be corrected accordingly, so that the audio and video playback can be better synchronized.
[0057] In some embodiments of the present invention, the required playback duration and the synchronous playback delay threshold are in a linear relationship, so that the synchronous playback delay threshold can be reasonably modified according to the change of the required playback duration, so that the playback of audio and video can be better synchronized.
[0058] Specifically, the synchronous playback delay threshold can be corrected according to a linear formula, y=ax+b, where x is the required playback duration, y is the synchronous playback delay threshold, and a and b are constants set by the manufacturer according to actual conditions.
[0059] According to a terminal device of a second aspect of the present invention, Figure 4 As shown, it includes: a transmission module 100, which is used to send an audio acquisition request and a video acquisition request whose required playback durations are both first time values, and to obtain audio cache data and video cache data; a processing module 200, which is used to calculate the difference between the audio cache playback duration and the required playback duration to obtain an audio delay duration, and if the audio delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the audio cache data so that the audio delay duration is less than the synchronous playback delay threshold; and calculate the difference between the video cache playback duration and the required playback duration to obtain a video delay duration, and if the video delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data so that the video delay duration is less than the synchronous playback delay threshold; a playback module 300, which plays the audio cache data and the video cache data at the adjusted playback speed.
[0060] The transmission module 100 may be a network port, a mobile communication chip, etc., the processing module 200 may be composed of a processor such as an MCU, a CPU, and auxiliary circuits, and the playback module 300 may include a display screen and a speaker.
[0061] The terminal device of the present invention uses the clock of the local client to generate and send an audio acquisition request and a video acquisition request whose required playback durations are both the first time value through the transmission module 100. At this time, the network server will respond to the request of the local client and send the transmission audio cache data and the video cache data to the local client. However, due to network fluctuations or other situations, the cached playback duration of the audio cache data and the video cache data is not necessarily equal to the required playback duration. Since the same required playback duration is used to request the audio and video respectively, the duration deviation of the audio cache data and the video cache data will not be too large. At this time, the processing module 200 uses the same synchronous playback delay threshold to judge the audio delay duration and the video delay duration respectively. If it is greater than the synchronous playback delay threshold, the playback speed of the audio cache data or the video cache data is adjusted accordingly, and finally the audio delay duration and the video delay duration are less than the synchronous playback delay threshold. At this time, although there is still a deviation in the playback duration of the audio cache data and the video cache data, after the above processing, the deviation has been reduced to a smaller value, which can meet the playback requirements and achieve basic synchronization. The design is efficient and simple, and can better achieve synchronous playback of audio and video data.
[0062] According to a control device of a third aspect of the present invention, Figure 5 As shown, it includes: one or more memories 400; one or more processors 500, which are used to execute one or more computer programs stored in the one or more memories 400, and are also used to execute a streaming media audio and video synchronization method disclosed in any of the above embodiments.
[0063] It should be noted that the specific implementation process of this embodiment can refer to the specific implementation process of the above method embodiment, which will not be described here.
[0064] According to the computer-readable storage medium of the fourth aspect of the present invention, the computer-readable storage medium includes instructions, which, when executed on a computer, enables the computer to execute a streaming media audio and video synchronization method disclosed in any of the above embodiments.
[0065] It should be noted that the specific implementation process of this embodiment can refer to the specific implementation process of the above method embodiment, which will not be described here.
[0066] The embodiments of the present application further disclose a computer program product, wherein when the computer program product is executed on a computer, the computer is enabled to execute part or all of the steps of the methods in the above method embodiments.
[0067] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read only memory (EPROM), a one-time programmable read only memory (OTPROM), an electrically-erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0068] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0069] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A streaming media audio and video synchronization method, It is characterized in that The following steps are involved: Send an audio acquisition request and a video acquisition request, both of which require playback duration to be the first time value; Acquire audio cache data and video cache data, wherein the audio cache playback duration of the audio cache data is a second time value, and the video cache playback duration of the video cache data is a third time value; Calculate the difference between the audio cache playback time and the required playback time to obtain the audio delay time, and if the audio delay time is greater than the synchronous playback delay threshold, adjust the playback speed of the audio cache data so that the audio delay time is less than the synchronous playback delay threshold; Calculate the difference between the video cache playback time and the required playback time to obtain the video delay time, and if the video delay time is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data so that the video delay time is less than the synchronous playback delay threshold; In calculating the difference between the audio cache playback duration and the required playback duration to obtain the audio delay duration, if the audio delay duration is greater than the synchronous playback delay threshold, adjusting the playback speed of the audio cache data includes: S310, calculating the difference between the audio cache playback time and the required playback time to obtain the audio delay time; S320, determining whether the audio delay duration is greater than the synchronous playback delay threshold; S330: If the audio delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the audio cache data to update the audio cache playback duration; The process of steps S310 - S330 is repeated until the audio delay duration is less than the synchronous playback delay threshold.
2. A streaming media audio and video synchronization method according to claim 1, Features: In S330, the playback speed of the audio buffer data is adjusted by adjusting the audio sampling rate of the audio buffer data, wherein the audio sampling rate is the sampling amount of the audio analog signal per unit time.
3. A streaming media audio and video synchronization method according to claim 1, Features: In calculating the difference between the video cache playback duration and the required playback duration to obtain the video delay duration, if the video delay duration is greater than the synchronous playback delay threshold, adjusting the playback speed of the video cache data includes: S410, calculating the difference between the video cache playback time and the required playback time to obtain the video delay time; S420, determining whether the video delay duration is greater than the synchronous playback delay threshold; S430: If the video delay duration is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data to update the video cache playback duration; The process of steps S410 - S430 is repeated until the delay time of the video is less than the synchronous playback delay threshold.
4. A streaming media audio and video synchronization method according to claim 3, Features: In the S430, the playing speed of the video buffer data is adjusted by adjusting the number of image frames played per unit time in the video buffer data.
5. A streaming media audio and video synchronization method according to claim 1, It is characterized in that Also includes: Setting the required playback duration before sending the audio acquisition request and the video acquisition request; And the synchronous playback delay threshold is modified according to the required playback duration.
6. A streaming media audio and video synchronization method according to claim 5, It is characterized in that The required playback duration and the synchronous playback delay threshold are in a linear relationship.
7. A terminal device, used to implement the streaming media audio and video synchronization method according to any one of claims 1 to 6, It is characterized in that include: A transmission module, used for sending an audio acquisition request and a video acquisition request whose required playback durations are both the first time value, and acquiring audio cache data and video cache data; A processing module, configured to calculate the difference between the audio cache playback time and the required playback time to obtain the audio delay time, and if the audio delay time is greater than the synchronous playback delay threshold, adjust the playback speed of the audio cache data so that the audio delay time is less than the synchronous playback delay threshold; and calculate the difference between the video cache playback time and the required playback time to obtain the video delay time, and if the video delay time is greater than the synchronous playback delay threshold, adjust the playback speed of the video cache data so that the video delay time is less than the synchronous playback delay threshold; The playing module plays the audio buffer data and the video buffer data at an adjusted playing speed.
8. A control device, It is characterized in that include: one or more memories; One or more processors, used to execute one or more computer programs stored in the one or more memories, and also used to execute a streaming media audio and video synchronization method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The method comprises instructions which, when executed on a computer, enable the computer to execute a streaming media audio and video synchronization method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Live broadcast client audio and video delay adjustment playing system and method
CN111355975A
