CN108259805B - Multi-channel video decoding method, playing method and device and automobile data recorder - Google Patents

Multi-channel video decoding method, playing method and device and automobile data recorder Download PDF

Info

Publication number
CN108259805B
CN108259805B CN201810296808.7A CN201810296808A CN108259805B CN 108259805 B CN108259805 B CN 108259805B CN 201810296808 A CN201810296808 A CN 201810296808A CN 108259805 B CN108259805 B CN 108259805B
Authority
CN
China
Prior art keywords
video frame
timestamp
channel
video
reference timestamp
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
CN201810296808.7A
Other languages
Chinese (zh)
Other versions
CN108259805A (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.)
SHENZHEN HUABAO ELECTRONIC TECHNOLOGY CO LTD
Original Assignee
SHENZHEN HUABAO ELECTRONIC 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 SHENZHEN HUABAO ELECTRONIC TECHNOLOGY CO LTD filed Critical SHENZHEN HUABAO ELECTRONIC TECHNOLOGY CO LTD
Priority to CN201810296808.7A priority Critical patent/CN108259805B/en
Publication of CN108259805A publication Critical patent/CN108259805A/en
Application granted granted Critical
Publication of CN108259805B publication Critical patent/CN108259805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/93Regeneration of the television signal or of selected parts thereof
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0841Registering performance data
    • G07C5/085Registering performance data using electronic data carriers
    • G07C5/0866Registering performance data using electronic data carriers the electronic data carrier being a digital video recorder in combination with video camera

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention discloses a method for decoding multi-channel videos, a method for playing multi-channel videos, a device and a vehicle event data recorder. The method comprises the following steps: acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel; if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel; and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again. It is possible to prevent frame skipping caused by too early feeding into the decoder or delay caused by too late feeding into the decoder, thereby improving the quality of video playback.

Description

