CN108206966B - Video file synchronous playing method and device - Google Patents

Video file synchronous playing method and device Download PDF

Info

Publication number
CN108206966B
CN108206966B CN201611170214.9A CN201611170214A CN108206966B CN 108206966 B CN108206966 B CN 108206966B CN 201611170214 A CN201611170214 A CN 201611170214A CN 108206966 B CN108206966 B CN 108206966B
Authority
CN
China
Prior art keywords
video
time
played
current
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611170214.9A
Other languages
Chinese (zh)
Other versions
CN108206966A (en
Inventor
张景
宋柯彤
陈杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201611170214.9A priority Critical patent/CN108206966B/en
Publication of CN108206966A publication Critical patent/CN108206966A/en
Application granted granted Critical
Publication of CN108206966B publication Critical patent/CN108206966B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention provides a method and a device for synchronously playing video files, wherein the method for synchronously playing the video files comprises the following steps: analyzing at least two paths of videos to be played, wherein the videos to be played comprise time zone time, and each video frame in the videos to be played comprises absolute time of the video frame; periodically calculating the current reference time of each path of video to be played, wherein the current reference time of the video to be played is as follows: converting the absolute time of the current video frame to be displayed in the video to be played into time according to the time zone time in the video to be played; and controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of video to be played so as to synchronize the playing of each path of video to be played. The scheme can realize synchronous playing of videos in different time zones.

Description

Video file synchronous playing method and device
Technical Field
The invention relates to the technical field of video playing, in particular to a method and a device for synchronously playing video files.
Background
With the popularization of various multimedia players, playing audio and video and browsing pictures are the most widely used media execution modes, and more players are pursuing the effects of multi-path playing and synchronous playing, for example, 16 paths of videos are played simultaneously on the same terminal. In some scenes, the video definition is high or the number of paths to be opened is very large, performance problems may cause video blocking or delay, and thus a synchronization technique is required to keep synchronous playing among multiple paths of video.
In the related art, videos of different types are identified, encoded and extracted in a preset storage space, and are synchronously played on a time axis in a video playing system, and the played videos are supplemented by a backup video in real time. The scheme realizes the simple and easy multimedia synchronous playing effect.
However, for the scenes of videos in different time zones, due to the time difference between different time zones, for example, 23 points of beijing time and 10 points of new york time are actually the same time, according to the related art scheme, a uniform time axis is adopted, which may result in that the videos in different time zones at the same time cannot be played synchronously.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for synchronously playing video files, so as to synchronously play videos in different time zones. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for synchronously playing video files, where the method includes:
analyzing at least two paths of videos to be played, wherein the videos to be played comprise time zone time, and each video frame in the videos to be played comprises absolute time of the video frame;
periodically calculating the current reference time of each path of video to be played, wherein the current reference time of the video to be played is as follows: converting the absolute time of the current video frame to be displayed in the video to be played to obtain time according to the time zone time in the video to be played;
and controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played so as to synchronize the playing of each path of the video to be played.
Optionally, the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
Optionally, the time zone time in each path of the video to be played is stored in the private frame after each key frame of the video to be played.
Optionally, the analyzing at least two videos to be played in different time zones includes:
analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played, wherein the absolute time is as follows: generating shooting place time of the video frame at the shooting place of the video to be played;
and when the private frame is analyzed, reading the time zone time stored in the private frame as the time zone time of the video to be played containing the private frame.
Optionally, the calculating the current reference time of each path of video to be played includes:
acquiring the absolute time of a current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played;
the controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played comprises the following steps:
determining the minimum value in the current reference time of all the videos to be played as the current time synchronization reference time;
calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value, displaying the current video frame to be displayed of the video to be played;
and when the difference value between the current reference time of the video to be played and the current time synchronization reference time is larger than a preset deviation value, setting the current video frame to be displayed of the video to be played to be in a waiting state, and not displaying the current video frame to be displayed.
Optionally, the preset deviation value is a reciprocal of a specified frame rate in all videos to be played.
In a second aspect, an embodiment of the present invention further provides a device for synchronously playing video files, where the device includes:
the system comprises an analysis module, a display module and a display module, wherein the analysis module is used for analyzing at least two paths of videos to be played, the videos to be played comprise time zone time, and each video frame in the videos to be played comprises absolute time of the video frame;
the operation module is used for periodically calculating the current reference time of each path of video to be played, wherein the current reference time of the video to be played is as follows: converting the absolute time of the current video frame to be displayed in the video to be played to obtain time according to the time zone time in the video to be played;
and the control module is used for controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played so as to synchronize the playing of each path of the video to be played.
Optionally, the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
Optionally, the time zone time in each path of the video to be played is stored in the private frame after each key frame of the video to be played.
Optionally, the parsing module includes:
the absolute time determining submodule is used for analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played, wherein the absolute time is as follows: generating shooting place time of the video frame at the shooting place of the video to be played;
and the reading sub-module is used for reading the time zone time stored in the private frame as the time zone time of the video to be played containing the private frame when the private frame is analyzed.
Optionally, the operation module includes:
the acquisition submodule is used for acquiring the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
the first operation submodule is used for taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played;
the control module includes:
the second determining submodule is used for determining the minimum value in the current reference time of all the videos to be played as the current time synchronization reference time;
the second operation submodule is used for calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
the display submodule is used for displaying a current video frame to be displayed of the video to be played when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value;
and the waiting submodule is used for setting the current video frame to be displayed of the video to be played to a waiting state and not displaying the current video frame to be displayed when the difference value between the current reference time of the video to be played and the current synchronous reference time is greater than a preset deviation value.
Optionally, the preset deviation value is a reciprocal of a specified frame rate in all videos to be played.
The embodiment of the invention provides a method and a device for synchronously playing video files, which are used for analyzing a video to be played to obtain time zone time of the video to be played and absolute time of each video frame in the video to be played, wherein the time zone time represents a time zone in which the video to be played is located, converting videos to be played in different time zones to current reference time of the same time zone through time zone conversion, and finally controlling the display of the current video frame to be displayed of the video to be played according to the current reference time to realize the synchronous playing of the videos to be played.
Drawings
In order to more clearly illustrate the embodiments of the present invention or technical solutions in related arts, the drawings used in the description of the embodiments or related arts will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a video file synchronous playing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a video file synchronous playing device according to an embodiment of the present invention.
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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to realize synchronous playing of videos in different time zones, embodiments of the present invention provide a method and an apparatus for synchronously playing video files.
First, a method for synchronously playing video files according to an embodiment of the present invention is described below.
It should be noted that an execution subject of the video file synchronous playing method provided by the embodiment of the present invention may be a video player, and the video file synchronous playing method provided by the embodiment of the present invention may be implemented by software. It should be emphasized that the execution main body of the video file synchronous playing method according to the embodiment of the present invention is not limited to the above-mentioned video player, but may also be a server, an industrial personal computer, or the like, and the video file synchronous playing method provided by the embodiment of the present invention is not limited to software, but may also be a hardware circuit or a logic circuit.
As shown in fig. 1, a method for synchronously playing video files according to an embodiment of the present invention may include the following steps:
s101, analyzing at least two paths of videos to be played.
The video file may include images, video cameras, images, pictures, photos, characters, etc., the video to be played may include time zone time, and each video frame in the video to be played may include absolute time of the video frame.
It should be noted that, for the synchronous playing of the audio file, the steps are similar to those of the present embodiment, wherein the audio file may include sound, music, score, etc.; before the video is acquired, preprocessing programs such as dynamic processing, static rendering and/or texture processing can be firstly performed on a plurality of video files. The video through preprocessing can have better playing effect in the playing process.
Parsing a video is to restore information contained in the video from an already encoded form to data before encoding, and there are many video parsing methods and techniques. The video may be parsed according to the encoding standard that the video was encoded using. The coding standard includes: international union h.261, h.263, M-JPEG (Motion-joint Photographic Experts Group) and MPEG (Moving Picture Experts Group) series standards, and the like. The parsing technique belongs to the related art, and is not described in detail here.
In this embodiment, a plurality of videos to be played are played synchronously, so that two or more paths need to be ensured, for example, for two different paths of videos, the 1 st path of video is a video of 2016, 8, 23, 00,: 00 to 24, 00, one hour in eastern eight areas of china, 10, 00, to 11, 00, one hour in 2016, 8, 10, 00, to 11, 00, one hour in western five areas of new york, and the two paths of videos are actually videos at the same time because the time difference between the eastern eight areas and the western five areas is 13 hours.
It is emphasized that parsing of each video is performed in parallel, and after parsing, information carried by each video frame, including absolute time and video frame content, can be obtained. It is reasonable that the time zone time can be carried in a specific frame of the video or a key frame. The synchronous playing of the videos comprises complete synchronous playing and relative synchronous playing, wherein the complete synchronous playing means that the playing progress of the videos in the same time period in the same time zone is completely consistent, and the relative synchronous playing means that the videos in the same time period in different time zones have consistent playing progress on the basis of keeping time zone difference. It can be understood that the fully synchronized playing is a special case that the time zones are the same relative to the synchronized playing, and this embodiment can be used to implement the relative synchronized playing of multiple videos.
Optionally, the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
It should be noted that the earth has 24 time zones, the longitude of the old address of the greenwich astronomical clock in the united kingdom is the middle time zone, or called zero time zone, the longitude zone is taken as the boundary and has 12 time zones from east 1 zone to east 12 zone, and has 12 time zones from west 1 zone to west 12 zone, each time zone spans 15 degrees of longitude, the time is exactly 1 hour, the time on the central meridian of each time zone is the time uniformly adopted in the time zone, which is called zone, the time difference between two adjacent time zones is 1 hour, for example, the time in east eight zone of china is 1 hour faster than the time in east seven zone of thailand, and 1 hour slower than the time in east nine zone of japan. In many countries, the time of all locations uses a universal time, for example, in china, if the video to be played is shot in wulu wood, xinjiang, the shooting location time is the time of beijing, and the preset standard location time may be the time of any location, such as greenwich time, beijing time, and tokyo time, or the time of any time zone in which the video to be played is located in all the videos to be played. If the shooting place of the video to be played is located on the east side of the preset standard place, the time zone time of the video to be played is the difference value between the shooting place time of the video to be played and the preset standard place time, and if the shooting place of the video to be played is located on the west side of the preset standard place, the time zone time of the video to be played is the opposite number of the difference value between the preset standard place time and the shooting place time of the video to be played; and if the difference between the date of the shooting place time of the video to be played and the date of the preset standard place time is 1 day, adding 24 to the number of hours of the time with the faster date, and then performing the operation of the difference.
Alternatively, the calculation of the time difference may refer to a geographic time difference algorithm, or the time difference may be determined by referring to an international time difference table after setting a preset standard time.
Optionally, the time zone time of the video to be played may also be calculated by using the time zone value of the shooting location of the video to be played and the time zone value of the preset standard location.
Specifically, for example, the time zone time of the video to be played is calculated by using the time zone value of the shooting place of the video to be played and the time zone value of a preset standard place, the preset standard place time is set as the Greenwich mean time, when the video to be played is in the east time zone, the time zone value of the east time zone in which the video to be played is located is differed from the time zone value of the Greenwich mean time, and the time zone time of the video to be played is determined as the difference value obtained by differencing; and when the video to be played is in the west time zone, the time zone value of the Greenwich mean time is differed with the time zone value of the west time zone in which the video to be played is positioned, and the difference value obtained by determining the difference is the time zone time of the video to be played.
It should be noted that, the preset standard time is set as the greenwich mean time, the time zone time of the video can be intuitively determined from the time zone in which the video to be played is located, the method for determining the time zone time is simple, i.e. the time zone time is different from the time zone value of the greenwich mean time, it can be understood that the time zone time of the video in the east time zone is actually the time zone value of the time zone in which the video is located, and the time zone time of the video in the west time zone is actually the opposite number of the time zone value of the time zone in which the video is located. For example, if the first path of video to be played is a video in the eight east areas of china, and the second path of video to be played is a video in the five west areas of new york, the time zone time of the first path of video to be played can be determined to be 8 hours and the time zone time of the second path of video to be played is-5 hours according to the preset standard time zone.
Optionally, the time zone time in each path of the video to be played is stored in the private frame after each key frame of the video to be played.
It should be noted that, when the code stream of the video is recorded, a private frame is set behind each key frame, and the private frame is used for storing the time zone time of the path of video, so as to ensure that each path of video obtained stores the time zone time of the time zone in which the path of video is located, so that the private frame is used for realizing synchronous playing of videos in different time zones in subsequent steps, and does not occupy the space of other frames, thereby ensuring the decoding efficiency.
It should be noted that, since the key frame usually contains the key change of the video, if the video is shot in an airplane or a satellite, and the shooting location of the video changes from time to time at a certain moment, the time zone time in the private frame after the key frame also changes in the video after the moment.
Optionally, the analyzing at least two videos to be played in different time zones may include:
firstly, analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played.
Wherein, the absolute time is: the shooting place time of the video frame is generated at the shooting place of the video to be played. It should be noted that the absolute time is the time when each video frame in the video is generated, and the shooting location time is not necessarily the time of the time zone in which the shooting location is located, for example, the video to be played is shot in wulu wood, but the shooting location time of the video is the beijing time, and then the absolute time of the video is the beijing time when the video is shot. The absolute time is bound with time of time zones in a code stream of the video, so that the absolute time of a video frame at the same moment in different time zones is different, for example, the absolute time of the video in the east eight area of China is 2016, 8 and 8 days 23:00:00, and the absolute time of the video in the west five areas of New York is 2016, 8 and 8 days 8 and 10:00:00 as the time difference between the west five areas of New York and the east eight area of China is 13 time zones, namely 13 hours later.
Secondly, when the private frame is analyzed, the time zone time stored in the private frame is read as the time zone time of the video to be played containing the private frame.
It should be noted that, when the private frame is analyzed, the time zone time stored in the private frame is read, and the time zone time may be converted and determined in advance according to the time zone where the shooting place of the video to be played is located and the preset standard time zone, and then stored in the private frame. Or, the private frame may also store time zone information of a time zone in which the video is located, and when the private frame is analyzed, the time zone information stored in the private frame is read out, and then the time zone information is converted to obtain time of the time zone.
And S102, periodically calculating the current reference time of each path of video to be played.
Wherein, the current reference time is: and according to the time zone time in the video to be played, converting the absolute time of the current video frame to be displayed in the video to be played to obtain the time. In order to ensure the effect of viewing multiple videos, the period of the loop calculation is usually chosen to be small, for example, 5 ms. In each period, the playing of the video to be played is controlled by calculating the current reference time so as to realize the synchronous playing of the multi-channel video.
It should be noted that the step of calculating the current reference time for each video may be executed in parallel, and the above steps are executed in parallel every other period for each video.
In order to keep the synchronous playing of multiple paths of videos, the method can be realized by enabling the video playing faster to be 'waiting' to play the slower video, for example, if two paths of videos exist, the absolute time obtained by analyzing the video in the east eight area of the 1 path is 2016, 23:10:10 in 8 months in 8 days in the 2016 year, 10:11:11 in 8 months in the 2016 year, 10:10 in 8 days in the west five area of the 2 path, the reference time of the video in the 1 path can be calculated to be 2016, 8 months, 8 days in the 8 months, 15:10:10 in the 2016 year, and 15:11:11 in 8 days in the 8 months in the 2016 year in the 2 path. According to the concept of 'waiting', the 1 st path of video can be marked as a playing state, the 2 nd path of video can be marked as a waiting state, and when the reference time of the 1 st path of video is equal to or close to the reference time of the 2 nd path of video, the 2 nd path of video continues to be played, so that the two paths of video can be synchronously played.
Optionally, the step of calculating the current reference time of each path of video to be played may include:
firstly, obtaining the absolute time of a current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
and secondly, taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played.
It should be noted that, the substantial meaning of calculating the current reference time of each path of video to be played is to convert the absolute time of the video to be played in different time zones to the current reference time in the same time zone through calculation, and therefore, the current reference time is obtained by making a difference between the absolute time and the time zone time. If multiple videos are in the same time zone, the method provided by the embodiment can also be used for realizing the multiple videos.
S103, controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of video to be played so as to synchronize the playing of each path of video to be played.
It should be noted that the controlling of the display of the current to-be-displayed video frame of the to-be-played video may be controlling of the display of the video frame in the video with the faster current reference time in the above step. Optionally, the displaying of the current video frame to be displayed of each video to be played is performed in parallel.
Optionally, the step of controlling the display of the current video frame to be displayed of each video to be played according to the current reference time of each video to be played may include:
firstly, determining the minimum value of the current reference time of all videos to be played as the current time synchronization reference time;
secondly, calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
then, when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value, displaying the current video frame to be displayed of the video to be played; or when the difference value between the current reference time of the video to be played and the current time synchronization reference time is larger than the preset deviation value, setting the current video frame to be displayed of the video to be played to be in a waiting state, and not displaying the current video frame to be displayed.
It should be noted that, in order to implement synchronization, in this embodiment, a video with a faster current reference time is set to be in a waiting state, and waits for other videos, so that a video to be played in the waiting state is stopped at a video frame before a video frame to be currently displayed, that is, the video to be played in the waiting state is not displayed at the video frame to be currently displayed, and the displayed effect is that the video in the path is stopped at the previous video frame. The method for realizing synchronous playing based on the video with faster current reference time to 'wait' the video with slower current reference time can set the minimum value of the current reference time of all the videos as the current time synchronous reference time, except setting the video corresponding to the current time synchronous reference time as the playing state, also setting the video with very small difference between the current reference time and the current time synchronous reference time as the playing state, and setting the video with too large difference as the waiting state. Wherein, for the analysis convenience and guarantee personnel observe the effect of video synchronization broadcast, can be through setting for predetermineeing the deviation value, if the difference is less than predetermineeing the deviation value then think the difference very little, and the difference is greater than predetermineeing the deviation value then think the difference too big. Typically, the predetermined offset value is a small value.
Optionally, the preset deviation value is a reciprocal of a specified frame rate in all videos to be played.
It should be noted that, different video streams are not completely aligned, so that synchronization can be performed within a small deviation range, the preset deviation value is usually a small value, and in order to ensure data reasonableness, since the frame rate of a video is the number of video frames displayed in 1 second, the reciprocal of the frame rate is the time for displaying one video frame, which is usually data in millisecond order. Since the reciprocal of the frame rate is in the millisecond level, the reciprocal of the frame rate of all the videos to be played generally has a small difference, so the preset deviation value may be set as the reciprocal of the frame rate of any video to be played in the embodiment.
It should be noted that if the multiple videos to be played are at the moment of just starting to play, the current reference time is different, for example, the current reference time of the initial time of the 1 st video is 2016, 8 months, 8 days, 15:10:10, the current reference time of the initial time of the 2 nd video is 2016, 8 months, 8 days, 15:11:11, and the current reference time of the two videos is greatly different, so that the 1 st video can be in a playing state, the 2 nd video is in a waiting state, the 1 st video starts to be played at the initial moment, the 2 nd video does not be played until the 1 st video is played to 2016, 8 months, 8 days, 15:11:11, and the 1 st video and the 2 nd video synchronously play subsequent videos; there is also a case that, if a certain video is played, the video is jammed due to the delay problem of the line, and the other paths of videos are normally played, the video with the jamming can be marked as the playing state, and the other paths of videos can be marked as the waiting state, for example, the 1 st video is jammed when playing to the current reference time of 2016, 8 months, 8 days, 16:10:12, and the 2 nd video continues to be played to the current reference time of 2016, 8 months, 8 days, 16:10:13, and the current reference time difference of the two videos is large, so that the 1 st video can be in a playing state, the 2 nd video can be in a waiting state, and after the 1 st video is normal, starting to play the 1 st video until the current reference time of the 1 st video is close to the current reference time of the 2 nd video, and synchronously playing the subsequent videos by the two videos.
In order to improve the effect of video synchronization viewed by a user, if a certain path of video is jammed, the difference value between the video of other paths and the current reference time of the jammed video is judged every millisecond-level time.
By applying the embodiment, the time zone time of the video to be played and the absolute time of each video frame in the video to be played are obtained by analyzing the video to be played, the time zone time represents the time zone in which the video to be played is located, then the videos to be played in different time zones are converted to the current reference time of the same time zone through time zone conversion, and finally the display of the current video frame to be displayed of the video to be played is controlled according to the current reference time, so that the synchronous playing of all the videos to be played is realized. Displaying a current video frame to be displayed of a video to be played, of which the current reference time is less than or equal to the current time synchronization reference time, by determining the current time synchronization reference time; the current video frame to be displayed of the video to be played with the current reference time larger than the current time synchronization reference time is set to be in a waiting state, and the synchronous playing of the videos in different time zones is realized by utilizing time zone conversion on the basis of synchronization without displaying the embodiment. And when the code stream of the video is recorded, setting that a private frame storing time zone time exists behind each key frame, and ensuring the decoding efficiency.
The following describes a video file synchronous playing method provided by the embodiment of the present invention with reference to a specific application example.
Suppose that two paths of videos to be played in different time zones exist, the 1 st path of video to be played is a video of 2016, 8, 23, 00 to 24, 00, one hour in the east eight area of China, and a video of 2016, 8, 10, 00 to 11, 00, one hour in the west five areas of New York when the 2 nd path of video to be played is; analyzing the two paths of videos to be played, wherein the time zone time for reading the 1 st path of video to be played from the private frame of the 1 st path of video to be played is 8 hours, and the time zone time for reading the 2 nd path of video to be played from the private frame of the 2 nd path of video to be played is-5 hours; the absolute time of the first video frame of the 1 st path to-be-played video is 2016, 8 months, 8 days 23:00:00, the difference between the absolute time and the time zone time of the 1 st path to-be-played video is used for obtaining the current reference time of the first video frame of the 1 st path to-be-played video, which is 2016, 8 months, 8 days 15:00:00, the absolute time of the first video frame of the 2 nd path to-be-played video is 2016, 8 months, 8 days 10:00:00, the difference between the absolute time and the time zone time of the 2 nd path to-be-played video is used for obtaining the current reference time of the first video frame of the 2 nd path to-be-played video, which is 2016, 8 months, 8 days 15:00: 00; setting a preset deviation value to be 40ms, selecting 2016, 8 months, 8 days, 15:00:00 as a current time synchronization reference time, setting a difference between the current reference time of the 1 st path and the current time synchronization reference time to be 0, and setting a difference between the current reference time of the 2 nd path and the current time synchronization reference time to be 0, so that the two paths of videos to be played are set to be in a playing state, and the first video frames of the two paths of videos are played synchronously.
Assuming that the video to be played in the 1 st path is blocked when playing the video frame with the absolute time of 2016, 8 months, 8 days, 23:10:10, and the absolute time is different from the time zone time of the video to be played in the 1 st path to obtain the current reference time of the current video frame to be displayed in the video to be played in the 1 st path of 2016, 8 months, 8 days, 15:10:10, because the video to be played in the 2 nd path is not blocked and the video is still played continuously, determining the current reference time of the current video frame to be displayed in the video to be played in the 1 st path as the current time synchronization reference time, setting the step of calculating the current time synchronization reference time to be executed once every 5ms, and when the step is executed to the 8 th period, the difference value between the current reference time of the video to be played in the 2 nd path and the current time synchronization reference time reaches 40 ms; then the 2 nd path video to be played is marked as a waiting state at the moment, and the current video frame to be displayed of the 2 nd path video to be played at the moment is not displayed; and normally playing the 1 st path of video to be played until the pause phenomenon of the 1 st path is eliminated, and starting to play the 2 nd path of video to be played when the difference value between the current reference time of the current video frame to be displayed of the 2 nd path of video to be played and the current time synchronization reference time is less than 40 ms.
Compared with the related technology, the method and the device have the advantages that the time zone time of the video to be played and the absolute time of each video frame in the video to be played are obtained by analyzing the video to be played, the time zone time represents the time zone where the video to be played is located, then the videos to be played in different time zones are converted to the current reference time of the same time zone through time zone conversion, and finally the display of the current video frame to be displayed of the video to be played is controlled according to the current reference time, so that the synchronous playing of all the videos to be played is achieved, and the synchronous playing of the videos in different time zones is achieved by utilizing the time zone conversion on the basis of synchronization.
Corresponding to the foregoing method embodiment, an embodiment of the present invention provides a video file synchronous playing apparatus, and as shown in fig. 2, the apparatus may include:
the parsing module 210 is configured to parse at least two videos to be played, where the videos to be played include time zone time, and each video frame in the videos to be played includes absolute time of the video frame;
the operation module 220 is configured to periodically calculate a current reference time of each path of video to be played, where the current reference time of the video to be played is: converting the absolute time of the current video frame to be displayed in the video to be played to obtain time according to the time zone time in the video to be played;
the control module 230 is configured to control display of a current video frame to be displayed of each path of the video to be played according to the current reference time of the video to be played, so as to synchronize playing of each path of the video to be played.
By applying the embodiment, the time zone time of the video to be played and the absolute time of each video frame in the video to be played are obtained by analyzing the video to be played, the time zone time represents the time zone in which the video to be played is located, then the videos to be played in different time zones are converted to the current reference time of the same time zone through time zone conversion, and finally the display of the current video frame to be displayed of the video to be played is controlled according to the current reference time, so that the synchronous playing of all the videos to be played is realized.
Optionally, the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
Optionally, the time zone time in each path of the video to be played is stored in the private frame after each key frame of the video to be played.
Optionally, the parsing module 210 may include:
the absolute time determining submodule is used for analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played, wherein the absolute time is as follows: generating shooting place time of the video frame at the shooting place of the video to be played;
and the reading sub-module is used for reading the time zone time stored in the private frame as the time zone time of the video to be played containing the private frame when the private frame is analyzed.
Optionally, the operation module 220 may include:
the acquisition submodule is used for acquiring the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
the first operation submodule is used for taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played;
the control module 230 may include:
the second determining submodule is used for determining the minimum value in the current reference time of all the videos to be played as the current time synchronization reference time;
the second operation submodule is used for calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
the display submodule is used for displaying a current video frame to be displayed of the video to be played when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value;
and the waiting submodule is used for setting the current video frame to be displayed of the video to be played to a waiting state and not displaying the current video frame to be displayed when the difference value between the current reference time of the video to be played and the current synchronous reference time is greater than a preset deviation value.
Optionally, the preset deviation value may be an inverse number of a specified frame rate in all videos to be played.
It should be noted that the video file synchronous playing device of the embodiment of the present invention is a device applying the video file synchronous playing method, and all embodiments of the video file synchronous playing method are applicable to the device and can achieve the same or similar beneficial effects.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A video file synchronous playing method is characterized by comprising the following steps:
analyzing at least two paths of videos to be played, wherein the videos to be played comprise time zone time, and each video frame in the videos to be played comprises absolute time of the video frame;
periodically calculating the current reference time of each path of video to be played, wherein the current reference time of the video to be played is as follows: converting the absolute time of the current video frame to be displayed in the video to be played to obtain time according to the time zone time in the video to be played;
controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played so as to synchronize the playing of each path of the video to be played;
the calculating the current reference time of each path of video to be played comprises the following steps:
acquiring the absolute time of a current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played;
the controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played comprises the following steps:
determining the minimum value in the current reference time of all the videos to be played as the current time synchronization reference time;
calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value, displaying the current video frame to be displayed of the video to be played;
and when the difference value between the current reference time of the video to be played and the current time synchronization reference time is larger than a preset deviation value, setting the current video frame to be displayed of the video to be played to be in a waiting state, and not displaying the current video frame to be displayed.
2. The method for synchronously playing the video files according to claim 1, wherein the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
3. The method for synchronously playing the video files according to claim 1, wherein the time zone time in each path of the video to be played is stored in the private frame after each key frame of the video to be played.
4. The method for synchronously playing the video files according to claim 3, wherein the analyzing at least two videos to be played in different time zones comprises:
analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played, wherein the absolute time is as follows: generating shooting place time of the video frame at the shooting place of the video to be played;
and when the private frame is analyzed, reading the time zone time stored in the private frame as the time zone time of the video to be played containing the private frame.
5. The method of claim 1, wherein the predetermined bias value is the reciprocal of a frame rate specified in all videos to be played.
6. A video file synchronized playback device, the device comprising:
the system comprises an analysis module, a display module and a display module, wherein the analysis module is used for analyzing at least two paths of videos to be played, the videos to be played comprise time zone time, and each video frame in the videos to be played comprises absolute time of the video frame;
the operation module is used for periodically calculating the current reference time of each path of video to be played, wherein the current reference time of the video to be played is as follows: converting the absolute time of the current video frame to be displayed in the video to be played to obtain time according to the time zone time in the video to be played;
the control module is used for controlling the display of the current video frame to be displayed of the video to be played according to the current reference time of each path of the video to be played so as to synchronize the playing of each path of the video to be played;
the operation module comprises:
the acquisition submodule is used for acquiring the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of each path of video to be played;
the first operation submodule is used for taking the difference value between the absolute time of the current video frame to be displayed in each path of video to be played and the time zone time of the video to be played as the current reference time of the video to be played;
the control module includes:
the second determining submodule is used for determining the minimum value in the current reference time of all the videos to be played as the current time synchronization reference time;
the second operation submodule is used for calculating the difference value between the current reference time of each path of video to be played and the current time synchronization reference time;
the display submodule is used for displaying a current video frame to be displayed of the video to be played when the difference value between the current reference time of the video to be played and the current time synchronization reference time is smaller than or equal to a preset deviation value;
and the waiting submodule is used for setting the current video frame to be displayed of the video to be played to a waiting state and not displaying the current video frame to be displayed when the difference value between the current reference time of the video to be played and the current synchronous reference time is greater than a preset deviation value.
7. The device for synchronously playing back video files according to claim 6, wherein the time zone time is: and the time difference between the shooting place time of the video to be played and the preset standard place time.
8. The device for synchronously playing back video files according to claim 6, wherein the time zone time in each path of the video to be played is stored in a private frame after each key frame of the video to be played.
9. The device for synchronously playing back video files according to claim 8, wherein the parsing module comprises:
the absolute time determining submodule is used for analyzing each path of video to be played in parallel to obtain the absolute time of each video frame in each path of video to be played, wherein the absolute time is as follows: generating shooting place time of the video frame at the shooting place of the video to be played;
and the reading sub-module is used for reading the time zone time stored in the private frame as the time zone time of the video to be played containing the private frame when the private frame is analyzed.
10. The device of claim 6, wherein the predetermined deviation value is the reciprocal of a frame rate specified in all videos to be played.
CN201611170214.9A 2016-12-16 2016-12-16 Video file synchronous playing method and device Active CN108206966B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611170214.9A CN108206966B (en) 2016-12-16 2016-12-16 Video file synchronous playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611170214.9A CN108206966B (en) 2016-12-16 2016-12-16 Video file synchronous playing method and device

Publications (2)

Publication Number Publication Date
CN108206966A CN108206966A (en) 2018-06-26
CN108206966B true CN108206966B (en) 2020-07-03

Family

ID=62602054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611170214.9A Active CN108206966B (en) 2016-12-16 2016-12-16 Video file synchronous playing method and device

Country Status (1)

Country Link
CN (1) CN108206966B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525879A (en) * 2018-10-30 2019-03-26 北京凯视达科技有限公司 Video playing control method and device
CN109769124A (en) * 2018-12-13 2019-05-17 广州华多网络科技有限公司 Mixed flow method, apparatus, electronic equipment and storage medium
CN110430445B (en) * 2019-06-26 2021-12-10 深圳拙河科技有限公司 Video synchronous playing method, device, equipment and medium
CN110475137B (en) * 2019-09-06 2021-05-14 北京市博汇科技股份有限公司 High-precision distributed display control frame synchronization method and system
CN111683215B (en) * 2020-06-05 2023-03-24 杭州海康威视数字技术股份有限公司 Video playback method and device, electronic equipment and computer readable storage medium
CN112004132B (en) * 2020-09-02 2022-10-21 北京猿力未来科技有限公司 Video synchronous playing method and device
CN112565630B (en) * 2020-12-08 2023-05-05 杭州电子科技大学 Video frame synchronization method for video stitching
CN113163222A (en) * 2021-03-31 2021-07-23 杭州奥点科技股份有限公司 Video frame synchronization method, system, equipment and readable storage medium
CN113542811B (en) * 2021-07-15 2023-05-16 杭州海康威视数字技术股份有限公司 Video playing method, device and computer readable storage medium
CN115883748A (en) * 2022-11-28 2023-03-31 中汽创智科技有限公司 Data playback synchronization method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047776A (en) * 2006-04-17 2007-10-03 华为技术有限公司 Mobile broadcast network system and method for implementing synchronous of the network
CN102630017A (en) * 2012-04-10 2012-08-08 中兴通讯股份有限公司 Method and system for synchronizing mobile multi-media broadcasting and subtitles
CN105612758A (en) * 2013-11-20 2016-05-25 纳宝株式会社 Video-providing method and video-providing system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040103444A1 (en) * 2002-11-26 2004-05-27 Neal Weinberg Point to multi-point broadcast-quality Internet video broadcasting system with synchronized, simultaneous audience viewing and zero-latency
US9094715B2 (en) * 2009-05-29 2015-07-28 Cognitive Networks, Inc. Systems and methods for multi-broadcast differentiation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047776A (en) * 2006-04-17 2007-10-03 华为技术有限公司 Mobile broadcast network system and method for implementing synchronous of the network
CN102630017A (en) * 2012-04-10 2012-08-08 中兴通讯股份有限公司 Method and system for synchronizing mobile multi-media broadcasting and subtitles
CN105612758A (en) * 2013-11-20 2016-05-25 纳宝株式会社 Video-providing method and video-providing system

Also Published As

Publication number Publication date
CN108206966A (en) 2018-06-26

Similar Documents

Publication Publication Date Title
CN108206966B (en) Video file synchronous playing method and device
CN106257930B (en) Generate the dynamic time version of content
US9430115B1 (en) Storyline presentation of content
CN103165156B (en) Audio video synchronization Play System and video broadcasting method, CD
CN101778257B (en) Generation method of video abstract fragments for digital video on demand
US10129587B2 (en) Fast switching of synchronized media using time-stamp management
WO2008048067A1 (en) Encoding method and apparatus and decoding method and apparatus
US20090070850A1 (en) System and method for searching video signals
EP2683163A1 (en) Synchronized content broadcast distribution system
US10462415B2 (en) Systems and methods for generating a video clip and associated closed-captioning data
CN112272327B (en) Data processing method, device, storage medium and equipment
EP1997109A1 (en) Converting a still image in a slide show to a plurality of video frame images
WO2019109678A1 (en) Subtitle switching method and display apparatus
CN105744291B (en) Video data handling procedure and system, video playback apparatus and cloud server
US20070154164A1 (en) Converting a still image in a slide show to a plurality of video frame images
JP6811811B1 (en) Metadata generation system, video content management system and programs
CN107231578A (en) The system and method that video file is quickly played
CN1063308C (en) Interactive image sychronization captions display device and display method
US11128914B2 (en) Client side stitching of content into a multimedia stream
CN112118473B (en) Video bullet screen display method and device, computer equipment and readable storage medium
KR102131741B1 (en) Synchronization method for image of multiple digital signages
WO2007055445A1 (en) A pre-viewing method of multiple movies or movie-clips in multimedia apparatus
CN112291616B (en) Video advertisement identification method, device, storage medium and equipment
CN116547960A (en) Method and apparatus for supporting MPEG DASH for pre-and mid-set content during media playback
CN118175346A (en) Video playing method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant