CN111669539A - Video playing method and device and electronic equipment - Google Patents

Video playing method and device and electronic equipment Download PDF

Info

Publication number
CN111669539A
CN111669539A CN201910165346.XA CN201910165346A CN111669539A CN 111669539 A CN111669539 A CN 111669539A CN 201910165346 A CN201910165346 A CN 201910165346A CN 111669539 A CN111669539 A CN 111669539A
Authority
CN
China
Prior art keywords
time
playing
playing time
video corresponding
auxiliary channel
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.)
Pending
Application number
CN201910165346.XA
Other languages
Chinese (zh)
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 CN201910165346.XA priority Critical patent/CN111669539A/en
Publication of CN111669539A publication Critical patent/CN111669539A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • 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
    • 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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk

Abstract

The embodiment of the invention provides a video playing method, a video playing device and electronic equipment, wherein the method comprises the following steps: determining a primary channel of a plurality of channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. By the technical scheme provided by the embodiment of the invention, the synchronization effect of the videos corresponding to different channels can be improved in the process that the video monitoring equipment simultaneously plays the videos corresponding to different channels.

Description

Video playing method and device and electronic equipment
Technical Field
The present invention relates to the field of video monitoring technologies, and in particular, to a video playing method and apparatus, and an electronic device.
Background
In recent years, with the rapid development of computers, networks, image processing and transmission technologies, video monitoring equipment is more and more widely applied.
The video monitoring equipment can acquire videos recorded by different cameras through a plurality of channels, namely, the videos recorded by different cameras correspond to different channels; moreover, the video monitoring equipment can simultaneously play videos corresponding to different channels.
In practical applications, videos corresponding to different channels may be videos recorded by different cameras in the same time period. In this case, in the related art, in the process of simultaneously playing videos corresponding to different channels, the video monitoring device has a problem that the synchronization effect of the videos corresponding to the different channels is poor. Specifically, the playing speed of the video corresponding to some channels is fast, and the playing speed of the video corresponding to some channels is slow, so that the playing schedules of the videos corresponding to different channels are inconsistent, that is, the synchronization effect of the videos corresponding to different channels is poor.
Disclosure of Invention
The embodiment of the invention aims to provide a video playing method, a video playing device and electronic equipment, so that the synchronization effect of videos corresponding to different channels is improved in the process that video monitoring equipment plays videos corresponding to different channels simultaneously. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video playing method, where the method includes:
determining a primary channel of a plurality of channels;
monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel;
and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode.
Optionally, the step of adjusting the second playing time of the video corresponding to the auxiliary channel according to the predetermined first synchronous adjustment manner includes:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time;
and if the currently monitored second playing time is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, wherein the absolute value of the time difference between the target playing time and the monitored first playing time is less than the first preset time.
Optionally, if the absolute value of the time difference between the currently monitored first playing time and the second playing time is smaller than a first preset time, the method further includes:
judging whether the absolute value of the time difference is smaller than a second preset time length, wherein the second preset time length is smaller than the first preset time length;
and if the absolute value of the time difference is greater than the second preset time length, adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjustment mode.
Optionally, the step of adjusting the current playing time of the video corresponding to the auxiliary channel according to a predetermined second synchronous adjustment manner includes:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the second preset time;
and if the currently monitored second playing time is less than the first playing time, improving the decoding speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than the second preset time.
Optionally, if the absolute value of the time difference is smaller than the second preset time duration, the method further includes:
and controlling the playing speed of the video corresponding to the auxiliary channel according to a target frame rate, wherein the target frame rate is the frame rate corresponding to the video corresponding to the auxiliary channel when the video corresponding to the auxiliary channel is recorded.
In a second aspect, an embodiment of the present invention provides a video playing apparatus, where the apparatus includes:
a main channel determination module for determining a main channel of the plurality of channels;
the playing time determining module is used for monitoring a first playing time of the video corresponding to the main channel and a second playing time of the video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel;
and the first playing time adjusting module is used for adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjusting mode if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time length.
Optionally, the play time adjusting module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time;
and if the currently monitored second playing time is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, wherein the absolute value of the time difference between the target playing time and the monitored first playing time is less than the first preset time.
Optionally, the apparatus further comprises:
the time judgment module is used for judging whether the absolute value of the time difference between the currently monitored first playing time and the second playing time is smaller than a first preset time length or not, wherein the second preset time length is smaller than the first preset time length;
and the second playing time adjusting module is used for adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjusting mode if the absolute value of the time difference is greater than the second preset time length.
Optionally, the second play time adjusting module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the second preset time;
and if the currently monitored second playing time is less than the first playing time, improving the decoding speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than the second preset time.
Optionally, the apparatus further comprises:
and the playing speed control module is used for controlling the playing speed of the video corresponding to the auxiliary channel according to a target frame rate if the absolute value of the time difference is smaller than the second preset time length, wherein the target frame rate is the frame rate corresponding to the recording of the video corresponding to the auxiliary channel.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the video playing method of the first aspect when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the video playing method according to the first aspect.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art 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 flowchart of a video playing method according to an embodiment of the present invention;
fig. 2 is a flowchart of another video playing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a video playback device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic 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 improve the synchronization effect of videos corresponding to different channels in the process that video monitoring equipment simultaneously plays the videos corresponding to different channels, embodiments of the present invention provide a video playing method, an apparatus, and an electronic device.
For clarity of the description of the solution, an application scenario of the technical solution provided by the embodiment of the present invention is first explained.
In practical application, the video monitoring device can be in communication connection with a plurality of cameras, and the video monitoring device can acquire videos recorded by different cameras through a plurality of channels, that is, videos recorded by different cameras correspond to different channels; moreover, the video monitoring equipment can simultaneously play videos corresponding to different channels.
For example, the video monitoring apparatus is in communication connection with four cameras, which are respectively: camera 1, camera 2, camera 3 and camera 4. The video monitoring equipment can acquire the video recorded by the camera 1 through a channel with the channel number of 0; acquiring a video recorded by the camera 2 through a channel with the channel number of 1; acquiring a video recorded by the camera 3 through a channel with the channel number of 2; the video recorded by the camera 4 is acquired through the channel with the channel number 3. That is, the video recorded by the camera 1 corresponds to the channel with the channel number of 0; the video recorded by the camera 2 corresponds to a channel with the channel number of 1; the video recorded by the camera 3 corresponds to a channel with the channel number of 2; the video recorded by the camera 4 corresponds to the channel with channel number 3. And, the video monitoring apparatus can simultaneously play the video recorded by the camera 1, the video recorded by the camera 2, the video recorded by the camera 3, and the video recorded by the camera 4.
The video recorded by the camera 1, the video recorded by the camera 2, the video recorded by the camera 3, and the video recorded by the camera 4 may be: video recorded by the camera 1, the camera 2, the camera 3 and the camera 4 in the same time period. For example, the video recorded by the camera 1 is the video recorded by the camera 1 in the time period of 9:00 to 10:00 of 12/5/2018, the video recorded by the camera 2 is the video recorded by the camera 2 in the time period of 9:00 to 10:00 of 5/2018, 12/5/2018, the video recorded by the camera 3 is the video recorded by the camera 3 in the time period of 9:00 to 10:00 of 5/2018, 12/5/2018, and the video recorded by the camera 4 is the video recorded by the camera 4 in the time period of 9:00 to 10:00 of 5/2018, 12/5/2018.
In order to meet the requirements of users, the video recorded by the camera 1, the video recorded by the camera 2, the video recorded by the camera 3, and the video recorded by the camera 4 can be played at the same time at the video monitoring time. In order to enable a user to view image information of the camera 1, the camera 2, the camera 3, and the camera 4 at the same time in the process of watching a video, the video monitoring device needs to ensure that the playing schedules of videos recorded by different cameras are consistent, that is, videos corresponding to different channels are played synchronously.
In a first aspect, a video playing method provided in an embodiment of the present invention is described below.
It should be noted that an execution subject of the video playing method provided in the embodiment of the present invention may be a video playing device, and the video playing device may be operated in an electronic device, where the electronic device may be a video monitoring device, and may also be a background server communicatively connected to the video monitoring device, and the electronic device is not limited in the embodiment of the present invention.
As shown in fig. 1, a video playing method provided in an embodiment of the present invention may include the following steps:
s110, determining a main channel in the plurality of channels.
In one embodiment, the main channel may be predetermined, and for example, a channel with a channel number of 0 may be determined as the main channel.
In another embodiment, one channel may be selected from the multiple channels as the main channel according to the channel number of the channel, the start time and the end time of the video corresponding to the channel, the time length of the video, and the continuity of the video.
It is understood that the channels of the plurality of channels other than the primary channel are secondary channels.
It should be noted that, in practical applications, there may be multiple ways of determining the main channel in the multiple channels, and the way of determining the main channel in the multiple channels is not specifically limited in the embodiment of the present invention.
And S120, monitoring a first playing time of the video corresponding to the main channel and a second playing time of the video corresponding to the auxiliary channel, wherein the auxiliary channel is a channel except the main channel in the plurality of channels.
The video monitoring equipment can monitor the first playing time of the video corresponding to the main channel and the second playing time of the video corresponding to the auxiliary channel in real time; or, the video monitoring device may monitor the first playing time of the video corresponding to the main channel and the second playing time of the video corresponding to the auxiliary channel according to a preset time interval, which is reasonable. The embodiment of the present invention is not particularly limited to this.
It can be understood that the first playing time may be a current playing time of a video corresponding to the main channel, and the second playing time may be a current playing time of a video corresponding to the auxiliary channel.
S130, if the absolute value of the time difference between the first playing time and the second playing time monitored currently is larger than a first preset time, the second playing time of the video corresponding to the auxiliary channel is adjusted according to a preset first synchronous adjustment mode.
If the absolute value of the time difference between the currently monitored first playing time and the currently monitored second playing time is greater than the first preset time length, the current playing time of the video corresponding to the main channel is described to be inconsistent with the current playing time of the video corresponding to the auxiliary channel, namely, the synchronization effect of the video corresponding to the main channel and the video corresponding to the auxiliary channel is poor, so that the second playing time of the video corresponding to the auxiliary channel can be adjusted according to a preset first synchronization adjustment mode at the moment to improve the synchronization effect of the video corresponding to the main channel and the video corresponding to the auxiliary channel.
The size of the first preset duration may be set according to an actual situation, and the size of the first preset duration is not specifically limited in the embodiment of the present invention.
In an embodiment, the step of adjusting the second playing time of the video corresponding to the secondary channel according to the predetermined first synchronization adjustment manner may include the following two steps a1 and a 2:
step A1, if the second playing time monitored currently is greater than the first playing time, pausing the playing of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time.
If the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than the first preset time length, and the second playing time is greater than the first playing time length, it is indicated that the playing progress of the video corresponding to the current auxiliary channel is faster than the playing progress of the video corresponding to the main channel, and the video monitoring equipment needs to pause playing the video corresponding to the auxiliary channel, that is, the video corresponding to the auxiliary channel enters a waiting state. Specifically, the video monitoring device does not decode the video frame of the video corresponding to the auxiliary channel. In addition, in the process that the video corresponding to the auxiliary channel is in the waiting state, the video monitoring device can acquire the first playing time of the video corresponding to the main channel in real time, and the video monitoring device restarts to play the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time and the pause time of the video corresponding to the auxiliary channel is smaller than a first preset time length.
Step A2, if the second playing time monitored currently is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, where an absolute value of a time difference between the target playing time and the monitored first playing time is less than the first preset time.
If the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time length, and the second playing time is less than the first playing time length, it is indicated that the playing progress of the video corresponding to the current auxiliary channel is slower than the playing progress of the video corresponding to the main channel.
Specifically, the specific implementation manner that the video monitoring device adjusts the second playing time of the video corresponding to the auxiliary channel to the target playing time may be: the video monitoring device may directly discard the current video frame of the video corresponding to the auxiliary channel, that is, the current video frame is not decoded, and then continue to process the next video frame of the video corresponding to the auxiliary channel, and if the absolute value of the time difference between the playing time corresponding to the next video frame and the monitored first playing time is still greater than the first preset time length, continue to discard the next video frame until the absolute value of the time difference between the playing time corresponding to a certain video frame and the monitored first playing time is found to be less than the first preset time length, the playing time corresponding to the video frame may be determined as the target playing time, that is, the video frame may be decoded, and the video frame may be played.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved.
In order to further improve the synchronization effect of videos corresponding to different channels, an embodiment of the present invention further provides a video playing method, as shown in fig. 2, where the video playing method may include the following steps:
s210, determining a main channel in the plurality of channels.
S220, monitoring a first playing time of the video corresponding to the main channel and a second playing time of the video corresponding to the auxiliary channel, wherein the auxiliary channel is a channel except the main channel in the plurality of channels.
And S230, if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode.
Since steps S210-S230 of the embodiment shown in fig. 2 are the same as steps S110-S130 of the embodiment shown in fig. 1, steps S210-S230 will not be described again.
S240, if the absolute value of the time difference between the first playing time and the second playing time monitored currently is smaller than a first preset time, judging whether the absolute value of the time difference is smaller than a second preset time, wherein the second preset time is smaller than the first preset time. If the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than the second preset time, step S250 is executed, and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is less than the second preset time, step S260 is executed.
If the absolute value of the time difference between the currently monitored first playing time and the currently monitored second playing time is smaller than a first preset time, the playing progress of the video corresponding to the main channel is more consistent with the playing progress of the video corresponding to the auxiliary channel, and in order to further improve the synchronization effect of the videos corresponding to different channels, whether the absolute value of the time difference between the currently monitored first playing time and the currently monitored second playing time is smaller than a second preset time is further judged, wherein the second preset time is smaller than the first preset time.
And S250, adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjustment mode.
If the absolute value of the time difference between the currently monitored first playing time and the currently monitored second playing time is greater than the second preset time length, it is indicated that a certain inconsistency still exists between the playing progress of the video corresponding to the auxiliary channel and the playing progress of the video corresponding to the main channel, and at this time, the second playing time of the video corresponding to the auxiliary channel can be adjusted according to a preset second synchronous adjustment mode.
In an embodiment, the step of adjusting the current playing time of the video corresponding to the secondary channel according to the predetermined second synchronization adjustment manner may include the following two steps B1 and B2:
and step B1, if the second monitored playing time is greater than the first playing time, pausing the playing of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than a second preset time.
If the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than the second preset time length, and the second playing time is greater than the first playing time length, it is indicated that the playing progress of the video corresponding to the current auxiliary channel is faster than the playing progress of the video corresponding to the main channel, and the video monitoring equipment needs to pause playing the video corresponding to the auxiliary channel, that is, the video corresponding to the auxiliary channel enters a waiting state. Specifically, the video monitoring device does not decode the video frame of the video corresponding to the auxiliary channel. In addition, in the process that the video corresponding to the auxiliary channel is in the waiting state, the video monitoring device can acquire the first playing time of the video corresponding to the main channel in real time, and the video monitoring device restarts to play the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time and the pause time of the video corresponding to the auxiliary channel is smaller than a second preset time length.
And step B2, if the second playing time monitored currently is less than the first playing time, the decoding speed of the video corresponding to the auxiliary channel is increased until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than a second preset time.
If the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a second preset time length, and the second playing time is less than the first playing time length, it is indicated that the playing progress of the video corresponding to the current auxiliary channel is slower than the playing progress of the video corresponding to the main channel.
Specifically, the specific implementation manner of the video monitoring device for increasing the playing speed of the video corresponding to the auxiliary channel may be as follows: the video monitoring equipment does not perform frame rate synchronous control in the auxiliary channel, but accelerates the decoding speed of the video corresponding to the auxiliary channel, so as to improve the playing speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than a second preset time. Wherein, the frame rate synchronous control means: and controlling the playing speed of the video corresponding to the auxiliary channel according to the frame rate corresponding to the video corresponding to the auxiliary channel when the video corresponding to the auxiliary channel is recorded.
And S260, controlling the playing speed of the video corresponding to the auxiliary channel according to a target frame rate, wherein the target frame rate is the frame rate corresponding to the video corresponding to the auxiliary channel when the video corresponding to the auxiliary channel is recorded.
If the absolute value of the time difference between the currently monitored first playing time and the second playing time is smaller than the second preset time length, it is indicated that the playing progress of the video corresponding to the auxiliary channel is substantially consistent with the playing progress of the video corresponding to the main channel, that is, the synchronization effect of the video corresponding to the auxiliary channel and the video corresponding to the main channel is better. In this case, the playing speed of the video corresponding to the auxiliary channel may not be adjusted, that is, the playing speed of the video corresponding to the auxiliary channel may be controlled according to the frame rate corresponding to the recording of the video corresponding to the auxiliary channel.
For example, the frame rate corresponding to recording the video corresponding to the secondary channel is 25 frames per second, that is, one frame of image is recorded every 40 milliseconds. If the absolute value of the time difference between the first playing time and the second playing time monitored currently is less than a second preset time, one frame of image can be decoded and output every 40 milliseconds.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved. And if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a second preset time length, the current playing time of the video corresponding to the auxiliary channel is adjusted according to a preset second synchronous adjustment mode, so that the synchronous effect of the videos corresponding to different channels can be further improved.
In a second aspect, an embodiment of the present invention provides a video playing apparatus, as shown in fig. 3, the apparatus includes:
a main channel determining module 310 for determining a main channel of the plurality of channels;
a playing time determining module 320, configured to monitor a first playing time of the video corresponding to the main channel and a second playing time of the video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel;
the first play time adjusting module 330 is configured to adjust the second play time of the video corresponding to the auxiliary channel according to a predetermined first synchronous adjusting manner if the absolute value of the time difference between the currently monitored first play time and the second play time is greater than a first preset time.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved.
Optionally, the play time adjusting module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time;
and if the currently monitored second playing time is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, wherein the absolute value of the time difference between the target playing time and the monitored first playing time is less than the first preset time.
Optionally, the apparatus further comprises:
the time judgment module is used for judging whether the absolute value of the time difference between the currently monitored first playing time and the second playing time is smaller than a first preset time length or not, wherein the second preset time length is smaller than the first preset time length;
and the second playing time adjusting module is used for adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjusting mode if the absolute value of the time difference is greater than the second preset time length.
Optionally, the second play time adjusting module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the second preset time;
and if the currently monitored second playing time is less than the first playing time, improving the decoding speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than the second preset time.
Optionally, the apparatus further comprises:
and the playing speed control module is used for controlling the playing speed of the video corresponding to the auxiliary channel according to a target frame rate if the absolute value of the time difference is smaller than the second preset time length, wherein the target frame rate is the frame rate corresponding to the recording of the video corresponding to the auxiliary channel.
In a third aspect, an embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the video playing method according to the first aspect when executing the program stored in the memory 403.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the video playing method according to the first aspect.
According to the technical scheme provided by the embodiment of the invention, the video monitoring equipment determines the main channel in a plurality of channels in the process of simultaneously playing videos corresponding to different channels; monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode. Therefore, according to the technical scheme provided by the embodiment of the invention, when the first playing time of the video corresponding to the main channel is inconsistent with the second playing time of the video corresponding to the auxiliary channel in the process of simultaneously playing the videos corresponding to different channels, the video monitoring device can adjust the second playing time of the video corresponding to the auxiliary channel in real time, so that the synchronization effect of the videos corresponding to different channels is improved.
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, as for the device, the electronic apparatus, and the storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
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 (12)