Multi-channel video decoding method, playing method and device and automobile data recorder
Technical Field
The embodiment of the invention relates to the technical field of mobile video monitoring, in particular to a multi-channel video decoding method, a multi-channel video playing device and a vehicle event data recorder.
Background
With the rapid development of the automobile industry, automobiles have become an indispensable tool for people to travel outside. The automobile data recorder is an instrument for recording related information such as images and sounds in the driving process of a vehicle, can record video images and sounds in the whole driving process of the vehicle, record and replay monitoring videos, and can provide evidence for accidents such as traffic accidents, so that the automobile data recorder is widely installed in the vehicle for use.
When the automobile data recorder comprises a plurality of cameras, the video images recorded by the cameras form multi-channel video data. The existing automobile data recorder often has the problems of time delay, frame skipping, asynchronous playback and the like when playing back multi-channel video, and the playback quality is influenced, so that the problems of the automobile data recorder during video playback are overcome.
Disclosure of Invention
The embodiment of the invention provides a method for decoding a plurality of paths of videos, a method and a device for playing the videos and a vehicle event data recorder, and aims to improve the quality of video playback.
In a first aspect, an embodiment of the present invention provides a method for multi-channel video decoding, where the method includes:
acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel;
if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again.
Further, after acquiring the video frame, the video frame timestamp and the system timestamp of the multiple channels, the method further includes:
and acquiring the minimum value of the video frame time stamps of the multi-channel, and determining the minimum value as the video frame reference time stamp.
Further, the obtaining the system time stamp of the multipath channel includes:
and acquiring the system time stamp through a system time interface function while acquiring the current video frame time stamp of the multi-channel.
Further, acquiring a new video frame reference timestamp and a new system reference timestamp, comprising:
and acquiring the minimum value of the video frame time stamps of the video frames to be decoded in the multi-channel, determining the minimum value as a new video frame reference time stamp, acquiring the current system time, and determining the current system time as the new system reference time.
In a second aspect, an embodiment of the present invention further provides a method for playing multiple channels of videos, where the method includes:
acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel;
if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously;
playing the decoded video frame;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again.
In a third aspect, an embodiment of the present invention further provides an apparatus for decoding multiple channels of video, including:
the multi-channel video frame acquisition module is used for acquiring video frames, video frame timestamps and system timestamps of a multi-channel;
a sending decoder module, configured to send a video frame to a decoder and continue to acquire a next video frame of a channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp and the system reference timestamp are acquired at the same time;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, the new video frame reference timestamp and the new system reference timestamp are acquired until all the channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are acquired again.
Further, still include:
and the video frame reference timestamp determining module is used for acquiring the minimum value of the video frame timestamps of the multi-channel and determining the minimum value as the video frame reference timestamp.
Further, the multi-channel video frame acquisition module is further configured to:
and acquiring the system time stamp through a system time interface function while acquiring the current video frame time stamp of the multi-channel.
In a fourth aspect, an embodiment of the present invention further provides a device for playing multiple channels of videos, including:
the video frame acquisition module is used for acquiring video frames, video frame timestamps and system timestamps of the multi-channel;
a sending decoder module, configured to send a video frame to a decoder and continue to acquire a next video frame of a channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp and the system reference timestamp are acquired at the same time;
the video frame playing module is used for playing the decoded video frame;
and the new video frame reference timestamp acquisition module is used for entering a waiting state if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is greater than the difference value between the system timestamp and the system reference timestamp, acquiring the new video frame reference timestamp and the new system reference timestamp until all the channels enter the waiting state, and acquiring the video frames, the video frame timestamps and the system timestamps of the multi-channel again.
In a fifth aspect, an embodiment of the present invention further provides a driving recorder, including the apparatus for decoding multiple videos in the third aspect and the apparatus for playing multiple videos in the fourth aspect.
In a sixth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for decoding multiple videos according to the first aspect or the method for playing multiple videos according to the second aspect.
The method for decoding the multi-channel video, provided by the embodiment of the invention, comprises the steps of obtaining video frames, video frame timestamps and system timestamps of a multi-channel; if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously; and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again. By comparing the difference value between the video frame timestamp and the video frame reference timestamp with the difference value between the system timestamp and the system reference timestamp, whether the video frame is sent to a decoder for decoding or not is determined, and frame skipping caused by too early sending of the video frame to the decoder or delay caused by too late sending of the video frame to the decoder can be prevented, so that the video playback quality is improved.
Drawings
Fig. 1 is a flowchart of a method for multi-channel video decoding according to a first embodiment of the present invention;
fig. 2 is a flowchart of a method for playing multiple channels of video according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for multi-channel video decoding according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus for playing multiple channels of video according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an automobile data recorder in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
In the related art, when a multi-channel video is played back, a video timestamp of a certain channel is randomly selected as a reference, and when the reference video timestamp is wrong, problems of pause, delay, frame skipping and the like in playback can be caused. In order to solve the above-described problems occurring in the related art, the present application proposes the following solutions.
Example one
Fig. 1 is a flowchart of a multi-channel video decoding method according to an embodiment of the present invention, where the embodiment is applicable to a case where video frames are decoded during video playback, and the method can be executed by a multi-channel video decoding apparatus, which can be integrated in a video device, such as a car recorder. As shown in fig. 1, the method includes the following steps.
Step 110, obtaining video frames, video frame time stamps and system time stamps of the multiple channels.
The multiple channels may be multiple video channels formed by shooting with multiple cameras. A video frame may be a frame-by-frame video picture that makes up a video recording. The video frame timestamp may be a timestamp that is used to mark a video frame when a video is captured, and in this embodiment, the format of the video frame timestamp may be a corresponding system time when the video frame is captured, for example, when a certain video frame is captured, the system time is 2016, 12, month, 5, day, 11, 8 minutes, and 6 seconds, the video frame timestamp of the video frame may be marked as 2016, 12, month, 5, day, 11, 8 minutes, and 6 seconds; or the video frame timestamp is marked by the total number of seconds from Greenwich mean time to when the video frame is shot, and the video frame timestamp can mark the time of a certain moment. The system timestamp may be a currently set time of the system, and in this embodiment, the system timestamp may be obtained when the video frame timestamp is obtained.
In this embodiment, when a user plays back a multi-channel video recording within a certain time period, first, a video frame timestamp, and a system timestamp of a multi-channel captured within the time period are obtained. Illustratively, assuming that a user wants to play back a video recording between 12 hours 0 minutes 0 seconds at 3/10/2017 and 30 minutes 0 seconds at 12 hours 10/3/2017, multiple video frames, video frame timestamps and system timestamps captured by multiple cameras during the period are acquired.
Step 120, determining whether the difference between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference between the system timestamp and the system reference timestamp. If yes, go to step 130, otherwise go to step 140.
Optionally, after acquiring the video frame, the video frame timestamp, and the system timestamp of the multiple channels, the method further includes: and acquiring the minimum value of the video frame time stamps of the multi-channel, and determining the minimum value as the video frame reference time stamp.
Wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously. The video frame reference timestamp may be the minimum of the video frame timestamps of the video frames participating in playback. The system reference timestamp may be a current system time obtained through a system time interface function while the video frame reference timestamp is obtained.
Specifically, for each video channel in the multiple channels, before decoding a video frame of the channel, a video frame timestamp of the video frame is first acquired, a current system timestamp is acquired, a difference value between the video frame timestamp of the channel and a video frame reference timestamp and a difference value between the system timestamp and the system reference timestamp are calculated, and then whether the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp is judged.
Optionally, the system time stamp may be obtained through a system time interface function while obtaining the time stamp of the current video frame of the multiple channels.
Step 130, if the difference between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuing to acquire the next video frame of the channel.
In this embodiment, when the difference between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference between the system timestamp and the system reference timestamp, it may be indicated that the previous video frame of the channel has been decoded, and at this time, the video frame may be sent to a decoder for decoding, and meanwhile, the next frame of video of the channel is continuously obtained. After the previous video frame is decoded, the video frame is sent to a decoder, so that the condition of frame skipping in the decoding process can be prevented.
Step 140, if the difference between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference between the system timestamp and the system reference timestamp, the channel enters a waiting state, until all channels enter the waiting state, a new video frame reference timestamp and a new system reference timestamp are acquired, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are acquired again.
In this embodiment, when the difference between the video frame timestamp of the channel and the video frame reference timestamp is greater than the difference between the system timestamp and the system reference timestamp, the channel enters a waiting state. After the channel enters the waiting state, the states of other channels have two situations, one is that other channels do not enter the waiting state, and the other is that other channels enter the waiting state. When other channels do not enter the waiting state, the decoding device acquires the system time stamp before decoding the video frame which does not enter the waiting state channel and when acquiring the video frame time stamp, at the moment, the difference value between the system time stamp and the system reference time stamp is recalculated until the difference value between the video frame time stamp which enters the waiting state channel and the video frame reference time stamp is less than or equal to the difference value between the system time stamp and the system reference time stamp, the video frame to be decoded which enters the waiting state channel is sent to the decoder, and then the channel enters the decoding state again from the waiting state.
And when all channels enter a waiting state, acquiring a new video frame reference timestamp and a new system reference timestamp, and acquiring the video frame, the video frame timestamp and the system timestamp of the multi-channel again, and decoding the video frame according to the steps. Illustratively, it is assumed that the time period of video recording participating in playback is from 0 min 0 s at 12 o ' clock 10 m at 2017 to 12 min 30 s at 3 o ' clock 10 m at 2017, and all channels in the time period have no video data between 10 min 0 s at 10 o ' clock 10 m 12 o ' clock 10 m at 2017 and 20 min 0 s at 2017, 3 o ' clock 10 m 12 o ' clock 12 m at 2017, and when decoding is to 10 min 0 s at 12 o ' clock 10 m at 2017, all channels will enter a waiting state, at which time a new video frame reference timestamp and a new system reference timestamp are acquired, and video frames, video frame timestamps and system timestamps of multiple channels are acquired again, and video frames are decoded in the same manner as above. If the new video frame reference timestamp and the new system reference timestamp are not obtained, the next video frame is decoded after the system time goes 10 minutes, which wastes time.
Optionally, the manner of obtaining the reference timestamp of the new video frame and the reference timestamp of the new system may be: and acquiring the minimum value of the video frame time stamps of the video frames to be decoded in the multi-channel, determining the minimum value as a new video frame reference time stamp, acquiring the current system time, and determining the current system time as the new system reference time.
According to the technical scheme of the embodiment, video frames, video frame timestamps and system timestamps of a plurality of channels are obtained; if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously; and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again. By comparing the difference value between the video frame timestamp and the video frame reference timestamp with the difference value between the system timestamp and the system reference timestamp, whether the video frame is sent to a decoder for decoding or not is determined, and frame skipping caused by too early sending of the video frame to the decoder or delay caused by too late sending of the video frame to the decoder can be prevented, so that the video playback quality is improved.
Example two
Fig. 2 is a flowchart of a method for playing multiple channels of video according to a second embodiment of the present invention. The embodiment is applicable to the case of playing video frames during video playback, and the method can be executed by a device for multi-path video playing, and the device can be integrated in video equipment, such as a driving recorder and the like. As shown in fig. 2, the method includes the following steps.
Step 210, obtaining video frames, video frame time stamps and system time stamps of the multiple channels.
The multiple channels may be multiple video channels formed by shooting with multiple cameras. A video frame may be a frame-by-frame video picture that makes up a video recording. The video frame timestamp may be a timestamp that marks a video frame when the video is captured, and the format of the video frame timestamp may be a corresponding system time when the video frame is captured, or may be a timestamp that marks a video frame in the total number of seconds from greenwich mean time to when the video frame is captured, and the video frame timestamp may mark a time at a certain time. The system timestamp may be a currently set time of the system, and in this embodiment, the system timestamp may be obtained when the video frame timestamp is obtained.
Step 220, determine whether the difference between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference between the system timestamp and the system reference timestamp. If yes, go to step 230, otherwise go to step 250.
Optionally, after acquiring the video frame, the video frame timestamp, and the system timestamp of the multiple channels, the method further includes: and acquiring the minimum value of the video frame time stamps of the multi-channel, and determining the minimum value as the video frame reference time stamp.
Wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously. The video frame reference timestamp may be the minimum of the video frame timestamps of the video frames participating in playback. The system reference timestamp may be a current system time obtained through a system time interface function while the video frame reference timestamp is obtained.
Alternatively, the video time stamp may be obtained through a system time interface function while obtaining the time stamp of the current video frame of the multiple channels.
And step 230, if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously.
In this embodiment, when the difference between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference between the system timestamp and the system reference timestamp, it may be indicated that the previous video frame of the channel has been decoded, and at this time, the video frame may be sent to a decoder for decoding, and meanwhile, the next frame of video of the channel is continuously obtained. After the previous video frame is decoded, the video frame is sent to a decoder, so that the condition of frame skipping in the decoding process can be prevented.
And step 240, playing the decoded video frame.
And when the video frame is decoded, playing the video frame. In this embodiment, when playing back a video recording, the video recording is played while being decoded, and the video recording is played after decoding one frame.
And step 250, if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are acquired until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are acquired again.
The steps in this embodiment are the same as the method steps in the first embodiment, and are not described herein again.
According to the technical scheme of the embodiment, video frames, video frame time stamps and system time stamps of multiple channels are taken; if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously; playing the decoded video frame; and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again. By comparing the difference value between the video frame timestamp and the video frame reference timestamp with the difference value between the system timestamp and the system reference timestamp, whether the video frame is sent into a decoder for decoding is determined, the decoded video frame is played, and therefore frame skipping caused by too early sending into the decoder can be prevented, or time delay caused by too late sending into the decoder can be prevented, and the quality of video playback is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an apparatus for decoding multiple channels of video according to a third embodiment of the present invention, as shown in fig. 3, the apparatus includes: the multi-channel video frame obtaining module 310 sends the video frames to the decoder module 320 and the new video frame reference time obtaining module 330.
A multi-channel video frame acquiring module 310, configured to acquire a video frame, a video frame timestamp, and a system timestamp of a multi-channel;
a sending decoder module 320, configured to send the video frame to a decoder and continue to acquire a next video frame of the channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp and the system reference timestamp are acquired at the same time;
the new video frame reference time obtaining module 330, if the difference between the video frame timestamp of the channel and the video frame reference timestamp is greater than the difference between the system timestamp and the system reference timestamp, the channel enters a waiting state, and after all channels enter the waiting state, obtains the new video frame reference timestamp and the new system reference timestamp, and obtains the video frame, the video frame timestamp, and the system timestamp of the multi-channel again.
Optionally, the method further includes:
and the video frame reference timestamp determining module is used for acquiring the minimum value of the video frame timestamps of the multi-channel and determining the minimum value as the video frame reference timestamp.
The multi-channel video frame obtaining module 310 is further configured to:
and acquiring the system time stamp through a system time interface function while acquiring the current video frame time stamp of the multi-channel.
Optionally, the new video frame reference time obtaining module 330 is further configured to:
and acquiring the minimum value of the video frame time stamps of the video frames to be decoded in the multi-channel, determining the minimum value as a new video frame reference time stamp, acquiring the current system time, and determining the current system time as the new system reference time.
Example four
Fig. 4 is a schematic structural diagram of a device for playing multiple channels of video according to a fourth embodiment of the present invention, as shown in fig. 4, the device includes: the video frame acquiring module 410 is fed to the decoder module 420, the video frame playing module 430 and the new video frame reference time acquiring module 440.
A video frame acquiring module 410, configured to acquire a video frame, a video frame timestamp, and a system timestamp of the multiple channels;
a sending-to-decoder module 420, configured to send the video frame to a decoder and continue to acquire a next video frame of the channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp and the system reference timestamp are acquired at the same time;
a video frame playing module 430, configured to play the decoded video frame;
a new video frame reference timestamp obtaining module 440, configured to, if the difference between the video frame timestamp of the channel and the video frame reference timestamp is greater than the difference between the system timestamp and the system reference timestamp, enable the channel to enter a waiting state, obtain the new video frame reference timestamp and the new system reference timestamp until all channels enter the waiting state, and obtain the video frame, the video frame timestamp, and the system timestamp of the multiple channel again.
The device can execute the methods provided by all the embodiments of the invention, and has corresponding functional modules and beneficial effects for executing the methods. For details not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present invention.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a car event data recorder provided in an embodiment of the present invention. As shown in fig. 5, the forming recorder includes a plurality of cameras, a multi-channel video decoding device 510, and a multi-channel video playing device 520.
The apparatus 510 for multi-channel video decoding is configured to perform the following steps: acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel; if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp and the system reference timestamp are acquired simultaneously; and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again. The multi-channel video playing device 520 is configured to play the decoded video frames.
EXAMPLE six
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for multi-channel video decoding, comprising:
acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel; the system timestamp is the currently set time of the system acquired when the video frame timestamp is acquired;
if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp is the minimum value of the video frame timestamps of the multipath channel, and the system reference timestamp is the current system time acquired through a system time interface function while the video frame reference timestamp is acquired;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again.
2. The method of claim 1, after obtaining the video frames, the video frame time stamps and the system time stamps for the multiple channels, further comprising:
and acquiring the minimum value of the video frame time stamps of the multi-channel, and determining the minimum value as the video frame reference time stamp.
3. The method of claim 1, wherein obtaining the system time stamp for the multipath channel comprises:
and acquiring the system time stamp through a system time interface function while acquiring the current video frame time stamp of the multi-channel.
4. The method of claim 1, wherein obtaining a new video frame reference timestamp and a new system reference timestamp comprises:
and acquiring the minimum value of the video frame time stamps of the video frames to be decoded in the multi-channel, determining the minimum value as a new video frame reference time stamp, acquiring the current system time, and determining the current system time as the new system reference time.
5. A method for multi-channel video playback, comprising:
acquiring a video frame, a video frame timestamp and a system timestamp of a multi-channel; the system timestamp is the currently set time of the system acquired when the video frame timestamp is acquired;
if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is less than or equal to the difference value between the system timestamp and the system reference timestamp, sending the video frame to a decoder, and continuously acquiring the next video frame of the channel, wherein the video frame reference timestamp is the minimum value of the video frame timestamps of the multipath channel, and the system reference timestamp is the current system time acquired through a system time interface function while the video frame reference timestamp is acquired;
playing the decoded video frame;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, a new video frame reference timestamp and a new system reference timestamp are obtained until all channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are obtained again.
6. An apparatus for multi-channel video decoding, comprising:
the multi-channel video frame acquisition module is used for acquiring video frames, video frame timestamps and system timestamps of a multi-channel; the system timestamp is the currently set time of the system acquired when the video frame timestamp is acquired;
a sending decoder module, configured to send a video frame to a decoder and continue to acquire a next video frame of a channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp is a minimum value of video frame timestamps of a multi-channel, and the system reference timestamp is a current system time acquired through a system time interface function while the video frame reference timestamp is acquired;
and if the difference value between the video frame timestamp and the video frame reference timestamp of the channel is greater than the difference value between the system timestamp and the system reference timestamp, the channel enters a waiting state, the new video frame reference timestamp and the new system reference timestamp are acquired until all the channels enter the waiting state, and the video frame, the video frame timestamp and the system timestamp of the multi-channel are acquired again.
7. The apparatus of claim 6, further comprising:
and the video frame reference timestamp determining module is used for acquiring the minimum value of the video frame timestamps of the multi-channel and determining the minimum value as the video frame reference timestamp.
8. An apparatus for multiple video playback, comprising:
the video frame acquisition module is used for acquiring video frames, video frame timestamps and system timestamps of the multi-channel; the system timestamp is the currently set time of the system acquired when the video frame timestamp is acquired;
a sending decoder module, configured to send a video frame to a decoder and continue to acquire a next video frame of a channel if a difference between a video frame timestamp of the channel and a video frame reference timestamp is less than or equal to a difference between a system timestamp and the system reference timestamp, where the video frame reference timestamp is a minimum value of video frame timestamps of a multi-channel, and the system reference timestamp is a current system time acquired through a system time interface function while the video frame reference timestamp is acquired;
the video frame playing module is used for playing the decoded video frame;
and the new video frame reference timestamp acquisition module is used for entering a waiting state if the difference value between the video frame timestamp of the channel and the video frame reference timestamp is greater than the difference value between the system timestamp and the system reference timestamp, acquiring the new video frame reference timestamp and the new system reference timestamp until all the channels enter the waiting state, and acquiring the video frames, the video frame timestamps and the system timestamps of the multi-channel again.
9. A car recorder comprising the apparatus for decoding multiple videos of any one of claims 6 to 7 and the apparatus for playing multiple videos of claim 8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for multi-channel video decoding according to any one of claims 1 to 4 or a method for multi-channel video playback according to claim 5.
CN201810296808.7A 2018-03-30 2018-03-30 Multi-channel video decoding method, playing method and device and automobile data recorder Active CN108259805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810296808.7A CN108259805B (en) 2018-03-30 2018-03-30 Multi-channel video decoding method, playing method and device and automobile data recorder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810296808.7A CN108259805B (en) 2018-03-30 2018-03-30 Multi-channel video decoding method, playing method and device and automobile data recorder

