Audio and video synchronization method and device, storage medium and electronic device
By calculating the correction time between the master and slave devices and synchronously changing the playback status of audio and video data, the problem of audio and video not being able to play synchronously on multiple devices is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202180003121.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2041-10-27
AI Technical Summary
The inability to synchronize audio and video playback across multiple devices results in a poor playback experience, especially in spliced screens where the cut audio and video need to be re-decoded, increasing jagged edges and reducing the user experience.
By determining the reception time between the master and slave devices, calculating the correction time, and synchronously changing the playback status of audio and video data based on the correction time, the synchronization of time and playback status between the master and slave devices is achieved.
It enables synchronized playback of audio and video data across multiple devices, improving the user's viewing experience and avoiding the problem of synchronized playback in existing technologies.
Smart Images

Figure CN116368809B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of audio and video technology, and particularly relates to an audio and video synchronization method and device, a computer readable storage medium and an electronic device. BACKGROUND
[0002] With the development of the field of audio and video technology, in more audio and video application scenarios, it is necessary to synchronously play the same audio and video in multiple devices to increase the number of audiences watching the audio and video and improve the playing effect of the audio and video.
[0003] In the related art, after the same audio and video is simultaneously pushed to multiple devices, the synchronous playing of the audio and video cannot be realized, resulting in poor audio and video watching experience. In particular, in a spliced screen, the received audio and video is the audio and video after cutting the original audio and video, and the cut audio and video needs to be re-decoded when playing, which further reduces the degree of synchronization of playing the same audio and video on the spliced screen, and thus increases the sawtooth feeling of the audio and video playing picture, and further reduces the watching experience of the user.
[0004] Therefore, there is an urgent need in the art to develop a new audio and video synchronization method and device.
[0005] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and thus can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0006] The purpose of the present disclosure is to provide an audio and video synchronization method, an audio and video synchronization device, a computer readable storage medium and an electronic device, and thus at least to some extent, overcome the problem that the same audio and video cannot be synchronously played in multiple devices due to the related art.
[0007] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.
[0008] According to a first aspect of an embodiment of the present application, an audio-video synchronization method is provided. The method comprises: determining target audio-video data, wherein the target audio-video data is used for synchronously playing between a master playing device and a slave playing device; determining a first receiving time when a first master-slave signal is received, and determining a second receiving time when a second master-slave signal is received; wherein the first master-slave signal and the second master-slave signal are both sent by the master playing device to the slave playing device; calculating a correction time based on the first receiving time and the second receiving time, and correcting the slave playing device based on the correction time; and synchronously changing a playing state of the target audio-video data between the master playing device and the slave playing device based on the correction time.
[0009] In an exemplary embodiment of the present application, before the step of determining the second receiving time when the second master-slave signal is received, the method further comprises: sending a master-slave signal to the master playing device, and receiving a second master-slave signal sent by the master playing device to determine the second receiving time when the second master-slave signal is received; wherein the master-slave signal is sent by the slave playing device after receiving the first master-slave signal, and the second master-slave signal is sent by the master playing device after receiving the master-slave signal.
[0010] In an exemplary embodiment of the present application, the step of calculating the correction time based on the first receiving time and the second receiving time comprises: obtaining a correction time calculation formula, and calculating the correction time based on the correction time calculation formula.
[0011] In an exemplary embodiment of the present application, the step of correcting the slave playing device based on the correction time comprises: receiving a first absolute time sent by the master playing device, and determining a second absolute time corresponding to the slave playing device; calculating a target absolute time based on the first absolute time and the correction time, and replacing the second absolute time with the target absolute time to correct the slave playing device.
[0012] In an exemplary embodiment of the present application, the step of synchronously changing the playing state of the target audio-video data between the master playing device and the slave playing device comprises: obtaining a third absolute time sent by the master playing device, and calculating a calculation result based on the third absolute time and the correction time; wherein the third absolute time is obtained by updating the first absolute time; updating the target absolute time based on the calculation result, and replacing the second absolute time with the updated target absolute time to correct the slave playing device.
[0013] In an example embodiment of the present application, the step of synchronously changing the playing state of the target audio / video data between the master playing device and the slave playing device based on the modified time comprises: receiving a synchronous pause / play instruction sent by the master playing device and determining a first instruction processing time corresponding to the synchronous pause / play instruction; and based on the time synchronization and the current playing state of the target audio / video data, synchronously pausing the target audio / video data at the first instruction processing time or synchronously playing the target audio / video data at the first instruction processing time.
[0014] In an example embodiment of the present application, the step of synchronously changing the playing state of the target audio / video data between the master playing device and the slave playing device based on the modified time comprises: receiving a fast forward or fast backward playing instruction sent by the master playing device and determining a second instruction processing time and a third instruction processing time according to the fast forward or fast backward playing instruction; and based on the modified time, synchronously pausing the playing of the target audio / video data at the second instruction processing time and synchronously playing the target audio / video data at the third instruction processing time.
[0015] In an example embodiment of the present application, the step of determining the target audio / video data comprises: listening to a broadcast port created by the master playing device and receiving broadcast data sent by the master playing device from the broadcast port; wherein the broadcast data comprises a to-be-played audio / video name and a data size corresponding to the to-be-played audio / video name; if there is to-be-played audio / video data corresponding to the to-be-played audio / video name and a target data size corresponding to the to-be-played audio / video data is consistent with the data size, determining the to-be-played audio / video data as the target audio / video data; if there is to-be-played audio / video data corresponding to the to-be-played audio / video name and a target data size corresponding to the to-be-played audio / video data is inconsistent with the data size, receiving target audio / video data corresponding to the broadcast data transmitted by an audio / video server in the master playing device; and if there is no to-be-played audio / video data corresponding to the to-be-played audio / video name, receiving the target audio / video data corresponding to the broadcast data transmitted by the audio / video server.
[0016] According to a second aspect of the embodiments of the present application, an audio-video synchronization device is provided, which comprises: a first determining module configured to determine target audio-video data, wherein the target audio-video data is used for synchronously playing between a master playing device and a slave playing device; a second determining module configured to determine a first receiving time when a first master-slave signal is received, and determine a second receiving time when a second master-slave signal is received; wherein the first master-slave signal and the second master-slave signal are both sent by the master playing device; a correcting module configured to calculate the first receiving time and the second receiving time to obtain a corrected time, and correct the slave playing device according to the corrected time, so as to realize time synchronization between the master playing device and the slave playing device; and a synchronizing module configured to change a playing state of the target audio-video data between the master playing device and the slave playing device based on the time synchronization.
[0017] According to a third aspect of the embodiments of the present application, an audio-video synchronization device is provided, which comprises: a master playing device configured to send a first master-slave signal and a second master-slave signal to a slave playing device;
[0018] a slave playing device configured to determine target audio-video data, wherein the target audio-video data is used for synchronously playing between a master playing device and a slave playing device; determine a first receiving time when a first master-slave signal is received, and determine a second receiving time when a second master-slave signal is received; calculate the first receiving time and the second receiving time to obtain a corrected time, and correct the slave playing device according to the corrected time; change a playing state of the target audio-video data between the master playing device and the slave playing device based on the corrected time.
[0019] According to a fourth aspect of the embodiments of the present application, an electronic device is provided, which comprises: a processor and a memory; wherein the memory has computer readable instructions stored thereon, and the computer readable instructions are executed by the processor to implement the audio-video synchronization method of any of the above example embodiments.
[0020] According to a fifth aspect of the embodiments of the present application, a computer readable storage medium is provided, which has a computer program stored thereon, and the computer program is executed by a processor to implement the audio-video synchronization method in any of the above example embodiments.
[0021] According to the above technical solutions, the audio-video synchronization method, the audio-video synchronization device, the computer storage medium and the electronic device in the example embodiments of the present application have at least the following advantages and positive effects:
[0022] In the method and device provided in the exemplary embodiments of the present disclosure, on one hand, the first receiving time and the second receiving time are calculated to obtain a corrected time, and the time correction is performed on the playing device according to the corrected time, so that the time synchronization between the master playing device and the slave playing device is realized; on the other hand, based on the corrected time, the synchronous change of the playing state of the target audio and video data between the master playing device and the slave playing device can be realized, which avoids the phenomenon that the same audio and video cannot be played synchronously in multiple devices in the prior art, and improves the experience of the user watching the audio and video.
[0023] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0024] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0025] Figure 1 The flowchart schematically shows the audio and video synchronization method in the embodiments of the present disclosure;
[0026] Figure 2 The structural schematic diagram of the spliced screen in the embodiments of the present disclosure is schematically shown;
[0027] Figure 3 The determination of the target audio and video data in the audio and video synchronization method in the embodiments of the present disclosure is schematically shown;
[0028] Figure 4 The flowchart schematically shows the master playing device obtaining the target audio and video data in the audio and video synchronization method in the embodiments of the present disclosure;
[0029] Figure 5 The flowchart schematically shows the slave playing device obtaining the target audio and video data in the audio and video synchronization method in the embodiments of the present disclosure;
[0030] Figure 6 The signal transmission between the master playing device and the slave playing device in the audio and video synchronization method in the embodiments of the present disclosure is schematically shown;
[0031] Figure 7 The flowchart schematically shows the correction of the slave playing device according to the corrected time in the audio and video synchronization method in the embodiments of the present disclosure;
[0032] Figure 8A flowchart schematically showing a process of synchronously changing a playing state of target audio / video data between a master playing device and a slave playing device in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0033] Figure 9 A diagram schematically showing a first instruction processing time and a time dimension of a synchronous pause / play instruction in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0034] Figure 10 A flowchart schematically showing a process of playing target audio / video data by a master playing device in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0035] Figure 11 A diagram schematically showing a picture in a display screen of a master playing device in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0036] Figure 12 A flowchart schematically showing a process of playing target audio / video data by a slave playing device in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0037] Figure 13 A flowchart schematically showing a process of synchronously changing a playing state of target audio / video data between a master playing device and a slave playing device in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0038] Figure 14 A diagram schematically showing a second instruction processing time, a third instruction processing time, a first absolute time and a second absolute time in a time dimension in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0039] Figure 15 A flowchart schematically showing a process after synchronously changing a playing state of target audio / video data in the audio / video synchronization method in the embodiment of the present disclosure is shown;
[0040] Figure 16 A flowchart schematically showing a process in an application scenario of the embodiment of the present disclosure is shown;
[0041] Figure 17 A diagram schematically showing a structure of an audio / video synchronization device in the embodiment of the present disclosure is shown;
[0042] Figure 18 An electronic device for an audio / video synchronization method in the embodiment of the present disclosure is shown;
[0043] Figure 19 A computer non-transient readable storage medium for an audio / video synchronization method in the embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0044] Example implementations are now described with reference to the drawings. Example implementations can, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the example implementations to those skilled in the art. The features, structures, or characteristics described in connection with the examples can be combined in any suitable manner in one or more implementations. In the following description, numerous specific details are illustrated that are meant to provide a thorough understanding of the implementations of the present disclosure. However, those skilled in the art will realize that the implementations of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In other instances, well-known structures have not been shown or described in order to avoid obscuring aspects of the disclosure.
[0045] The terms "one", "a", "an", and "the" as used herein mean "at least one" or "one or more" unless expressly specified otherwise. The term "includes" means "includes but is not limited to". The symbol " / " denotes "or". The terms "first", "second", and the like, do not limit the quantity or order of entities associated with those terms, unless such a limitation is explicitly indicated.
[0046] In addition, the accompanying drawings are included to provide a thorough understanding of the present disclosure and are not intended to be exhaustive or to limit the present disclosure to a specific form. The same reference numerals in the drawings denote the same or similar elements throughout the several views, and a repeated description thereof will be omitted. Some block diagrams shown in the drawings are functional entities, and do not necessarily correspond to physically or logically independent entities.
[0047] To solve the problems in the related art, the present disclosure provides an audio-video synchronization method. Figure 1 A flowchart of the audio-video synchronization method is shown in FIG. 1. As shown in FIG. 1, the audio-video synchronization method includes the following steps: Figure 1
[0048] Step S110. Determine target audio-video data, wherein the target audio-video data is used for synchronizing the playback between the master playback device and the slave playback device.
[0049] Step S120. Determine a first receiving time when a first master-slave signal is received, and determine a second receiving time when a second master-slave signal is received; wherein the first master-slave signal and the second master-slave signal are both sent by the master playback device to the slave playback device.
[0050] Step S130. Calculate the first receiving time and the second receiving time to obtain a correction time, and perform time correction on the slave playback device according to the correction time.
[0051] In step S140, based on the correction time, the playing state of the target audio and video data is synchronized to change between the master playing device and the slave playing device.
[0052] In the method and device provided in the example embodiments of the present disclosure, on one hand, the first receiving time and the second receiving time are calculated to obtain the correction time, and the slave playing device is time-corrected according to the correction time, so that the time synchronization between the master playing device and the slave playing device is realized; on the other hand, based on the correction time, the playing state of the target audio and video data between the master playing device and the slave playing device can be synchronized to change, which avoids the phenomenon that the same audio and video cannot be played synchronously in multiple devices in the prior art, and improves the experience of users watching the audio and video.
[0053] The steps of the audio and video synchronization method are described in detail below.
[0054] In step S110, the target audio and video data is determined, wherein the target audio and video data is used for synchronous playing between the master playing device and the slave playing device.
[0055] In the example embodiments of the present disclosure, the target audio and video data refers to the data that needs to be played synchronously in the master playing device and the slave playing device, and the target audio and video data includes both video data and audio data, because when a video picture is played, the video and audio in the video picture are usually separated to obtain the video data and the audio data, and then the video data and the audio data are transmitted to the corresponding playing device to play the video picture. Correspondingly, in the subsequent process of synchronously playing the video picture, the video data corresponding to the video picture needs to be synchronized, and the audio data corresponding to the video picture also needs to be synchronized.
[0056] The master playing device refers to a device that can play the target audio and video data, and correspondingly, the slave playing device also refers to a device that can play the target audio and video data. The difference between the master playing device and the slave playing device is that the target audio and video data played in the master playing device can be started by the user touching the playing control in the host device, while the target audio and video data played in the slave playing device must be the same target audio and video data as that in the master playing device, and the playing of the target audio and video data in the slave playing device must be synchronized with the playing of the target audio and video data in the master playing device. It is worth noting that the master playing device and the slave playing device need to be in the same local area network, and both the master playing device and the slave playing device have a playing system, wherein the playing system includes a time synchronization service and an application starting service. The time synchronization service is used for subsequent time synchronization between the master playing device and the slave playing device, and the application starting service is used for playing the target audio and video data.
[0057] Specifically, the master player and the slave player can be sub-screens in a spliced screen, for example, the spliced screen has a sub-screen 1, a sub-screen 2 and a sub-screen 3, the master player can be the sub-screen 1, and the slave player can be the sub-screen 2 and the sub-screen 3. The master player and the slave player can also be in the same local area network, and any device that can play target audio and video data, for example, the master player can also be a player in a security room in a shopping mall, and the slave player can be other players arranged in different positions in the shopping mall.
[0058] For example, when playing a promotional video in a shopping mall, a spliced screen as shown in FIG. 2A is usually used, as shown in FIG. 2B. Figure 2 Figure 2 As shown in FIG. 2B, a screen 210 is a spliced screen, a screen 211 is a sub-screen 1 in the spliced screen 210, a screen 212 is a sub-screen 2 in the spliced screen 210, and a device 220 is a routing device, which can be a router. The sub-screens 211 and 212 are connected to the router 220 and are in the same local area network. The sub-screen 211 is the master player, the sub-screen 212 is the slave player, and both the sub-screens 211 and 212 have corresponding playing systems.
[0059] Based on this, the target audio and video data can be a promotional advertisement of the shopping mall that needs to be played synchronously in the master player 211 and the slave player 212.
[0060] In optional embodiments, Figure 3 a flowchart for determining target audio and video data in an audio and video synchronization method is shown, as shown in FIG. 3A, the method at least includes the following steps: in step S310, a broadcast port created by a master player is listened to, and broadcast data sent by the master player from the broadcast port is received; wherein the broadcast data includes a to-be-played audio and video name and a data size corresponding to the to-be-played audio and video name. Figure 3
[0061] Specifically, the master player and the slave player can be simultaneously connected to the same routing device to make the master player and the slave player in the same local area network, wherein the routing device can be a router or a switch, and the present exemplary embodiment does not specially limit this.
[0062] Based on this, the local area network address allocated by the routing device for the master playback device, the local area network address allocated by the routing device for the slave playback device, and the broadcast address can be obtained, and the master playback device needs to create a broadcast port, which refers to a port for the master playback device to exchange information with all slave playback devices in the same local area network. The broadcast data refers to the related data of the to-be-played audio and video that the master playback device sends out using the broadcast port, which needs to be synchronously played in the master playback device and the slave playback device. It should be noted that the broadcast data includes the to-be-played audio and video name, which can be, for example, advertisement A. The broadcast data also includes the data size corresponding to the to-be-played audio and video name, which can be, for example, 40 megabytes of data size of advertisement A.
[0063] For the spliced screen, each spliced screen usually has a corresponding serial number. For example, there are three spliced screens, the serial number of the spliced screen 1 is 11, the serial number of the spliced screen 2 is 12, and the serial number of the spliced screen 3 is 13. Based on this, the spliced screen 1, the spliced screen 2, and the spliced screen 3 all listen to the broadcast port to obtain the broadcast data. If there is no audio and video data corresponding to the broadcast data (the to-be-played audio and video name is "video A") in the local spliced screen, the target audio and video data is obtained. It should be noted that the target audio and video data obtained at this time is the segmented audio and video data of "video A". This is because the video pictures displayed on the spliced screen 1, the video pictures displayed on the spliced screen 2, and the video pictures displayed on the spliced screen 3 combine to form the video picture of "video A". Therefore, the target audio and video data of "video A" is divided to obtain divided data 1, divided data 2, and divided data 3. The divided data 1 is transmitted to the spliced screen with the serial number 11, the divided data 2 is transmitted to the spliced screen with the serial number 12, and the divided data 3 is transmitted to the spliced screen with the serial number 13.
[0064] For example, the slave playback device listens to the broadcast port and receives the broadcast data from the broadcast port. The broadcast data includes the to-be-played audio and video name "advertisement A" and the data size corresponding to "advertisement A", which is 40 megabytes.
[0065] In step S320, if there is to-be-played audio and video data corresponding to the to-be-played audio and video name, and the target data size corresponding to the to-be-played audio and video data is consistent with the data size, it is determined that the to-be-played audio and video data is the target audio and video data.
[0066] If there is to-be-played audio and video data corresponding to the to-be-played audio and video name in the slave playback device, and the target data size of the to-be-played audio and video data is consistent with the data size in the broadcast data, it is proved that there is target audio and video data that needs to be synchronously played in the slave playback device. At this time, the slave playback device determines the locally existing to-be-played audio and video data as the target audio and video data.
[0067] For example, the name of the audio / video to be played is "advertisement A", and the data size is 40M. At this time, there is the audio / video data 1 to be played with the name "advertisement A" in the slave player, and the target data size of the audio / video data 1 to be played is 40M. Obviously, the audio / video data 1 to be played existing in the slave player is the audio / video data to be played synchronously between the master player and the slave player. Therefore, the audio / video data 1 to be played is determined as the target audio / video data.
[0068] In step S330, if there is the audio / video data to be played corresponding to the name of the audio / video to be played, and the target data size corresponding to the audio / video data to be played is inconsistent with the data size, the target audio / video data corresponding to the broadcast data transmitted by the audio / video server in the master player is received.
[0069] If there is the audio / video data to be played corresponding to the name of the audio / video to be played in the slave player, but the target data size of the audio / video data to be played is inconsistent with the data size in the broadcast data, it is proved that there is no audio / video data corresponding to the broadcast data in the slave player, and the target audio / video data corresponding to the broadcast data is needed to be acquired from the audio / video server in the master player.
[0070] For example, the name of the audio / video to be played is "advertisement A", and the data size is 40M. At this time, there is the audio / video data 2 to be played with the name "advertisement A" in the slave player, but the target data size of the audio / video data 2 to be played is 30M. Obviously, there is no audio / video data corresponding to the broadcast data in the slave player, and the target audio / video data corresponding to the broadcast data is needed to be acquired from the audio / video server in the master player.
[0071] In step S340, if there is no audio / video data to be played corresponding to the name of the audio / video to be played, the target audio / video data corresponding to the broadcast data transmitted by the audio / video server is received.
[0072] If there is no audio / video data to be played corresponding to the name of the audio / video to be played in the slave player, it is proved that there is no audio / video data corresponding to the broadcast data in the slave player, and the target audio / video data corresponding to the broadcast data is needed to be acquired from the audio / video server in the master player.
[0073] For example, the name of the audio / video to be played is "advertisement A", and the data size is 40M. At this time, there is no audio / video data to be played with the name "advertisement A" in the slave player. Obviously, there is no audio / video data corresponding to the broadcast data in the slave player, and the target audio / video data corresponding to the broadcast data is needed to be acquired from the audio / video server in the master player.
[0074] Figure 4 A flowchart for the master player to obtain target audio / video data is shown in FIG. 4, which comprises the following steps: Figure 4 Step S410 is the process for the master player to obtain the local area network address assigned by the routing device, obtain the broadcast address, and create a broadcast port; step S420 is the process for the master player to play the target audio / video data; step S430 is the process for the master player to create an audio / video server and send broadcast data through the broadcast port; step S440 is the process for the master player to wait for a certain period of time; step S450 is the process for the master player to determine whether there is a connection with the audio / video server; step S451 is the process for the master player to transmit the target audio / video data from the audio / video server if there is a connection with the audio / video server; and step S452 is the process for the master player to issue a synchronization pause / play instruction.
[0075] Figure 5 A flowchart for the slave player to obtain target audio / video data is shown in FIG. 5, which comprises the following steps: Figure 5 Step S510 is the process for the slave player to obtain the local area network address assigned by the routing device and listen to the broadcast port; step S520 is the process for the slave player to obtain the broadcast data; step S530 is the process for the slave player to determine whether there is audio / video data corresponding to the audio / video to be played in the broadcast data in the local player and whether the target data size corresponding to the audio / video to be played is consistent with the data size in the broadcast data; step S531 is the process for the slave player to receive the target audio / video data from the audio / video server if there is no audio / video data corresponding to the audio / video to be played in the broadcast data in the local player or if there is audio / video data corresponding to the audio / video to be played in the broadcast data in the local player but the target data size is not consistent with the data size in the broadcast data; and step S532 is the process for the slave player to determine that the audio / video to be played is the target audio / video data if there is audio / video data corresponding to the audio / video to be played in the broadcast data in the local player and the target data size is consistent with the data size in the broadcast data.
[0076] In the present exemplary embodiment, on the one hand, the broadcast data is the data sent by the master player to the slave player through the broadcast port, thereby avoiding the situation in the prior art that the master player needs to send the audio / video to be played and the data size to each slave player, reducing the waste of bandwidth; on the other hand, the slave player needs to determine whether there is audio / video data consistent with the broadcast data in the local player, thereby avoiding the situation that the master player still needs to transmit the target audio / video data to the slave player in the case that there is audio / video data in the local player of the slave player, perfecting the logic of transmitting the target audio / video data, and avoiding unnecessary performance loss.
[0077] In step S120, a first receiving time when the first master-slave signal is received is determined, and a second receiving time when the second master-slave signal is received is determined; wherein the first master-slave signal and the second master-slave signal are both sent by the master playback device to the slave playback device.
[0078] In the example embodiment of the present disclosure, the first master-slave signal refers to a signal sent by the master playback device to the slave playback device, and the second master-slave signal refers to a signal sent by the master playback device to the slave playback device, which is different from the first master-slave signal. Correspondingly, the first receiving time refers to the time when the slave playback device receives the first master-slave signal, and the second receiving time refers to the time when the slave playback device receives the second master-slave signal.
[0079] For example, Figure 6 A schematic diagram of signal transmission between the master playback device and the slave playback device is shown as follows, Figure 6 wherein the abscissa 610 is the absolute time, the abscissa 620 is the absolute time of the master playback device, and the abscissa 630 is the absolute time of the slave playback device. The absolute time of the master playback device refers to the system time of the master playback device, and correspondingly, the absolute time of the slave playback device refers to the system time of the slave playback device.
[0080] The arrow 640 is the first master-slave signal sent by the master playback device to the slave playback device, the arrow 650 is the slave master signal sent by the slave playback device to the master playback device, the arrow 660 is the second master-slave signal sent by the slave playback device to the master playback device, the time T0 is the time when the master playback device sends the first master-slave signal, the time T2 is the time when the slave playback device receives the first master-slave signal, so T2 is the first receiving time, the time T3 is the time when the master playback device receives the slave master signal, and the time T4 is the time when the slave playback device receives the second master-slave signal, so T4 is the second receiving time.
[0081] In an optional embodiment, before determining the second receiving time when the second master-slave signal is received, the method further comprises: sending a slave master signal to the master playback device, and receiving the second master-slave signal sent by the master playback device, to determine the second receiving time when the second master-slave signal is received; wherein the slave master signal is sent by the slave playback device after receiving the first master-slave signal, and the second master-slave signal is sent by the master playback device after receiving the slave master signal.
[0082] Wherein the slave master signal refers to a signal sent by the slave playback device to the master playback device. It is worth noting that the slave master signal is sent by the slave playback device after receiving the first master-slave signal, and the master playback device will send the second master-slave signal to the slave playback device after receiving the slave master signal. The slave playback device determines the second receiving time after receiving the second master-slave signal.
[0083] For example, asFigure 4 As shown, after receiving the first master-slave signal as indicated by arrow 630 from the playback device, a slave-master signal as indicated by arrow 640 is sent to the master playback device. After the master playback device receives the slave-master signal as indicated by arrow 640, a second master-slave signal as indicated by arrow 650 is sent to the slave playback device. The second reception time of receiving the second master-slave signal as indicated by arrow 650 is determined to be T4.
[0084] In this exemplary embodiment, the second reception time can be determined by the transmission order of the first master-slave signal, the slave-master signal, and the second master-slave signal, laying the foundation for subsequently calculating the correction time based on the first reception time and the second reception time.
[0085] In step S130, the first reception time and the second reception time are calculated to obtain the corrected time, and the time of the playback device is corrected according to the corrected time.
[0086] In an exemplary embodiment of this disclosure, since there may be a difference between the absolute time of the master playback device and the absolute time of the slave playback device, time synchronization between the master playback device and the slave playback device cannot be achieved.
[0087] Utilize Figure 6 The transmission of the first master-slave signal, the slave-master signal, and the second master-slave signal can determine the first reception time and the second reception time, thereby determining the time required for the signal to be transmitted from the slave playback device to the master playback device and then back from the master playback device. By calculating this time, the time deviation between the slave playback device and the master playback device can be obtained, that is, the correction time can be calculated.
[0088] Based on this, by correcting the time of the playback device, time synchronization between the master playback device and the slave playback device can be achieved.
[0089] For example, for Figure 6 The correction time is calculated by using the first reception time T2 and the second reception time T4. Then, the time of the playback device is corrected according to the correction time, so that the time synchronization between the master playback device and the slave playback device can be achieved.
[0090] In an optional embodiment, calculating a corrected time from the first reception time and the second reception time includes: obtaining a corrected time calculation formula, and calculating the corrected time from the first reception time and the second reception time based on the corrected time calculation formula.
[0091] The correction time calculation formula refers to the formula used to calculate the correction time.
[0092] For example, formula (1) is a modified calculation formula.
[0093]
[0094] Wherein, T2 is the first receiving time, T4 is the second receiving time, and Tdelay is the correction time.
[0095] In the present exemplary embodiment, a manner of calculating the correction time is provided, ensuring the derivation of the correction time and guaranteeing that the correction time can be used to correct the time of the slave playback device subsequently, so as to realize the time synchronization between the master playback device and the slave playback device.
[0096] In an optional embodiment, Figure 7 A flowchart of the method of correcting the slave playback device according to the correction time in the audio-video synchronization method is shown, as shown in the figure, the method at least includes the following steps: in step S710, receiving the first absolute time sent by the master playback device, and determining the second absolute time corresponding to the slave playback device. Figure 7
[0097] Wherein, the first absolute time refers to the system time of the master playback device, and the second absolute time refers to the system time of the slave playback device, and it is worth noting that there is a deviation between the first absolute time and the second absolute time.
[0098] For example, the first absolute time sent by the master playback device is received as 2:21:43, and the determined second absolute time of the slave playback device is 2:21:45.
[0099] In step S720, the first absolute time and the correction time are calculated to obtain the target absolute time, and the second absolute time is replaced by the target absolute time to realize the time correction of the slave playback device.
[0100] Wherein, because there is a deviation between the first absolute time and the second absolute time, and the deviation is the correction time, the calculation result obtained by calculating the first absolute time and the correction time is the accurate second absolute time, and therefore, by replacing the second absolute time with the calculation result target absolute time of the first absolute time and the second absolute time, the time correction of the slave playback device can be realized, and the time synchronization between the master playback device and the slave playback device is realized.
[0101] For example, formula (2) is the calculation formula for calculating the target absolute time.
[0102] Ts=Tm+Tdelay (2)
[0103] Wherein, Ts is the target absolute time, Tm is the first absolute time, Tdelay is the correction time, based on which, the second absolute time is replaced by the target absolute time, and the time correction from the playing device is completed, that is, the time synchronization between the master playing device and the slave playing device is realized.
[0104] In the present exemplary embodiment, a method for correcting the second absolute time is provided, which ensures the time synchronization between the master playing device and the slave playing device, and further ensures that the subsequent playing state of the target audio / video data can be changed synchronously in the master playing device and the slave playing device.
[0105] In step S140, based on the correction time, the playing state of the target audio / video data is changed synchronously between the master playing device and the slave playing device.
[0106] In the present exemplary embodiment of the present disclosure, the synchronous change of the playing state of the target audio / video data can be specifically synchronous playing of the target audio / video data, can also be synchronous pausing of the target audio / video data, can also be synchronous fast-forwarding of the target audio / video data, can also be synchronous fast-rewinding of the target audio / video data, and can also be synchronous playing of the target audio / video data at a specific playing progress, and the present exemplary embodiment does not specially limit this.
[0107] For example, on the basis of the correction time, that is, on the basis of the time synchronization between the master playing device and the slave playing device, the target audio / video data can be played synchronously on the master playing device and the slave playing device.
[0108] In an optional embodiment, Figure 8 A flowchart of the method for synchronously changing the playing state of the target audio / video data between the master playing device and the slave playing device is shown in FIG. 8, which comprises at least the following steps: Figure 8 As shown in FIG. 8, the method comprises at least the following steps: in step S810, a synchronous pause / play instruction sent by the master playing device is received, and a first instruction processing time corresponding to the synchronous pause / play instruction is determined.
[0109] The synchronous pause / play instruction refers to the instruction sent by the master playing device, and the synchronous pause / play instruction can be a synchronous playing instruction or a synchronous pausing instruction, and the present exemplary embodiment does not specially limit this.
[0110] The first instruction processing time refers to a specific time value, which can be calculated or obtained by the developer according to experience, and the present exemplary embodiment does not specially limit this.
[0111] Specifically, if the first instruction processing time is calculated, specifically, the calculation process is as follows, first, the time T5 at which the master playback device sends the synchronization pause / play instruction needs to be determined, then the receiving time T6 at which the slave playback device receives the synchronization pause / play instruction is determined, then the instruction processing condition that the first instruction processing time needs to meet is determined, the instruction processing condition can be that the difference between the first instruction processing time and T6 is much larger than the difference between T6 and T5, and the first instruction processing time is obtained based on the instruction processing condition.
[0112] If the first instruction processing time is obtained based on the developer's experience, the first instruction processing time is usually set to a time greater than T6, and the difference between the first instruction processing time and T6 is usually determined within a time range.
[0113] For example, Figure 9 A schematic diagram of the first instruction processing time and the synchronization pause / play instruction in the time dimension is shown, as Figure 9 shown, where arrow 910 represents the synchronization pause / play instruction sent by the master playback device to the slave playback device, time T5 is the time at which the master playback device sends the synchronization pause / play instruction, time T6 is the time at which the slave playback device receives the synchronization pause / play instruction, and arrow 920 represents the first instruction processing time, which can be a time T7 greater than 800ms than T6.
[0114] In step S820, based on the correction time and the current playback state of the target audio / video data, the target audio / video data is synchronized to pause at the first instruction processing time or synchronized to play at the first instruction processing time.
[0115] Wherein, the current playback state refers to the playback state of the target video data before the first instruction processing time, if the current playback state of the target audio / video data is playing, the target audio / video data is synchronized to pause at the first instruction processing time, if the current playback state of the target audio / video data is paused, the target audio / video data is synchronized to play at the first instruction processing time.
[0116] Figure 10 A schematic flowchart of the master playback device playing the target audio / video data is shown, as Figure 10As shown in the figure, step S1010 is the process of opening the synchronization option and sending the first master-slave signal and the first absolute time, step S1020 is the process of sending the second master-slave signal to the slave playback device after receiving the slave master signal sent by the slave playback device, step S1030 is the process of sending the synchronization pause / play instruction and decoding and playing the target audio / video data when the first absolute time reaches the first instruction processing time, and step S1040 is the process of continuously sending the updated first absolute time to the slave playback device during the process of decoding and playing the target audio / video data.
[0117] Figure 11 As shown in the figure, the figure schematically shows the picture in the display screen of the master playback device, Figure 11 As shown in the figure, interface 1110 is the display interface of the master playback device, and control 1210 is the synchronization option control. When the user performs a touch operation on control 1210, step S1010 in Figure 10 will be executed.
[0118] Figure 12 As shown in the figure, the figure schematically shows the flowchart of the slave playback device playing the target audio / video data, Figure 12 As shown in the figure, step S1210 is the process of receiving the first master-slave signal and sending the slave master signal to the master playback device after receiving the first master-slave signal, step S1220 is the process of receiving the second master-slave signal and determining the first receiving time according to the first master-slave signal and determining the second receiving time according to the second master-slave signal, step S1230 is the process of calculating the correction time according to the first receiving time and the second receiving time and updating the second absolute time according to the correction time, step S1240 is the process of decoding the target audio / video data and playing it at the first instruction processing time after receiving the synchronization pause / play instruction, and step S1250 is the process of receiving the updated first absolute time and continuing to correct the second absolute time.
[0119] In the present exemplary embodiment, by determining the first instruction processing time, it is ensured that the master playback device and the slave playback device play or pause the target audio / video data at the first instruction processing time on the basis of time synchronization, thereby improving the viewing experience of the audience.
[0120] In an optional embodiment, Figure 13 As shown in the figure, the figure schematically shows the flowchart of the audio / video synchronization method for synchronously changing the playing state of the target audio / video data between the master playback device and the slave playback device, Figure 13 As shown in the figure, the method at least includes the following steps: in step S1310, receiving the fast forward or fast backward playing instruction sent by the master playback device and determining the second instruction processing time and the third instruction processing time according to the fast forward or fast backward instruction.
[0121] The fast forward or fast backward playing instruction refers to an instruction for playing the target audio and video data at a certain playing progress by fast forwarding, or an instruction for playing the target audio and video data at a certain playing progress by fast backward, which is not specially limited in the example embodiment.
[0122] The determination processes of the second instruction processing time and the third instruction processing time are similar to the determination process of the first instruction processing time, which can be calculated or set by the developer according to experience, and the example embodiment is not specially limited thereto. The second instruction processing time and the third instruction processing time are both time values.
[0123] Specifically, if the second instruction processing time is calculated, the calculation process is as follows. First, the time T0 at which the main playing device sends the fast forward or fast backward playing instruction is determined. Then, the receiving time T2 at which the playing device receives the fast forward or fast backward playing instruction is determined. Then, the second instruction processing time needs to satisfy a corresponding instruction processing condition, which can be that the difference between the second instruction processing time and T2 is much greater than the difference between T2 and T0. The second instruction processing time is obtained based on the instruction processing condition.
[0124] Therefore, the difference between the third instruction processing time and the second instruction processing time needs to be within a certain range, for example, the difference between the third instruction processing time and the second instruction processing time needs to be greater than 500 milliseconds and less than 800 milliseconds.
[0125] If the second instruction processing time is obtained according to the experience of the developer, the second instruction processing time is usually set to a time greater than T2, and the difference between the second instruction processing time and T2 is usually determined within a time range, for example, the difference between the second instruction processing time and T2 needs to be greater than 400 milliseconds and less than 900 milliseconds. The third instruction processing time is determined based on this. The difference between the third instruction processing time and the second instruction processing time needs to be within a certain range, for example, the difference between the third instruction processing time and the second instruction processing time needs to be greater than 500 milliseconds and less than 800 milliseconds.
[0126] For example, the playing device receives a synchronization fast forward or fast backward instruction, and the instruction is used for fast forwarding the target audio and video data, Figure 14 A schematic diagram of the second instruction processing time, the third instruction processing time, the first absolute time, and the second absolute time in the time dimension is shown as follows. Figure 14As shown, arrow 1410 indicates the position of the second or third instruction processing time on coordinate axes 620, 630, and 640. Specifically, the second or third instruction processing time is T8. Arrow 1420 indicates the position of the second or third instruction processing time on coordinate axes 620, 630, and 640. Specifically, the second or third instruction processing time is T9. Arrow 1430 indicates the fast forward or rewind playback instruction sent by the main playback device to the secondary playback device. Time T5 indicates the time when the main playback device sends the fast forward or rewind playback instruction, and time T6 indicates the time when the secondary playback device receives the fast forward or rewind playback instruction.
[0127] If the instruction is used to rewind the target audio and video data, then arrow 1410 indicates the position of the third instruction processing time on coordinate axes 620, 630, and 640, and arrow 1420 indicates the position of the second instruction processing time on coordinate axes 620, 630, and 640.
[0128] If the instruction is used to fast forward the target audio and video data, then arrow 1410 indicates the position of the second instruction processing time on coordinate axes 620, 630, and 640, and arrow 1420 indicates the position of the third instruction processing time on coordinate axes 620, 630, and 640.
[0129] In step S1320, based on the correction time, the playback of the target audio and video data is paused synchronously at the second instruction processing time, and the target audio and video data is played synchronously at the third instruction processing time.
[0130] Based on the time synchronization between the main playback device and the slave playback device, the playback of the target audio and video data is paused synchronously at the second instruction processing time, and then the target audio and video data is played synchronously at the third instruction processing time.
[0131] For example, obtaining fast forward or rewind playback commands, determining such... Figure 14 The second instruction processing time T8 and the third instruction processing time T9 shown indicate that the main playback device and the slave playback device synchronously pause the target audio and video data at time T8 and synchronously play the target audio and video data at time T9.
[0132] In this exemplary embodiment, a method for synchronously fast-forwarding or synchronously rewinding target audio and video is provided, which improves the logic for synchronously changing the playback state of target audio and video data.
[0133] In an optional embodiment, Figure 15A flowchart after the playing state of the target audio-video data is changed in the audio-video synchronization method is shown, as shown in Figure 15 The method comprises the following steps: in step S1510, a third absolute time sent by the master playing device is acquired, and a calculation result is obtained by calculating the third absolute time and the correction time; wherein the third absolute time is obtained by updating the first absolute time.
[0134] The third absolute time refers to the time obtained by updating the first absolute time. It is worth noting that the first absolute time, i.e., the system time of the master playing device, may be changed during the process of synchronously playing the target audio-video data. Therefore, in order to ensure that the target audio-video data is always synchronized between the master playing device and the slave playing device during the entire playing process, the third absolute time needs to be acquired. Specifically, the third absolute time can be acquired according to a preset time interval, for example, the third absolute time can be acquired according to a preset time interval of 20 milliseconds, and the calculation result is obtained by calculating the third absolute time and the correction time, so as to perform real-time time correction on the second absolute time according to the calculation result.
[0135] For example, once the first absolute time is updated, the updated first absolute time, i.e., the third absolute time, is acquired, and then the third absolute time is substituted into Tm in formula (2) to obtain the calculation result Ts.
[0136] In step S1520, the target absolute time is updated according to the calculation result, and the second absolute time is replaced by the updated target absolute time to perform time correction on the slave playing device.
[0137] The target absolute time is updated to the calculation result, and the second absolute time is replaced by the updated target absolute time to perform time correction on the slave playing device again.
[0138] For example, once the first absolute time is updated, the updated first absolute time, i.e., the third absolute time, is acquired, and then the third absolute time is substituted into Tm in formula (2) to obtain the calculation result Ts.
[0139] Based on this, the second absolute time is replaced by Ts, and the time correction on the slave playing device is performed again.
[0140] In this example embodiment, with the update of the first absolute time, the second absolute time of the slave playing device needs to be corrected again to ensure that the target audio-video data is synchronized on the master playing device and the slave playing device during the entire target audio-video playing process.
[0141] In the method and device provided in the exemplary embodiments of the present disclosure, on one hand, the first receiving time and the second receiving time are calculated to obtain a corrected time, and time correction is performed on the playing device according to the corrected time, so that time synchronization between the master playing device and the slave playing device is achieved; on the other hand, based on the corrected time, synchronous change of the playing state of the target audio / video data between the master playing device and the slave playing device can be realized, so that the phenomenon that the same audio / video cannot be played synchronously in multiple devices in the prior art is avoided, and the user experience of watching audio / video is improved.
[0142] The audio / video synchronization method in the embodiments of the present disclosure will be described in detail below in combination with an application scenario.
[0143] Figure 16 A flowchart of the present disclosure in an application scenario is shown in FIG. 1. Figure 16As shown in the figure, wherein the device 1611 is a routing device, the device 1612 is a master playing device, the device 1613 and the device 1614 are slave playing devices, the step S1610 is a process of playing target audio and video data in the master playing device, the step S1620 is a process of creating an audio and video server in the master playing device, and sending broadcast data to the slave playing device 1612 and the slave playing device 1614 by using the created broadcast port, the step S1630 is a process of determining target audio and video data by the slave playing device, the step S1640 is a process of the master playing device sending a first master-slave signal to the above two slave playing devices respectively, receiving a slave master signal, and sending a second master-slave signal, the step S1650 is a process of the master playing device sending a first absolute time to the slave playing device, the step S1660 is a process of the slave playing device determining a first receiving time and a second receiving time according to the received first master-slave signal and the second master-slave signal, the step S1670 is a process of the slave playing device calculating a correction time according to the first receiving time and the second receiving time, and calculating the correction time and the first absolute time to obtain a target absolute time, the step S1680 is a process of replacing the second absolute time with the target absolute time, the step S1690 is a process of the master playing device sending a synchronous pause / play instruction or a fast forward or fast backward playing instruction to the slave playing device, the step S1691 is a process of determining a first instruction processing time if the received instruction is a synchronous pause / play instruction, the step S1692 is a process of determining a second instruction processing time and a third instruction processing time if the received instruction is a fast forward or fast backward playing instruction, the step S1693 is a process of the master playing device playing or pausing the target audio and video data at the first instruction processing time when the sent instruction is a synchronous pause / play instruction, the step S1694 is a process of the master playing device pausing playing of the target audio and video data at the second instruction processing time and playing the target audio and video data at the third instruction processing time when the sent instruction is a fast forward or fast backward playing instruction, the step S1695 is a process of decoding and playing the target audio and video data when the time reaches the first instruction processing time, and the step S1696 is a process of pausing playing of the target audio and video data when the time reaches the second instruction processing time, and continuing to play the target audio and video data when the time reaches the third instruction processing time.
[0144] In the application scenario, on the one hand, the first receiving time and the second receiving time are calculated to obtain a correction time, and the slave playing device is time-corrected according to the correction time, so as to realize time synchronization between the master playing device and the slave playing device; on the other hand, based on the correction time, synchronous change of a playing state of the target audio and video data between the master playing device and the slave playing device can be realized, so as to avoid the phenomenon that the same audio and video cannot be played synchronously in multiple devices in the prior art, and the user experience of watching audio and video is improved.
[0145] Further, in the exemplary embodiments of the present disclosure, a promotion audio-video synchronization device is also provided. The device comprises: a master playing device configured to send a first master-slave signal and a second master-slave signal to a slave playing device; the slave playing device is configured to determine target promotion audio-video data, wherein the target promotion audio-video data is used for synchronously playing between the master playing device and the slave playing device; determine a first receiving time when the first master-slave signal is received, and determine a second receiving time when the second master-slave signal is received; calculate the first receiving time and the second receiving time to obtain a correction time, and perform time correction on the slave playing device according to the correction time; and based on the correction time, synchronously change the playing state of the target promotion audio-video data between the master playing device and the slave playing device.
[0146] The target promotion audio-video data is consistent with the target audio-video data in step S110, and can be any kind of audio-video data that needs to be synchronously played in the master playing device and the slave playing device.
[0147] The specific details of the above-mentioned promotion audio-video synchronization device have been described in detail in the corresponding audio-video synchronization method, and therefore will not be described here.
[0148] Further, in the exemplary embodiments of the present disclosure, an audio-video synchronization device is also provided. Figure 17 The structure diagram of the audio-video synchronization device is shown as Figure 17 As shown in the figure, the audio-video synchronization device 1700 can comprise: a first determination module 1710, a second determination module 1720, a correction module 1730 and a synchronization module 1740. Wherein:
[0149] The first determination module 1710 is configured to determine target audio-video data, wherein the target audio-video data is used for synchronously playing between the master playing device and the slave playing device; the second determination module 1720 is configured to determine a first receiving time when the first master-slave signal is received, and determine a second receiving time when the second master-slave signal is received; wherein the first master-slave signal and the second master-slave signal are both sent by the master playing device to the slave playing device; the correction module 1730 is configured to calculate the first receiving time and the second receiving time to obtain a correction time, and perform time correction on the slave playing device according to the correction time; and the synchronization module 1740 is configured to synchronously change the playing state of the target audio-video data between the master playing device and the slave playing device based on the correction time.
[0150] The specific details of the above-mentioned audio-video synchronization device 1700 have been described in detail in the corresponding audio-video synchronization method, and therefore will not be described here.
[0151] It should be noted that although several modules or units of the audio-video synchronization apparatus 1700 are mentioned in the foregoing detailed description, such division is not mandatory. Indeed, features and functionalities of two or more modules or units described above can be embodied in one module or unit according to embodiments of the present disclosure. Conversely, features and functionalities of one module or unit described above can be further divided into embodied by multiple modules or units.
[0152] Furthermore, in exemplary embodiments of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0153] The electronic device 1800 according to this embodiment of the present disclosure will be described below with reference to Figure 18 Figure 18 The electronic device 1800 shown is merely an example and should not limit the function and scope of use of embodiments of the present disclosure.
[0154] As shown in Figure 18 The components of electronic device 1800 can include, but are not limited to, at least one processing unit 1810 as described above, at least one storage unit 1820 as described above, a bus 1830 that connects different system components including the storage unit 1820 and the processing unit 1810, and a display unit 1840.
[0155] The storage unit stores program codes that can be executed by the processing unit 1810, so that the processing unit 1810 performs the steps described in the "Exemplary Method" section of the present specification according to various exemplary embodiments of the present disclosure.
[0156] The storage unit 1820 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 1821 and / or a cache memory 1822, and can further include a read-only memory (ROM) 1823.
[0157] The storage unit 1820 can also include a program / utility 1824 having a set of program modules 1825, including but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which can contain realizations of a network environment, alone or in some combination.
[0158] The bus 1830 can represent one or more of several types of bus structures, including a storage unit bus or storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit bus, or a local bus using any of a variety of bus architectures.
[0159] The electronic device 1800 can also communicate with one or more external devices 1870 such as a keyboard or pointing devices, display devices, etc.; one or more devices that enable a user to interact with the electronic device 1800; and / or one or more devices (e.g. routers, modems, etc.) that enable the electronic device 1800 to communicate with one or more other computing devices. Such communication can be facilitated by an Input / Output (I / O) interface 1850. Still yet, the electronic device 1800 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 1860. As depicted, the network adapter 1860 can be communicatively coupled to the other components of the electronic device 1800 through a bus 1830. It should be appreciated that the bus 1830 can be any bus or interconnect that enables communication between the above components of the electronic device 1800 and can be implemented using any suitable technology. It should also be appreciated that the electronic device 1800 can include other components such as a processor, memory, storage, etc. that have not been explicitly shown or described.
[0160] From the above description of the embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0161] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, on which a program product capable of implementing the above-mentioned method of the present disclosure is stored. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing a terminal device to perform the steps described in the above-mentioned "example method" section according to various example embodiments of the present disclosure when the program product is run on the terminal device.
[0162] Reference Figure 19 As shown, a program product 1900 for implementing the above-mentioned method according to the embodiments of the present disclosure is described, which can take the form of a portable compact disc read-only memory (CD-ROM) and include program codes, and can be run on a terminal device such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, device or apparatus.
[0163] The program product can employ any combination of one or more computer readable media or storage media. The computer readable media or storage media can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0164] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport program code.
[0165] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0166] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The computer program code can also be tangibly embodied (i.e., in a physical computer-readable medium) in a computer program product. The computer program product can be in any of a variety of forms, including but not limited to, a computer diskette, a computer CD-ROM, a semiconductor memory device, a computer hard drive, or any suitable combination of the foregoing.
[0167] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims
1. An audio-video synchronization method, characterized in that, The method includes: Determine target audio and video data, wherein the target audio and video data is used for synchronous playback between a main playback device and a secondary playback device, and the main playback device and the secondary playback device are split screens in a splicing screen; A first reception time is determined when a first master-slave signal is received, and a second reception time is determined when a second master-slave signal is received; wherein, both the first master-slave signal and the second master-slave signal are sent by the master playback device to the slave playback device, and the second master-slave signal is a signal sent by the master playback device to the slave playback device that distinguishes it from the first master-slave signal; The corrected time is calculated from the first reception time and the second reception time, and the time of the playback device is corrected according to the corrected time. Based on the correction time, the playback status of the target audio and video data is synchronously changed between the main playback device and the slave playback device; The step of correcting the time of the playback device according to the corrected time includes: Receive the first absolute time sent by the main playback device, and determine the second absolute time corresponding to the slave playback device; The target absolute time is calculated by calculating the first absolute time and the corrected time, and the second absolute time is replaced with the target absolute time to achieve time correction from the playback device; Among them, a third absolute time is obtained according to a preset time interval, and the third absolute time is obtained by updating the first absolute time; The third absolute time and the corrected time are calculated to obtain a calculation result, and the second absolute time is corrected in real time according to the calculation result; The determination of the target audio and video data includes: The system monitors the broadcast port created by the main playback device and receives broadcast data sent from the main playback device through the broadcast port; wherein, the broadcast data includes the name of the audio / video to be played and the data size corresponding to the name of the audio / video to be played; the broadcast port is the port through which the main playback device communicates with all slave playback devices in the same local area network; Based on the name of the audio / video to be played and the corresponding data size, determine whether the playback device has audio / video data to be played that is consistent with the broadcast data locally. If it does, the audio / video data to be played is determined as the target audio / video data. Otherwise, receive the target audio / video data corresponding to the broadcast data transmitted by the audio / video server in the main playback device. The step of synchronously changing the playback state of the target audio and video data between the main playback device and the slave playback device based on the correction time includes: Receive a synchronous pause / play command sent by the main playback device, determine a first instruction processing time corresponding to the synchronous pause / play command, and based on the time synchronization and the current playback status of the target audio and video data, synchronously pause or synchronously play the target audio and video data at the first instruction processing time. The first instruction processing time satisfies the following instruction processing conditions: The difference between the first instruction processing time and the time when the synchronous pause / play instruction is received from the playback device is greater than the difference between the time when the synchronous pause / play instruction is received from the playback device and the time when the synchronous pause / play instruction is sent by the main playback device.
2. The audio and video synchronization method according to claim 1, characterized in that, Before determining the second reception time when the second master-slave signal is received, the method further includes: A slave signal is sent to the master playback device, and a second master-slave signal is received from the master playback device to determine a second reception time for receiving the second master-slave signal; wherein the slave signal is sent by the slave playback device after receiving the first master-slave signal, and the second master-slave signal is sent by the master playback device after receiving the slave signal.
3. The audio-video synchronization method according to claim 2, characterized in that, The step of calculating the corrected time from the first reception time and the second reception time includes: Obtain the correction time calculation formula, and calculate the correction time based on the first reception time and the second reception time using the correction time calculation formula.
4. The audio and video synchronization method according to claim 1, characterized in that, The step of calculating the third absolute time and the corrected time to obtain a calculation result, and then performing real-time time correction on the second absolute time based on the calculation result, includes: The target absolute time is updated based on the calculation result, and the second absolute time is replaced with the updated target absolute time.
5. The audio-video synchronization method according to claim 1, characterized in that, The step of synchronously changing the playback state of the target audio and video data between the main playback device and the slave playback device based on the correction time further includes: Receive fast forward or rewind playback instructions sent by the main playback device, and determine the second instruction processing time and the third instruction processing time based on the fast forward or rewind playback instructions; Based on the correction time, the playback of the target audio and video data is paused synchronously at the second instruction processing time, and the target audio and video data is played synchronously at the third instruction processing time.
6. The audio and video synchronization method according to claim 1, characterized in that, The determination of the target audio and video data includes: If there exists audio / video data to be played that corresponds to the name of the audio / video to be played, and the size of the target data corresponding to the audio / video data to be played is the same as the data size, then the audio / video data to be played is determined to be the target audio / video data. If there exists audio / video data to be played corresponding to the name of the audio / video to be played, and the target data size corresponding to the audio / video data to be played is inconsistent with the data size, then the target audio / video data corresponding to the broadcast data transmitted by the audio / video server in the main playback device is received. If no audio or video data corresponding to the name of the audio or video to be played exists, then the target audio or video data corresponding to the broadcast data transmitted by the audio or video server is received.
7. An audio-visual synchronization device, characterized in that, include: The first determining module is configured to determine target audio and video data, wherein the target audio and video data is used for synchronous playback between the main playback device and the slave playback device; The second determining module is configured to determine a first receiving time when a first master-slave signal is received, and to determine a second receiving time when a second master-slave signal is received; wherein the first master-slave signal and the second master-slave signal are both sent by the master playback device, and the second master-slave signal is a signal sent by the master playback device to the slave playback device that distinguishes it from the first master-slave signal; The correction module is configured to calculate a correction time based on the first reception time and the second reception time, and to perform time correction on the playback device based on the correction time. The synchronization module is configured to synchronously change the playback state of the target audio and video data between the main playback device and the slave playback device based on the correction time. The correction module is configured to execute: Receive the first absolute time sent by the main playback device, and determine the second absolute time corresponding to the slave playback device; The target absolute time is calculated by calculating the first absolute time and the corrected time, and the second absolute time is replaced with the target absolute time to achieve time correction from the playback device; Among them, a third absolute time is obtained according to a preset time interval, and the third absolute time is obtained by updating the first absolute time; The third absolute time and the corrected time are calculated to obtain a calculation result, and the second absolute time is corrected in real time according to the calculation result; The first determining module is configured to execute: The system monitors the broadcast port created by the main playback device and receives broadcast data sent from the main playback device through the broadcast port; wherein, the broadcast data includes the name of the audio / video to be played and the data size corresponding to the name of the audio / video to be played; the broadcast port is the port through which the main playback device communicates with all slave playback devices in the same local area network; Based on the name of the audio / video to be played and the corresponding data size, determine whether the playback device has audio / video data to be played that is consistent with the broadcast data locally. If it does, the audio / video data to be played is determined as the target audio / video data. Otherwise, receive the target audio / video data corresponding to the broadcast data transmitted by the audio / video server in the main playback device. The synchronization module is configured to execute: Receive a synchronous pause / play command sent by the main playback device, determine a first instruction processing time corresponding to the synchronous pause / play command, and based on the time synchronization and the current playback status of the target audio and video data, synchronously pause or synchronously play the target audio and video data at the first instruction processing time. The first instruction processing time satisfies the following instruction processing conditions: The difference between the first instruction processing time and the time when the synchronous pause / play instruction is received from the playback device is greater than the difference between the time when the synchronous pause / play instruction is received from the playback device and the time when the synchronous pause / play instruction is sent by the main playback device.
8. A device for synchronizing audio and video for promotional purposes, wherein, include: The master playback device is configured to send a first master-slave signal and a second master-slave signal to the slave playback device, wherein the second master-slave signal is a signal sent by the master playback device to the slave playback device that is different from the first master-slave signal; A playback device is configured to determine target promotional audio and video data, wherein the target promotional audio and video data is used for synchronous playback between a master playback device and a slave playback device; determine a first reception time when a first master-slave signal is received, and determine a second reception time when a second master-slave signal is received; calculate a correction time based on the first reception time and the second reception time, and perform time correction on the slave playback device according to the correction time; based on the correction time, synchronously change the playback state of the target promotional audio and video data between the slave playback devices; The playback device is configured as follows: Receive the first absolute time sent by the main playback device, and determine the second absolute time corresponding to the slave playback device; The target absolute time is calculated by calculating the first absolute time and the corrected time, and the second absolute time is replaced with the target absolute time to achieve time correction from the playback device; Among them, a third absolute time is obtained according to a preset time interval, and the third absolute time is obtained by updating the first absolute time; The third absolute time and the corrected time are calculated to obtain a calculation result, and the second absolute time is corrected in real time according to the calculation result; The playback device is configured to perform: The system monitors the broadcast port created by the main playback device and receives broadcast data sent from the main playback device through the broadcast port; wherein, the broadcast data includes the name of the audio / video to be played and the data size corresponding to the name of the audio / video to be played; the broadcast port is the port through which the main playback device communicates with all slave playback devices in the same local area network; Based on the name of the audio / video to be played and the corresponding data size, determine whether the playback device has audio / video data to be played that is consistent with the broadcast data locally. If it does, the audio / video data to be played is determined as the target audio / video data. Otherwise, receive the target audio / video data corresponding to the broadcast data transmitted by the audio / video server in the main playback device. The playback device is configured to perform: Receive a synchronous pause / play command sent by the main playback device, determine a first instruction processing time corresponding to the synchronous pause / play command, and based on the time synchronization and the current playback status of the target audio and video data, synchronously pause or synchronously play the target audio and video data at the first instruction processing time. The first instruction processing time satisfies the following instruction processing conditions: The difference between the first instruction processing time and the time when the synchronous pause / play instruction is received from the playback device is greater than the difference between the time when the synchronous pause / play instruction is received from the playback device and the time when the synchronous pause / play instruction is sent by the main playback device.
9. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the audio-video synchronization method of any one of claims 1-6 by executing the executable instructions.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the audio and video synchronization method according to any one of claims 1-6.
Citation Information
Patent Citations
Control method and control system of synchronous suspending and playing of multiple devices
CN105392040A
Method and device for realizing projection screen playing synchronization and computer main equipment
CN112684992A