1. A video playback method, the method comprising:
determining a primary channel of a plurality of channels;
monitoring a first playing time of a video corresponding to the main channel and a second playing time of a video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel;
and if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time, adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjustment mode.
2. The method according to claim 1, wherein the step of adjusting the second playing time of the video corresponding to the secondary channel according to the predetermined first synchronization adjustment manner comprises:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time;
and if the currently monitored second playing time is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, wherein the absolute value of the time difference between the target playing time and the monitored first playing time is less than the first preset time.
3. The method according to claim 1 or 2, wherein if the absolute value of the time difference between the currently monitored first playing time and the second playing time is less than a first preset time period, the method further comprises:
judging whether the absolute value of the time difference is smaller than a second preset time length, wherein the second preset time length is smaller than the first preset time length;
and if the absolute value of the time difference is greater than the second preset time length, adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjustment mode.
4. The method according to claim 3, wherein the step of adjusting the current playing time of the video corresponding to the secondary channel according to the predetermined second synchronization adjustment manner comprises:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the second preset time;
and if the currently monitored second playing time is less than the first playing time, improving the decoding speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than the second preset time.
5. The method of claim 3, wherein if the absolute value of the time difference is less than the second predetermined duration, the method further comprises:
and controlling the playing speed of the video corresponding to the auxiliary channel according to a target frame rate, wherein the target frame rate is the frame rate corresponding to the video corresponding to the auxiliary channel when the video corresponding to the auxiliary channel is recorded.
6. A video playback apparatus, comprising:
a main channel determination module for determining a main channel of the plurality of channels;
the playing time determining module is used for monitoring a first playing time of the video corresponding to the main channel and a second playing time of the video corresponding to the auxiliary channel; the auxiliary channel is a channel of the plurality of channels except the main channel;
and the first playing time adjusting module is used for adjusting the second playing time of the video corresponding to the auxiliary channel according to a preset first synchronous adjusting mode if the absolute value of the time difference between the currently monitored first playing time and the second playing time is greater than a first preset time length.
7. The apparatus of claim 6, wherein the play time adjustment module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the first preset time;
and if the currently monitored second playing time is less than the first playing time, adjusting the second playing time of the video corresponding to the auxiliary channel to a target playing time, wherein the absolute value of the time difference between the target playing time and the monitored first playing time is less than the first preset time.
8. The apparatus of claim 6 or 7, further comprising:
the time judgment module is used for judging whether the absolute value of the time difference between the currently monitored first playing time and the second playing time is smaller than a first preset time length or not, wherein the second preset time length is smaller than the first preset time length;
and the second playing time adjusting module is used for adjusting the current playing time of the video corresponding to the auxiliary channel according to a preset second synchronous adjusting mode if the absolute value of the time difference is greater than the second preset time length.
9. The apparatus of claim 8, wherein the second play time adjustment module is specifically configured to:
if the second monitored playing time is greater than the first playing time, pausing playing the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the pausing time of the video corresponding to the auxiliary channel is less than the second preset time;
and if the currently monitored second playing time is less than the first playing time, improving the decoding speed of the video corresponding to the auxiliary channel until the absolute value of the time difference between the first playing time of the video corresponding to the monitored main channel and the second playing time of the video corresponding to the auxiliary channel is less than the second preset time.
10. The apparatus of claim 8, further comprising:
and the play speed control module is used for controlling the play speed of the video corresponding to the auxiliary channel according to a target frame rate if the absolute value of the time difference is smaller than the second preset time length, wherein the target frame rate is the frame rate corresponding to the video corresponding to the auxiliary channel when the video corresponding to the auxiliary channel is recorded.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN201910165346.XA 2019-03-05 2019-03-05 Video playing method and device and electronic equipment Pending CN111669539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910165346.XA CN111669539A (en) 2019-03-05 2019-03-05 Video playing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910165346.XA CN111669539A (en) 2019-03-05 2019-03-05 Video playing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111669539A true CN111669539A (en) 2020-09-15