Publications (2)

Publication Number Publication Date
CN108259805A CN108259805A (en) 2018-07-06
CN108259805B true CN108259805B (en) 2020-11-10

Family

ID=62748073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810296808.7A Active CN108259805B (en) 2018-03-30 2018-03-30 Multi-channel video decoding method, playing method and device and automobile data recorder

Country Status (1)

Country Link
CN (1) CN108259805B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109788224B (en) 2019-03-26 2020-12-04 歌尔科技有限公司 Video recording method, video recording device, network camera and storage medium
CN110139117B (en) * 2019-05-17 2022-06-21 歌尔科技有限公司 Live broadcast data pushing method and device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1554188A (en) * 2001-10-31 2004-12-08 松下移动通信株式会社 Time stamp value controller
CN101959071A (en) * 2010-06-02 2011-01-26 杭州海康威视数字技术股份有限公司 Synchronous decoding method and device
CN103209042A (en) * 2012-01-12 2013-07-17 横河电机株式会社 Time synchronization system
CN103702013A (en) * 2013-11-28 2014-04-02 北京航空航天大学 Frame synchronization method for multiple channels of real-time videos
CN104270567A (en) * 2014-09-11 2015-01-07 深圳市南航电子工业有限公司 High-precision synchronous multi-channel image acquisition system and time synchronization method thereof
CN104410807A (en) * 2014-11-24 2015-03-11 深圳市华宝电子科技有限公司 Method and device for synchronously replaying multi-channel video
CN104618673A (en) * 2015-01-20 2015-05-13 武汉烽火众智数字技术有限责任公司 NVR (Network Video Recorder)-based multi-channel video synchronous playback control method and device
CN105657578A (en) * 2015-10-29 2016-06-08 乐视致新电子科技(天津)有限公司 Live broadcast method, system and client based on HLS protocol
CN106851044A (en) * 2016-12-13 2017-06-13 深圳英飞拓科技股份有限公司 A kind of audio video synchronization back method and device
CN107509100A (en) * 2017-09-15 2017-12-22 深圳国微技术有限公司 Audio and video synchronization method, system, computer installation and computer-readable recording medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9578595B2 (en) * 2013-06-24 2017-02-21 Broadcom Corporation Parallel scanning of wireless channels

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1554188A (en) * 2001-10-31 2004-12-08 松下移动通信株式会社 Time stamp value controller
CN101959071A (en) * 2010-06-02 2011-01-26 杭州海康威视数字技术股份有限公司 Synchronous decoding method and device
CN103209042A (en) * 2012-01-12 2013-07-17 横河电机株式会社 Time synchronization system
CN103702013A (en) * 2013-11-28 2014-04-02 北京航空航天大学 Frame synchronization method for multiple channels of real-time videos
CN104270567A (en) * 2014-09-11 2015-01-07 深圳市南航电子工业有限公司 High-precision synchronous multi-channel image acquisition system and time synchronization method thereof
CN104410807A (en) * 2014-11-24 2015-03-11 深圳市华宝电子科技有限公司 Method and device for synchronously replaying multi-channel video
CN104618673A (en) * 2015-01-20 2015-05-13 武汉烽火众智数字技术有限责任公司 NVR (Network Video Recorder)-based multi-channel video synchronous playback control method and device
CN105657578A (en) * 2015-10-29 2016-06-08 乐视致新电子科技(天津)有限公司 Live broadcast method, system and client based on HLS protocol
CN106851044A (en) * 2016-12-13 2017-06-13 深圳英飞拓科技股份有限公司 A kind of audio video synchronization back method and device
CN107509100A (en) * 2017-09-15 2017-12-22 深圳国微技术有限公司 Audio and video synchronization method, system, computer installation and computer-readable recording medium

