Disclosure of Invention
The invention mainly aims to provide a video synchronization method, a video synchronization device, video synchronization equipment and a computer readable storage medium, and aims to solve the technical problem of reducing the cost of video synchronization.
In order to achieve the above object, the present invention provides a video synchronization method, including:
downloading a display film source from a cloud end, and acquiring a synchronization mechanism file corresponding to the display film source;
analyzing the synchronous mechanism file and determining the preset playing starting time of the display film source;
and determining the current time of the display terminal, and playing the display film source according to the preset playing starting time and the current time.
Optionally, the step of analyzing the synchronization mechanism file and determining the preset playing start time of the display film source in the synchronization mechanism file includes:
analyzing the synchronous mechanism file to obtain video frames corresponding to the display film source and video time stamps corresponding to the video frames;
and mapping the video time stamp and the local time to obtain the preset playing starting time of the display film source.
Optionally, the step of playing the display source according to the preset playing start time and the current time includes:
detecting whether the current time is matched with the preset broadcasting starting time;
if the current time is matched with the preset play-up time, determining a target video frame corresponding to the preset play-up time in the video frames corresponding to the display film source;
and decoding and outputting the target video frame.
Optionally, after the step of detecting whether the current time matches the preset broadcast starting time, the method further includes:
if the current time exceeds the preset play-starting time, determining an overtime video frame corresponding to the preset play-starting time in the display film source in the video frame corresponding to the display film source;
and performing frame loss processing on the overtime video frame.
Optionally, before the step of playing the display source according to the preset playing start time and the current time, the method further includes:
detecting whether an operation instruction for the display terminal exists or not;
and if the operation instruction for the display terminal does not exist, continuing to execute the step of playing the display film source according to the preset playing starting time and the current time.
Optionally, after the step of detecting whether there is an operation instruction for the display terminal, the method further includes:
and if the operation instruction for the display terminal exists, quitting playing the display film source.
Optionally, after the step of exiting playing the display film source if there is an operation instruction for the display terminal, the method further includes:
determining historical execution time corresponding to the operation instruction;
calculating a time interval between the historical execution time and a current time;
and if the time interval exceeds a preset time interval, executing the step of playing the display film source according to the preset playing starting time and the current time.
Further, to achieve the above object, the present invention also provides a video synchronization apparatus, comprising:
the film source downloading module is used for downloading a display film source from a cloud end and acquiring a synchronization mechanism file corresponding to the display film source;
the film source playing module is used for analyzing the synchronous mechanism file and determining the preset playing starting time of the displayed film source;
and the film source playing module is also used for determining the current time of the display terminal and playing the display film source according to the preset playing starting time and the current time.
Furthermore, to achieve the above object, the present invention also provides a video synchronization apparatus comprising a memory, a processor, and a video synchronization program stored on the memory and executable on the processor, the video synchronization program when executed by the processor implementing the steps of the video synchronization method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a video synchronization program, which when executed by a processor, implements the steps of the video synchronization method as described above.
The invention provides a video synchronization method, a video synchronization device, video synchronization equipment and a computer readable storage medium, wherein a display film source is downloaded from a cloud end, and a synchronization mechanism file corresponding to the display film source is obtained; and then analyzing the synchronization mechanism file, determining the preset play starting time of the display film source, determining the current time of the display terminal, and playing the display film source according to the preset play starting time and the current time.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The video synchronization device in the embodiment of the present invention may be a terminal device such as a PC (personal computer), a portable computer, a television, a server, or the like.
As shown in fig. 1, the video synchronization apparatus may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., WIreless-FIdelity (WI-FI).) and the Memory 1005 may be a high-speed Random Access Memory (RAM) Memory, a Non-Volatile Memory (NVM) such as a disk Memory, or a storage device independent of the processor 1001.
Optionally, the video synchronization device may further include an RF (Radio Frequency) circuit, a sensor, an audio circuit, and a WiFi module; an input unit such as a display screen, a touch screen; the network interface may optionally be other than WiFi, bluetooth, probe, etc. in the wireless interface.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a video synchronization program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
downloading a display film source from a cloud end, and acquiring a synchronization mechanism file corresponding to the display film source;
analyzing the synchronous mechanism file, and determining the preset playing starting time of the display film source;
and determining the current time of the display terminal, and playing the display film source according to the preset playing starting time and the current time.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
analyzing the synchronous mechanism file to obtain video frames corresponding to the display film source and video time stamps corresponding to the video frames;
and mapping the video time stamp and the local time to obtain the preset playing starting time of the display film source.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
detecting whether the current time is matched with the preset broadcasting starting time or not;
if the current time is matched with the preset play-up time, determining a target video frame corresponding to the preset play-up time in the video frames corresponding to the display film source;
and decoding and outputting the target video frame.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
if the current time exceeds the preset play-starting time, determining an overtime video frame corresponding to the preset play-starting time in the display film source in the video frames corresponding to the display film source;
and performing frame loss processing on the overtime video frame.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
detecting whether an operation instruction for the display terminal exists or not;
and if the operation instruction on the display terminal does not exist, continuing to execute the step of playing the display film source according to the preset playing starting time and the current time.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
and if the operation instruction for the display terminal exists, quitting playing the display film source.
The processor 1001 may also be configured to invoke a video synchronization program stored in the memory 1005 and perform the following operations:
determining historical execution time corresponding to the operation instruction;
calculating a time interval between the historical execution time and a current time;
and if the time interval exceeds a preset time interval, executing the step of playing the display film source according to the preset playing starting time and the current time.
Based on the hardware structure, the invention provides various embodiments of the video synchronization method.
An embodiment of the present invention provides a video synchronization method, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the video synchronization method according to the present invention.
In this embodiment, the video synchronization method includes:
step S10, downloading a display film source from a cloud end, and acquiring a synchronization mechanism file corresponding to the display film source;
step S20, analyzing the synchronous mechanism file, and determining the preset playing starting time of the display film source;
and S30, determining the current time of the display terminal, and playing the display film source according to the preset playing starting time and the current time.
In this embodiment, the video synchronization method is applied to a display terminal, where the display terminal includes but is not limited to a television, a mobile phone, a tablet, a computer, and the like, and the present embodiment takes a television terminal as an example for description. The television terminal downloads the display film source from the cloud, acquires a synchronization mechanism file corresponding to the display film source, determines the current time of the display terminal, and plays the display film source according to the preset play starting time and the current time. The method includes the steps of unifying time standards of a plurality of display terminals, for example unifying the time standards of all the display terminals to be Beijing time, enabling a synchronization mechanism file to be a preset synchronization playing mechanism corresponding to a display film source, specifically enabling the synchronization mechanism file to comprise a binding relationship between the display film source and local time, for example, mapping a local time and a video time stamp of the display film source to each other, setting a video frame of the video time stamp corresponding to the display film source to be played in the millisecond of every whole minute of the local time, analyzing the synchronization mechanism file by the television terminal, determining a preset play-starting time of the display film source based on the binding relationship between the display film source and the local time in the synchronization mechanism file, further determining the current time of the display terminal, and playing the display film source according to the preset play-starting time of the display film source and the current time. In this embodiment, video time duration of a display film source may be obtained, according to the video time duration of the display film source, a video timestamp of the display film source and a local time are mapped to each other, for example, the video time duration of the display film source is 60 seconds, the display film source and the local time are mapped, every whole minute in the local time is determined as a preset play start time, a time of 01 minutes and 00 seconds of 08 minutes is used as a preset play start time to play the display film source, in this embodiment, time standards corresponding to terminals are unified, for example, beijing time is uniformly adopted, as shown in fig. 4, a television 1, a television 2, and a television 3.
It should be noted that, in this embodiment, the display film source is downloaded from the network to the local through the television terminal, and then synchronization is performed according to the set playing mechanism, which reduces the cost investment of the terminal compared with the method when the film source is displayed by the current market terminal, as shown in fig. 3, the method when the film source is displayed by the current market terminal: television 1, television 2, television 3. TV n carries out the synchronized broadcast based on the HDMI shunt, and the present mode uses the HDMI shunt, then draws forth the HDMI line from the shunt and is connected to the HDMI port of TV and broadcast the show, along with the equipment of terminal is more and more, the demand quantity of HDMI also increases thereupon, has also increased the input of fund simultaneously, has increased the expense input of terminal. In this embodiment, the display film source shown in fig. 4 is downloaded from the cloud, or the display film source is downloaded locally from the network backend by the television terminal itself, and then the preset synchronization mechanism file corresponding to the display film source is obtained to be played synchronously, so that the display film source can be played synchronously without using an HDMI splitter, and the cost input of the HDMI splitter is reduced.
In the embodiment, the display film source is downloaded from the cloud, and the synchronization mechanism file corresponding to the display film source is acquired; and then analyzing the synchronization mechanism file, determining the preset play starting time of the display film source, determining the current time of the display terminal, and playing the display film source according to the preset play starting time and the current time.
Further, in the step S20, the refining step of analyzing the synchronization mechanism file and determining the preset play-starting time of the presentation source in the synchronization mechanism file includes:
step A, analyzing the synchronous mechanism file to obtain video frames corresponding to the display film source and video timestamps corresponding to the video frames;
and B, mapping the video time stamp and the local time to obtain the preset playing starting time of the display film source.
In this embodiment, after downloading a presentation source from a network background, and acquiring a synchronization mechanism file corresponding to the presentation source, a television terminal parses the synchronization mechanism file, acquires video frames corresponding to the presentation source and video timestamps corresponding to the video frames, for example, if the video duration of the presentation source is 60 seconds, decomposes the presentation source to obtain 60 video frames, each video frame corresponds to a video timestamp, for example, the video timestamp corresponding to the first video frame is 01 seconds, further maps the video timestamp with the local time to obtain a preset start-play time of the presentation source, sets the start-play of the presentation source every whole minute of the local time, maps the video timestamp 01 to the local time 08 minutes 00 seconds, maps the video timestamp 02 to the local time 08 minutes 02 seconds, and so on, that the preset start-play time of the presentation source is determined to be 08 minutes 01 minutes 00 seconds.
In this embodiment, before starting playing the display film source, the synchronization mechanism file downloaded from the network background is analyzed, and the synchronization mechanism file is mapped to the local time, for example, if the displayed video has 60 seconds, the local time and the video timestamp of the display film source are mapped to each other, and the video frame of the video corresponding to the timestamp is played every several milliseconds of a whole minute. The synchronization mechanism is downloaded locally and synchronized with standard time such as Beijing time, the display film source needs to be played from the whole minute at each playing start time, if the current time is 08 minutes and 50 seconds, playing cannot be started, and playing needs to be started until 08 minutes and 00 seconds, so that all television terminals can play the display film source at the same time, the playing mechanism does not need to be obtained from a back-end server at each time, and the problem of low efficiency caused by concurrent processing is avoided.
Further, in the step S30, the step of refining the playing of the display source according to the preset playing start time and the current time includes:
step C, detecting whether the current time is matched with the preset broadcasting starting time;
step D, if the current time is matched with the preset play-up time, determining a target video frame corresponding to the preset play-up time in the video frames corresponding to the display film source;
and E, decoding and outputting the target video frame.
In this embodiment, after downloading a display film source from a network background, and acquiring a synchronization mechanism file corresponding to the display film source, a television terminal determines a current time of the television terminal, and further detects whether the current time matches a preset play-starting time, specifically, if the current time matches the preset play-starting time, it determines that the current time matches the preset play-starting time, for example, it determines that the preset play-starting time is 01 minutes 00 seconds when the preset play-starting time is 08 hours, and if the current time is 01 minutes 00 seconds when the preset play-starting time is 08 hours, it indicates that the current time matches the preset play-starting time, that is, the current time matches the preset play-starting time, and then determines a target video frame corresponding to the preset play-starting time in a video frame corresponding to the display film source, decodes the target video frame, and outputs and displays the decoded target video frame.
Referring to fig. 6, as another embodiment, after the synchronization mechanism file is parsed, playing may be started, a video timestamp of a video frame is obtained, whether the video timestamp of the video frame is synchronized with the mapped local time is detected, if the video timestamp of the video frame is synchronized with the mapped local time, the synchronized video frame is used as a target video frame, decoding and outputting the target video frame, and if the video timestamp of the video frame is not synchronized with the mapped local time, the unsynchronized video frame is subjected to frame dropping processing, a next video frame is read, and a video timestamp corresponding to the next video frame is continuously obtained to detect whether synchronization is satisfied.
Further, after the step of detecting whether the current time matches the preset broadcast starting time in step C, the method further includes:
step F, if the current time exceeds the preset play-starting time, determining an overtime video frame corresponding to the preset play-starting time in the display film source in the video frame corresponding to the display film source;
and G, performing frame loss processing on the overtime video frame.
In this embodiment, the television terminal downloads the display film source from the network background, and after acquiring the synchronization mechanism file corresponding to the display film source, determines the current time of the television terminal, and further detects whether the current time matches the preset play start time, if the current time exceeds the preset play start time, it indicates that the current time does not match the preset play start time and the current time exceeds the preset play start time, determines an overtime video frame corresponding to the display film source exceeding the preset play start time in the video frame corresponding to the display film source, and performs frame dropping processing on the overtime video frame. For example, if the preset play-starting time is determined to be 08 hours 01 minutes 00 seconds, and the current time is 08 hours 01 minutes 05 seconds, which indicates that the current time exceeds the preset play-starting time, determining that an overtime video frame corresponding to the time exceeding the preset play-starting time in the display film source, namely a video frame 5 seconds before the display film source, is determined to be an overtime video frame, and performing frame dropping processing on the overtime video frame.
Based on the industry current situation and technical innovation, the display stream is downloaded from the network to the local television through the display terminal, and then through the acquired playing mechanism, the video rapid frame dropping and synchronization strategy is adopted, so that the pictures played by all the televisions at the same time at the terminal are consistent. The HDMI shunt is adopted to shunt the demonstration film source with the traditional market terminal to realize picture synchronization, the display film source is downloaded from the network to the local through the television terminal, and then synchronization is carried out according to a set playing mechanism, so that video synchronization among multiple devices is realized, the capital investment of the devices is reduced, and the cost is greatly reduced.
Further, based on the first embodiment, a second embodiment of the video synchronization method of the present invention is provided, in this embodiment, before the step of playing the display source according to the preset playing start time and the current time, the step S30 further includes:
step H, detecting whether an operation instruction for the display terminal exists or not;
and step I, if the operation instruction for the display terminal does not exist, continuing to execute the step of playing the display film source according to the preset playing starting time and the current time.
In this embodiment, the television terminal downloads the display film source and the synchronization mechanism file from the network background to the local, and further detects whether an operation instruction for the television terminal exists, where the operation instruction may be an instruction for controlling the television terminal through a remote controller, or an instruction for performing touch screen control on the display device, and if the operation instruction for the display terminal does not exist, it indicates that the user does not need the display terminal to display other functions, that is, the display film source continues to be played circularly, and then the step of playing the display film source according to the preset play starting time and the current time continues to be executed.
Further, step H, after the step of detecting whether there is an operation instruction for the display terminal, further includes:
and step J, if the operation instruction to the display terminal exists, quitting playing the display film source.
In this embodiment, whether an operation instruction for the display terminal exists is detected, if the operation instruction for the display terminal exists, it indicates that the user is performing other function operations on the display terminal, at this time, other function interfaces need to be displayed, and the display film source is quitted to be played, for example, if a remote controller is detected to control the television terminal, or a touch screen is detected to control the television terminal, the display film source is quitted to be played.
In this embodiment, when the display film source is played by the television terminal, the service process detects whether there is a key input, when the display film source is played, if there is a key input, the playing is exited, and when the display film source is played, if there is no key input, the display film source is played in a circulating manner.
Further, in the step J, if there is an operation instruction for the display terminal, after exiting the step of playing the display source, the method further includes:
k, determining historical execution time corresponding to the operation instruction;
step L, calculating the time interval between the historical execution time and the current time;
and M, if the time interval exceeds a preset time interval, executing the step of playing the display film source according to the preset playing starting time and the current time.
In this embodiment, after detecting that an operation instruction for the display terminal exists and exiting playing of the display film source, determining a historical execution time corresponding to the operation instruction, calculating a time interval between the historical execution time and the current time, and if the time interval exceeds a preset time interval, performing a step of playing the display film source according to a preset play start time and the current time. In this embodiment, the historical execution time is an input time of a last operation instruction, the preset time interval is a preset time interval when the display terminal exits from playing the display film source, for example, the preset time interval is set to five minutes, the television terminal continues to monitor the time interval between the input time of the last operation instruction and the current time after the television terminal is input by a key and exits from playing the display film source, if the television terminal is not controlled for a long time, the display film source needs to be continuously played, therefore, when the time interval exceeds the preset time interval, the step of playing the display film source according to the preset starting playing time and the current time is executed, so as to continue playing the display film source, referring to fig. 5, the television terminal downloads the display film source and a playing mechanism from the network to the local, detects the time interval of the last remote control, determines whether the remote controller does not control the television within five minutes, if the remote controller does not control the television within five minutes, starts playing the display film source, further determines whether the display film source is controlled by the remote controller, if the remote controller detects that the remote controller does not control, the television exits from playing, if the remote controller does not control, the remote controller starts playing again, the remote controller starts playing the remote controller, and the remote controller starts playing the remote controller automatically plays the video source again.
The present invention also provides a video synchronization apparatus, as shown in fig. 7, the video synchronization apparatus includes: the film source downloading module A10 is used for downloading a display film source from a cloud end and acquiring a synchronization mechanism file corresponding to the display film source; the film source playing module A20 is used for analyzing the synchronous mechanism file and determining the preset playing starting time of the displayed film source; the film source playing module a20 is further configured to determine the current time of the display terminal, and play the display film source according to the preset playing start time and the current time. The specific embodiment of the video synchronization apparatus of the present invention is substantially the same as the embodiments of the video synchronization method described above, and will not be described herein again.
The present invention also provides a video synchronization device, which is characterized in that the video synchronization device comprises a memory, a processor, and a video synchronization program stored on the memory and executable on the processor, wherein the video synchronization program, when executed by the processor, implements the steps of the video synchronization method according to any one of the above embodiments. The specific embodiment of the video synchronization apparatus of the present invention is substantially the same as the embodiments of the video synchronization method described above, and details are not described herein.
The present invention also provides a computer readable storage medium having stored thereon a video synchronization program, which when executed by a processor implements the steps of the video synchronization method according to any of the above embodiments. The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the video synchronization method described above, and is not repeated herein.
It is to be understood that throughout the description of the present specification, reference to the term "one embodiment", "another embodiment", "other embodiments", or "first through nth embodiments", etc., is intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.