Family

ID=72381736

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910165346.XA Pending CN111669539A (en) 2019-03-05 2019-03-05 Video playing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111669539A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866309A (en) * 2022-11-29 2023-03-28 广州后为科技有限公司 Audio and video caching method and device supporting multi-channel video synchronization

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959071A (en) * 2010-06-02 2011-01-26 杭州海康威视数字技术股份有限公司 Synchronous decoding method and device
CN103957344A (en) * 2014-04-28 2014-07-30 广州杰赛科技股份有限公司 Video synchronization method and system for multiple camera devices
CN104410807A (en) * 2014-11-24 2015-03-11 深圳市华宝电子科技有限公司 Method and device for synchronously replaying multi-channel video
EP2849451A1 (en) * 2013-09-13 2015-03-18 Samsung Electronics Co., Ltd A/V receiving apparatus and method for delaying output of audio signal and A/V signal processing system
CN108600814A (en) * 2018-04-08 2018-09-28 浙江大华技术股份有限公司 A kind of audio video synchronization playback method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101959071A (en) * 2010-06-02 2011-01-26 杭州海康威视数字技术股份有限公司 Synchronous decoding method and device
EP2849451A1 (en) * 2013-09-13 2015-03-18 Samsung Electronics Co., Ltd A/V receiving apparatus and method for delaying output of audio signal and A/V signal processing system
CN103957344A (en) * 2014-04-28 2014-07-30 广州杰赛科技股份有限公司 Video synchronization method and system for multiple camera devices
CN104410807A (en) * 2014-11-24 2015-03-11 深圳市华宝电子科技有限公司 Method and device for synchronously replaying multi-channel video
CN108600814A (en) * 2018-04-08 2018-09-28 浙江大华技术股份有限公司 A kind of audio video synchronization playback method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866309A (en) * 2022-11-29 2023-03-28 广州后为科技有限公司 Audio and video caching method and device supporting multi-channel video synchronization
CN115866309B (en) * 2022-11-29 2023-09-22 广州后为科技有限公司 Audio and video caching method and device supporting multipath video synchronization