Also Published As

Publication number Publication date
CN108259805A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN101635848B (en) Method and device for editing video file
US8249419B2 (en) Method for generating additional information for guaranteeing seamless playback between data streams, recording medium storing the information, and recording, editing and/or playback apparatus using the same
US20080115171A1 (en) Detecting Interruptions in Scheduled Programs
CN101300834A (en) Apparatus and method for recording digital video
US8010363B2 (en) Commercial detection apparatus and video playback apparatus
JPH10224722A (en) Commercial scene detector and its detection method
US10129592B2 (en) Audience measurement and feedback system
CN108259805B (en) Multi-channel video decoding method, playing method and device and automobile data recorder
US20080025690A1 (en) Recording/Reproducing Device
JP2005236527A (en) Video playback device, reproduced script generating device, video distributing device, video cutting-out device, and video storage device
CN108366233B (en) Network camera connecting method, device, equipment and storage medium
CN101141584A (en) Recording/reproduction apparatus, display control method, and program
US20060222327A1 (en) Reserved program recording apparatus and its method
CN101345068A (en) Multimedia document recording, locating and playing method and device
EP0997908A1 (en) Data processing system, recording/reproducing device, data processing method, and file management method
EP2101499B1 (en) Broadcast station device and recording/reproduction device
KR101051063B1 (en) Video recording and playback device, video recording method, video playback method and video recording playback method
JP3529679B2 (en) Recording / playback device
JP5095105B2 (en) Method for performing preprogramming recording and apparatus for reading from and writing to a recording medium using the method
EP2685456A1 (en) Index with offset to closest I-picture entry for random access in a bitstream.
JP2005197839A (en) Special reproduction method of transport stream and recording and reproducing apparatus for transport stream
JP5560999B2 (en) Video / audio recording / reproducing apparatus and video / audio recording / reproducing method
US20030059203A1 (en) Apparatus and method for recording and reproducing a digital brodcast
CN112511891A (en) Recording file processing method, device, equipment and medium
CN101146202A (en) Image data processing device, method, program and recording 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