Similar Documents

Publication Publication Date Title
CN107948735B (en) Video playing method and device and electronic equipment
US20230144483A1 (en) Method for encoding video data, device, and storage medium
EP3193509B1 (en) Video advertisement filtering method, device and equipment
CN103763618A (en) Definition switching method and electronic device
CN109218847B (en) Download control method and device and multimedia terminal
CN109714622B (en) Video data processing method and device and electronic equipment
CN108174280B (en) Audio and video online playing method and system
CN108989832B (en) Image data processing method and equipment, storage medium and terminal thereof
CN107835200B (en) Video definition selection method and device and electronic equipment
US10389785B2 (en) Method for adaptively streaming an audio/visual material
US10021433B1 (en) Video-production system with social-media features
WO2017101393A1 (en) Method and device for continuously playing video
WO2017107737A1 (en) Method, apparatus and device for adjusting screen turn-off time of terminal, and computer storage media
CN111182352B (en) Adaptive code stream control device and method for video playing
US20150134846A1 (en) Method and apparatus for media segment request retry control
CN104080006A (en) Video processing device and method
CN108259998B (en) Player, play control method and device, electronic equipment and play system
CN105898625B (en) Playing processing method and terminal equipment
CN106331820B (en) Audio and video synchronization processing method and device
CN104053002A (en) Video decoding method and device
CN116527977A (en) Sound and picture synchronization method and device, electronic equipment and readable storage medium
CN111541927A (en) Video playing method and device
CN111669539A (en) Video playing method and device and electronic equipment
CN113766261A (en) Method and device for determining pre-pulling duration, electronic equipment and storage medium
CN109005455B (en) Video data processing method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200915

RJ01 Rejection of invention patent application after publication