[go: up one dir, main page]

CN103974014B - A kind of video falls back playback method and device - Google Patents

A kind of video falls back playback method and device Download PDF

Info

Publication number
CN103974014B
CN103974014B CN201410191854.2A CN201410191854A CN103974014B CN 103974014 B CN103974014 B CN 103974014B CN 201410191854 A CN201410191854 A CN 201410191854A CN 103974014 B CN103974014 B CN 103974014B
Authority
CN
China
Prior art keywords
data
video
playback
frame
video storage
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
CN201410191854.2A
Other languages
Chinese (zh)
Other versions
CN103974014A (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201410191854.2A priority Critical patent/CN103974014B/en
Publication of CN103974014A publication Critical patent/CN103974014A/en
Application granted granted Critical
Publication of CN103974014B publication Critical patent/CN103974014B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

本发明提供一种视频倒退回放方法及装置,该方法包括:接收视频倒退回放指令,检索出对应视频存储区域,对应视频存储区域包括至少一个分组,且每个分组包括n个I帧数据;根据所述视频倒退回放指令,按照分组间的逆向顺序,分别对于每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。本发明每次抽取一组I帧数据,使得在回放过程中,录像存储设备硬盘盘片旋转次数减少,数据读取速度提高,从而缓解了硬盘的压力以及损伤,提高了倒退性能。

The present invention provides a video rewind playback method and device, the method comprising: receiving a video rewind playback instruction, retrieving the corresponding video storage area, the corresponding video storage area includes at least one group, and each group includes n I frame data; according to The video rewinding playback instruction, according to the reverse order between the groups, performs the following operations for each group respectively: extract n I frame data in the grouping in the corresponding video storage area in forward order and put them into the playback buffer space, and reverse frame capture in the playback buffer space, and send it to the video playback device for playback. The present invention extracts a group of I-frame data each time, so that during the playback process, the number of rotations of the hard disk of the video storage device is reduced, and the data reading speed is increased, thereby alleviating the pressure and damage of the hard disk, and improving the backward performance.

Description

一种视频倒退回放方法及装置A video reverse playback method and device

技术领域technical field

本发明涉及视频监控技术领域,特别涉及一种视频倒退回放方法及装置。The present invention relates to the technical field of video monitoring, in particular to a method and device for reversing video playback.

背景技术Background technique

视频监控技术由于其真实性、可靠性、广泛性等优点在安防、交通、金融、教育等各行各业得到了广泛的应用和迅速的发展。视频监控的数字化的视频数据除了用于实时监控,还可以先存储起来,供后续回放。Due to its authenticity, reliability, and universality, video surveillance technology has been widely used and developed rapidly in various industries such as security, transportation, finance, and education. In addition to being used for real-time monitoring, the digitized video data of video surveillance can also be stored first for subsequent playback.

现有技术对视频数据进行回放的方法包括:点播回放模块向存储设备抽取I帧数据,每次抽取1个数据。例如,如图1所示,磁头保持不动,录像存储设备硬盘盘片以顺时针进行匀速转动,数据以数据1→数据2→数据3→数据4的顺序写入录像存储设备硬盘,在进行倒退回放时的读取顺序为数据4→数据3→数据2→数据1。The method for playing back video data in the prior art includes: the on-demand playback module extracts one frame of data from the storage device, and extracts one piece of data each time. For example, as shown in Figure 1, the magnetic head remains still, the hard disk of the video storage device rotates at a constant speed clockwise, and the data is written into the hard disk of the video storage device in the order of data 1→data 2→data 3→data 4. The reading sequence during reverse playback is data 4→data 3→data 2→data 1.

然而,由于录像存储设备硬盘盘片的转动方向不变,一直为顺时针转动,因此,在倒退回放时,先抽取数据4并进行播放,然后需要录像存储设备硬盘盘片转动一周,数据3到达磁头的位置,抽取数据3并播放,然后录像存储设备硬盘盘片转动一周,数据2到达磁头的位置,抽取数据2并播放,以此类推。However, since the rotation direction of the hard disk of the video storage device remains unchanged, it always rotates clockwise. Therefore, when rewinding playback, data 4 is first extracted and played. The position of the magnetic head, data 3 is extracted and played, and then the hard disk of the video storage device rotates one revolution, data 2 reaches the position of the magnetic head, data 2 is extracted and played, and so on.

现有技术对视频数据进行倒退回放的方法,由于每抽取一个数据,录像存储设备硬盘盘片需要多转一周,增加了录像存储设备的负担,降低了数据的抽取速度。In the prior art method for rewinding video data, since every time a data is extracted, the hard disc of the video storage device needs to rotate one more time, which increases the burden of the video storage device and reduces the data extraction speed.

发明内容Contents of the invention

有鉴于此,本发明提供一种视频倒退回放方法及装置,以解决现有技术中录像存储设备负担以及数据抽取速度慢的问题。In view of this, the present invention provides a video reverse playback method and device to solve the problems of video storage equipment burden and slow data extraction speed in the prior art.

本发明实施例提供了一种视频倒退回放方法,包括:An embodiment of the present invention provides a video rewind playback method, including:

数据管理设备接收到视频倒退回放指令,在录像存储设备硬盘上检索出对应视频存储区域,所述对应视频存储区域包括至少一个分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据;The data management device receives the video reverse playback instruction, retrieves the corresponding video storage area on the hard disk of the video storage device, and the corresponding video storage area includes at least one group, each group includes a plurality of adjacent frame group data, and the Multiple adjacent frame group data include n I frame data;

数据管理设备按照分组间的逆向顺序,分别对每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。The data management device performs the following operations on each group respectively according to the reverse order between the groups: extract n I-frame data in the group in the corresponding video storage area in forward order and put them into the playback buffer space, and The playback buffer space takes frames in reverse and sends them to the video playback device for playback.

优选地,所述多个相邻的帧组数据中包括的I帧数据的个数n,通过以下公式进行计算:Preferably, the number n of the I frame data included in the plurality of adjacent frame group data is calculated by the following formula:

n=H*(1-R)/L;n=H*(1-R)/L;

其中,H*(1-R)为数据管理设备的缓存空闲空间,H为数据管理设备的缓存值,R为数据管理设备的缓存刷新比例,L为I帧数据长度。Wherein, H*(1-R) is the cache free space of the data management device, H is the cache value of the data management device, R is the cache refresh ratio of the data management device, and L is the I frame data length.

优选地,所述方法进一步包括:当在视频倒退回放过程中,数据管理设备的缓存空闲空间或回放码率发生变化的情况下,对后续未执行所述操作的分组中包括的I帧数据的个数n进行调整。Preferably, the method further includes: when the free buffer space of the data management device or the playback bit rate changes during the video reverse playback process, the I frame data included in the subsequent packets that do not perform the operation The number n is adjusted.

本发明实施例还提供了一种视频倒退回放装置,包括:The embodiment of the present invention also provides a video reverse playback device, including:

检索单元,用于接收到视频倒退回放指令,在录像存储设备硬盘上检索出对应视频存储区域,所述对应视频存储区域包括至少一个分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据;The retrieval unit is configured to receive a video reverse playback instruction, retrieve a corresponding video storage area on the hard disk of the video storage device, the corresponding video storage area includes at least one group, and each group includes a plurality of adjacent frame group data, and The plurality of adjacent frame group data includes n I frame data;

抽取播放单元,用于按照分组间的逆向顺序,分别对每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。The extraction playback unit is used to perform the following operations on each group respectively according to the reverse order between the groups: extract the n I frame data in the grouping in the corresponding video storage area in the forward order and put them into the playback buffer space , and reversely fetch frames in the playback buffer space, and send them to the video playback device for playback.

优选地,所述装置还包括:Preferably, the device also includes:

计算单元,用于通过以下公式计算所述多个相邻的帧组数据中包括的I帧数据的个数n:A calculation unit, configured to calculate the number n of I frame data included in the plurality of adjacent frame group data by the following formula:

n=H*(1-R)/L;n=H*(1-R)/L;

其中,H*(1-R)为数据管理设备的缓存空闲空间,H为数据管理设备的缓存值,R为数据管理设备的缓存刷新比例,L为I帧数据长度。Wherein, H*(1-R) is the cache free space of the data management device, H is the cache value of the data management device, R is the cache refresh ratio of the data management device, and L is the I frame data length.

优选地,所述装置还包括:Preferably, the device also includes:

调整单元,用于在视频倒退回放过程中,数据管理设备的缓存空闲空间或回放码率发生变化的情况下,对后续未执行所述操作的分组中包括的I帧数据的个数n进行调整。The adjustment unit is used to adjust the number n of I-frame data included in subsequent packets that do not perform the operation in the case of a change in the free buffer space of the data management device or the playback bit rate during the video reverse playback process .

本发明实施例提供了一种视频倒退回放方法及装置,该方法及装置每次抽取一组I帧数据,从而使得在回放过程中,录像存储设备硬盘盘片旋转的次数减少,从而减少了录像存储设备硬盘的负担,提高了数据抽取速度。Embodiments of the present invention provide a method and device for rewinding video playback. The method and device extract a group of I-frame data each time, thereby reducing the number of rotations of the hard disk of the video storage device during the playback process, thereby reducing the number of video recordings. The burden on the hard disk of the storage device increases the speed of data extraction.

附图说明Description of drawings

图1是现有技术提供的录像存储设备数据示意图;Fig. 1 is the data schematic diagram of video storage device provided by prior art;

图2是本发明实施例提供的方法流程图;Fig. 2 is a flow chart of a method provided by an embodiment of the present invention;

图3是本发明实施例提供的录像存储设备数据示意图;Fig. 3 is a schematic diagram of video storage device data provided by an embodiment of the present invention;

图4是本发明实施例提供的装置结构示意图。Fig. 4 is a schematic structural diagram of a device provided by an embodiment of the present invention.

具体实施方式detailed description

根据现有技术,在视频倒退回放过程中,每次抽取一个I帧数据,增加录像存储设备负担,降低了数据抽取速度。According to the prior art, during the video rewinding playback process, one I frame of data is extracted each time, which increases the burden on the recording storage device and reduces the data extraction speed.

针对上述问题,本发明实施例提供了一种视频倒退回放方法,该方法包括:In view of the above problems, an embodiment of the present invention provides a video reverse playback method, the method comprising:

数据管理设备接收视频倒退回放指令,在录像存储设备硬盘上检索出对应视频存储区域,所述对应视频存储区域包括多个分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据;The data management device receives the video reverse playback instruction, retrieves the corresponding video storage area on the hard disk of the video storage device, and the corresponding video storage area includes a plurality of groups, each group includes a plurality of adjacent frame group data, and the plurality of Include n I frame data in adjacent frame group data;

数据管理设备按照分组间的逆向顺序,分别对于每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。The data management device performs the following operations for each group according to the reverse order between the groups: extract n I-frame data in the group in the corresponding video storage area in forward order and put them into the playback buffer space, and The playback buffer space takes frames in reverse and sends them to the video playback device for playback.

根据上述方案,每次抽取多个I桢数据,从而使得在回放过程中,录像存储设备硬盘旋转的次数减少,从而减少了录像存储设备硬盘的负担,提高了数据抽取速度。According to the above solution, a plurality of I-frame data is extracted each time, thereby reducing the number of rotations of the hard disk of the video storage device during playback, thereby reducing the burden on the hard disk of the video storage device and increasing the data extraction speed.

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

如图2所示,本发明实施例提供了一种视频倒退回放方法,该方法包括以下步骤:As shown in Figure 2, the embodiment of the present invention provides a video rewind playback method, the method includes the following steps:

步骤201:数据管理设备接收到视频倒退回放指令,在录像存储设备硬盘上检索出对应视频存储区域,所述对应视频存储区域包括至少一个分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据;Step 201: The data management device receives the video reverse playback instruction, retrieves the corresponding video storage area on the hard disk of the video storage device, and the corresponding video storage area includes at least one group, and each group includes multiple adjacent frame group data, And the plurality of adjacent frame group data includes n I frame data;

其中,该对应视频存储区域包括多个分组,该对应视频存储区域的分组可以为虚拟分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据。Wherein, the corresponding video storage area includes a plurality of groups, the grouping of the corresponding video storage area may be a virtual group, each group includes a plurality of adjacent frame group data, and the plurality of adjacent frame group data includes n I-frame data.

在本发明实施例中,多个相邻的帧组数据中包括的I帧数据的个数n可以为经验值,该经验值为固定值,其中n为大于1的自然数。In the embodiment of the present invention, the number n of I-frame data included in multiple adjacent frame group data may be an empirical value, and the empirical value is a fixed value, wherein n is a natural number greater than 1.

在本发明实施例中,多个相邻的帧组数据中包括的I帧数据的个数n,还可以通过以下公式(1)进行计算:In the embodiment of the present invention, the number n of the I frame data included in a plurality of adjacent frame group data can also be calculated by the following formula (1):

n=H*(1-R)/L;(1)n=H*(1-R)/L; (1)

其中,n为固定值,H*(1-R)为数据管理设备的缓存空闲空间,H为数据管理设备的缓存值,R为数据管理设备的缓存刷新比例,L为I帧数据长度。Wherein, n is a fixed value, H*(1-R) is the cache free space of the data management device, H is the cache value of the data management device, R is the cache refresh ratio of the data management device, and L is the I frame data length.

在本发明实施例中,直接根据自身参数获取缓存值H和缓存刷新比例R。In the embodiment of the present invention, the cache value H and the cache refresh ratio R are obtained directly according to its own parameters.

其中,多个相邻的帧组数据中包括的I帧数据的个数n的设定方法,本发明实施例对此不作具体限定。Wherein, the method for setting the number n of I-frame data included in multiple adjacent frame group data is not specifically limited in this embodiment of the present invention.

因此,每次抽取的I桢数据个数n不变。Therefore, the number n of I-frame data extracted each time remains unchanged.

步骤202:数据管理设备根据所述视频倒退回放指令,按照分组间的逆向顺序,分别对于每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;Step 202: According to the video reverse playback instruction, the data management device performs the following operations for each group according to the reverse order between the groups: extract n of the groups in the corresponding video storage area in the forward order The I frame data is put into the playback buffer space, and the frame is reversely fetched in the playback buffer space, and sent to the video playback device for playback;

在本发明实施例中,监控设备的前端设备所获取的图像数据的帧组数据中常见的类型是IP帧,例如,帧率如果为25Hz,则帧组数据包括1个I帧和24个P帧。若数据管理设备的缓存大小为4MB,将抽取视频片段内的帧组数据放入数据管理设备的缓存,目前,数据管理设备的缓存大小固定,默认数据管理设备的缓存刷新比例为80%。In the embodiment of the present invention, the common type of frame group data of the image data acquired by the front-end equipment of the monitoring device is IP frame. For example, if the frame rate is 25Hz, the frame group data includes 1 I frame and 24 P frames. frame. If the cache size of the data management device is 4MB, the frame group data in the extracted video clips will be put into the cache of the data management device. Currently, the cache size of the data management device is fixed, and the cache refresh ratio of the default data management device is 80%.

在本发明实施例中,由于需要对视频存储区域进行倒退回放,因此需要根据逆向顺序对该视频片段进行抽取,对抽取的视频存储区域中n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。In the embodiment of the present invention, since the video storage area needs to be played back backwards, the video segment needs to be extracted according to the reverse order, and n I-frame data in the extracted video storage area are put into the playback buffer space, and are played back Frames are reversed in the buffer space and sent to the video playback device for playback.

为了减少录像存储设备负担,提高数据抽取的速度,本发明实施例通过视频存储区域的分组,每次抽取一个分组中的I帧数据,该抽取操作为:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。In order to reduce the burden on the video storage device and increase the speed of data extraction, the embodiment of the present invention extracts the I frame data in one group at a time through the grouping of the video storage area. The extraction operation is: extract the corresponding video storage in the forward order The n pieces of I-frame data in the grouping in the area are put into the playback buffer space, and the frame is reversely fetched in the playback buffer space, and sent to the video playback device for playback.

如图3所示,录像存储设备硬盘盘片以顺时针方向进行旋转,磁头保持不动。该录像存储设备中根据视频倒退回放指令查找的视频存储区域包括m个分组,每个分组中包括多个相邻的帧组数据,且该多个相邻的帧组数据中包括n个I帧数据,因此在第一个周期内,在第m个分组内以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;录像存储设备进行旋转,在第二周期内,在第m-1个分组内,以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;录像存储设备进行旋转……,直到在第m个周期内,在第1个分组内,以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。As shown in FIG. 3 , the hard disk platter of the video storage device rotates in a clockwise direction, and the magnetic head remains stationary. The video storage area searched according to the video reverse playback instruction in the video storage device includes m groups, each group includes a plurality of adjacent frame group data, and the plurality of adjacent frame group data includes n I frames Therefore, in the first cycle, the I frame data of the video storage area is extracted in the forward order in the mth group and put into the playback buffer space, and the frames are reversely fetched in the playback buffer space, and sent to the video playback device for playback ; The video recording storage device rotates, and in the second cycle, in the m-1th grouping, extract the I frame data of the video storage area in forward order and put it into the playback buffer space, and reversely fetch frames in the playback buffer space, and send The video playback device is played; the video storage device is rotated... until in the mth cycle, in the first group, the I frame data of the video storage area is extracted in forward order and put into the playback buffer space, and in the The playback buffer space takes frames in reverse and sends them to the video playback device for playback.

在本发明实施例中,根据公式(1),由于视频倒退回放过程中,数据管理设备的缓存空闲空间会经常发生变化,以及码率也可能存在变化,因此,在缓存空闲空间H*(1-R)发生变化的情况下,对后续未执行所述操作的分组中包括的I桢数据的个数进行调整。因此,在抽取视频存储区域的I帧组数据时,每次抽取的I桢数据个数n由公式(1)进行计算确定。In the embodiment of the present invention, according to the formula (1), since the free buffer space of the data management device often changes during the video reverse playback process, and the code rate may also change, therefore, in the free buffer space H*(1 - When R) changes, the number of I-frame data included in subsequent packets not performing the operation is adjusted. Therefore, when extracting I-frame group data in the video storage area, the number n of I-frame data extracted each time is calculated and determined by formula (1).

在本发明实施例中,录像存储设备中的视频片段的逆时针方向为所述正向顺序,顺时针方向为所述逆向顺序。In the embodiment of the present invention, the counterclockwise direction of the video clips in the video storage device is the forward order, and the clockwise direction is the reverse order.

根据上述方案,在每个周期中,分别抽取一组分组里的I帧数据,该一个分组包括多个I帧数据,从而使得在回放过程中,录像存储设备旋转的次数减少,从而减少了录像存储设备负担,提高了数据抽取速度。According to the above-mentioned solution, in each period, a group of I frame data in a group is respectively extracted, and the group includes a plurality of I frame data, so that during playback, the number of rotations of the recording storage device is reduced, thereby reducing the recording time. The storage device burden increases the speed of data extraction.

如图4所示,针对上述问题,本发明实施例还提供了一种视频倒退回放装置,其特征在于,包括:As shown in Figure 4, in view of the above problems, the embodiment of the present invention also provides a video reverse playback device, which is characterized in that it includes:

检索单元401,用于接收到视频倒退回放指令,在录像存储设备硬盘上检索出对应视频存储区域,所述对应视频存储区域包括至少一个分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据;The retrieval unit 401 is configured to receive a video reverse playback instruction, and retrieve a corresponding video storage area on the hard disk of the video storage device, the corresponding video storage area includes at least one group, and each group includes a plurality of adjacent frame group data, And the plurality of adjacent frame group data includes n I frame data;

其中,该对应视频存储区域包括多个分组,该对应视频存储区域的分组可以为虚拟分组,每个分组包括多个相邻的帧组数据,且所述多个相邻的帧组数据中包括n个I帧数据。Wherein, the corresponding video storage area includes a plurality of groups, the grouping of the corresponding video storage area may be a virtual group, each group includes a plurality of adjacent frame group data, and the plurality of adjacent frame group data includes n I-frame data.

在本发明实施例中,多个相邻的帧组数据中包括的I帧数据的个数n可以为经验值,该经验值为固定值,其中n为大于1的自然数。In the embodiment of the present invention, the number n of I-frame data included in multiple adjacent frame group data may be an empirical value, and the empirical value is a fixed value, wherein n is a natural number greater than 1.

在本发明实施例中,该装置还可以包括:In an embodiment of the present invention, the device may also include:

计算单元402,用于计算多个相邻的帧组数据中包括的I帧数据的个数n,通过以下公式(2)进行计算:Calculation unit 402, is used for calculating the number n of the I frame data that comprises in a plurality of adjacent frame group data, calculates by following formula (2):

n=H*(1-R)/L;(2)n=H*(1-R)/L; (2)

其中,n为固定值,H*(1-R)为数据管理设备的缓存空闲空间,H为数据管理设备的缓存值,R为数据管理设备的缓存刷新比例,L为I帧数据长度。Wherein, n is a fixed value, H*(1-R) is the cache free space of the data management device, H is the cache value of the data management device, R is the cache refresh ratio of the data management device, and L is the I frame data length.

在本发明实施例中,直接根据自身参数获取缓存值H和缓存刷新比例R。In the embodiment of the present invention, the cache value H and the cache refresh ratio R are obtained directly according to its own parameters.

其中,多个相邻的帧组数据中包括的I帧数据的个数n的设定方法,本发明实施例对此不作具体限定。Wherein, the method for setting the number n of I-frame data included in multiple adjacent frame group data is not specifically limited in this embodiment of the present invention.

因此,每次抽取的I桢数据个数n不变。Therefore, the number n of I-frame data extracted each time remains unchanged.

抽取播放单元403,用于按照分组间的逆向顺序,分别对于每个分组,执行以下操作:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;The extraction playback unit 403 is used to perform the following operations for each grouping according to the reverse order between the groups: extract the n I frame data in the grouping in the corresponding video storage area in a forward order and put them into the playback buffer space, and reverse frame capture in the playback buffer space, and send it to the video playback device for playback;

在本发明实施例中,监控设备的前端设备所获取的图像数据的帧组数据中常见的类型是IP帧,例如,帧率如果为25Hz,则帧组数据包括1个I帧和24个P帧。若数据管理设备的缓存大小为4MB,将抽取视频片段内的帧组数据放入数据管理设备的缓存,目前,数据管理设备的缓存大小固定,默认数据管理设备的缓存刷新比例为80%。In the embodiment of the present invention, the common type of frame group data of the image data acquired by the front-end equipment of the monitoring device is IP frame. For example, if the frame rate is 25Hz, the frame group data includes 1 I frame and 24 P frames. frame. If the cache size of the data management device is 4MB, the frame group data in the extracted video clips will be put into the cache of the data management device. Currently, the cache size of the data management device is fixed, and the cache refresh ratio of the default data management device is 80%.

在本发明实施例中,由于需要对视频存储区域进行倒退回放,因此需要根据逆向顺序对该视频片段进行抽取,对抽取的视频存储区域中n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。In the embodiment of the present invention, since the video storage area needs to be played back backwards, the video segment needs to be extracted according to the reverse order, and n I-frame data in the extracted video storage area are put into the playback buffer space, and are played back Frames are reversed in the buffer space and sent to the video playback device for playback.

为了减少录像存储设备负担,提高数据抽取的速度,本发明实施例通过视频存储区域的分组,每次抽取一个分组中的I帧数据,该抽取操作为:以正向顺序抽取所述对应视频存储区域中所述分组中的n个I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。In order to reduce the burden on the video storage device and increase the speed of data extraction, the embodiment of the present invention extracts the I frame data in one group at a time through the grouping of the video storage area. The extraction operation is: extract the corresponding video storage in the forward order The n pieces of I-frame data in the grouping in the area are put into the playback buffer space, and the frame is reversely fetched in the playback buffer space, and sent to the video playback device for playback.

如图3所示,录像存储设备以顺时针方向进行旋转,磁头保持不动。该录像存储设备中根据视频倒退回放指令查找的视频存储区域存储区域包括m个分组,每个分组中包括多个相邻的帧组数据,且该多个相邻的帧组数据中包括n个I帧数据,在第一个周期内,在第m个分组内以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;录像存储设备进行旋转,在第二周期内,在第m-1个分组内,以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放;录像存储设备进行旋转……,直到在第m个周期内,在第1个分组内,以正向顺序抽取视频存储区域的I帧数据放入回放缓存空间,并在回放缓存空间逆向取帧,发送给视频播放设备进行播放。As shown in Figure 3, the video storage device rotates in a clockwise direction, and the magnetic head remains stationary. In the video storage device, the video storage area searched according to the video reverse playback instruction storage area includes m groups, and each group includes a plurality of adjacent frame group data, and the plurality of adjacent frame group data includes n I frame data, in the first cycle, extract the I frame data of the video storage area in the forward order in the mth group and put it into the playback buffer space, and reversely fetch the frame in the playback buffer space, and send it to the video playback device for further processing Play; the video storage device rotates, in the second cycle, in the m-1th group, extract the I frame data of the video storage area in a forward order and put it into the playback buffer space, and reversely fetch frames in the playback buffer space, Send it to the video playback device for playback; the video storage device rotates... until in the mth cycle, in the first grouping, the I frame data of the video storage area is extracted in forward order and put into the playback buffer space, and Frames are reversely captured in the playback buffer space and sent to the video playback device for playback.

在本发明实施例中,由于视频倒退回放过程中,数据管理设备的缓存空闲空间会经常发生变化,因此,该装置还可以包括:In the embodiment of the present invention, since the free buffer space of the data management device often changes during the video reverse playback process, the device may also include:

调整单元404,用于在视频倒退回放过程中,缓存空闲空间H*(1-R)发生变化的情况下,对后续未执行所述操作的分组中包括的I桢数据的个数n进行调整。因此,在抽取视频存储区域的I帧组数据时,每次抽取的I桢个数n由公式(2)进行计算确定确定。The adjustment unit 404 is used to adjust the number n of I-frame data included in subsequent packets that do not perform the operation when the buffer free space H*(1-R) changes during the video reverse playback process . Therefore, when extracting the I frame group data of the video storage area, the number n of I frames extracted each time is calculated and determined by formula (2).

在本发明实施例中,录像存储设备中的视频片段的逆时针方向为所述正向顺序,顺时针方向为所述逆向顺序。In the embodiment of the present invention, the counterclockwise direction of the video clips in the video storage device is the forward order, and the clockwise direction is the reverse order.

根据上述方案,每次抽取一组分组里的I帧数据,该一个分组包括多个I帧数据,从而使得在回放过程中,录像存储设备旋转的次数减少,从而减少了录像存储设备负担,提高了数据抽取速度。According to the above scheme, the I-frame data in a group of groups is extracted each time, and the group includes a plurality of I-frame data, so that during playback, the number of rotations of the video storage device is reduced, thereby reducing the burden on the video storage device and improving the performance of the video storage device. data extraction speed.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.

Claims (6)

1. a kind of video falls back back method, it is characterised in that including:
Data management apparatus receives video and falls back play-back command, and corresponding video storage is retrieved on video recording storage device hard disk Region, the corresponding video storage include at least one packet, and each packet includes multiple adjacent frame group data, and institute Stating multiple adjacent frame group data includes n I frame data;
Data management apparatus, respectively to each packet, performs following operate according to the reverse order between packet:Taken out with forward sequence N I frame data in being grouped described in the corresponding video storage are taken to be put into playback spatial cache, and it is empty in playback caching Between inversely take frame, be sent to video playback apparatus and play out.
2. according to the method for claim 1, it is characterised in that the I frame numbers that the multiple adjacent frame group data include According to number n, calculated by below equation:
N=H* (1-R)/L;
Wherein, H* (1-R) is the caching free space of data management apparatus, and H is the cache size of data management apparatus, and R is data The cache flush ratio of management equipment, L are I frame data length.
3. according to the method for claim 2, it is characterised in that methods described further comprises:Played back when being fallen back in video During, in the case that the caching free space of data management apparatus or playback code check change, to it is follow-up be not carried out it is described The number n for the I frame data that the packet of operation includes is adjusted.
4. a kind of video falls back playback reproducer, it is characterised in that the video falls back playback reproducer and is applied to data management apparatus On, described device includes:
Retrieval unit, play-back command is fallen back for receiving video, corresponding video is retrieved on video recording storage device hard disk and is deposited Storage area domain, the corresponding video storage include at least one packet, and each packet includes multiple adjacent frame group data, and The multiple adjacent frame group data include n I frame data;
Broadcast unit is extracted, for according to the reverse order between packet, respectively to each packet, performing following operate:With forward direction The n I frame data that order is extracted in being grouped described in the corresponding video storage are put into playback spatial cache, and are playing back Spatial cache inversely takes frame, is sent to video playback apparatus and plays out.
5. device according to claim 4, it is characterised in that described device also includes:
Computing unit, for calculating the number for the I frame data that the multiple adjacent frame group data include by below equation n:
N=H* (1-R)/L;
Wherein, H* (1-R) is the caching free space of data management apparatus, and H is the cache size of data management apparatus, and R is data The cache flush ratio of management equipment, L are I frame data length.
6. device according to claim 5, it is characterised in that described device also includes:
Adjustment unit, used in falling back replayed section in video, the caching free space or playback code check hair of data management apparatus In the case of changing, the number n of the I frame data included to the packet for being subsequently not carried out the operation is adjusted.
CN201410191854.2A 2014-05-06 2014-05-06 A kind of video falls back playback method and device Active CN103974014B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410191854.2A CN103974014B (en) 2014-05-06 2014-05-06 A kind of video falls back playback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410191854.2A CN103974014B (en) 2014-05-06 2014-05-06 A kind of video falls back playback method and device

Publications (2)

Publication Number Publication Date
CN103974014A CN103974014A (en) 2014-08-06
CN103974014B true CN103974014B (en) 2018-01-05

Family

ID=51242997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410191854.2A Active CN103974014B (en) 2014-05-06 2014-05-06 A kind of video falls back playback method and device

Country Status (1)

Country Link
CN (1) CN103974014B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105025357B (en) * 2015-06-05 2018-06-08 北京中电兴发科技有限公司 A kind of method of video play-reverse
CN107222779B (en) * 2017-06-08 2019-11-19 浙江大华技术股份有限公司 A kind of method and device of video play-reverse
CN111614997B (en) * 2020-05-11 2022-04-15 浙江大华技术股份有限公司 Far-end video playback method, device, equipment and medium
CN111711841B (en) * 2020-07-27 2022-09-09 广州酷狗计算机科技有限公司 Image frame playing method, device, terminal and storage medium
CN112911389B (en) * 2021-01-18 2022-09-06 浙江大华技术股份有限公司 Video playing switching method, electronic equipment and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571500A (en) * 2003-04-24 2005-01-26 三星电子株式会社 Method and apparatus for controlling a bit rate of digital video data
CN101933093A (en) * 2008-02-04 2010-12-29 微软公司 Rewind playback of media
CN102332284A (en) * 2011-08-29 2012-01-25 上海文广科技(集团)有限公司 Multimedia data processing method and processing system suitable for digital media broadcast

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3548136B2 (en) * 2001-06-01 2004-07-28 三洋電機株式会社 Image processing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571500A (en) * 2003-04-24 2005-01-26 三星电子株式会社 Method and apparatus for controlling a bit rate of digital video data
CN101933093A (en) * 2008-02-04 2010-12-29 微软公司 Rewind playback of media
CN102332284A (en) * 2011-08-29 2012-01-25 上海文广科技(集团)有限公司 Multimedia data processing method and processing system suitable for digital media broadcast

Also Published As

Publication number Publication date
CN103974014A (en) 2014-08-06

Similar Documents

Publication Publication Date Title
CN103974014B (en) A kind of video falls back playback method and device
US7673238B2 (en) Portable media device with video acceleration capabilities
WO2017107649A1 (en) Video transmission method and device
US8855466B2 (en) Separate video file for I-frame and non-I-frame data to improve disk performance in trick play
JP2020058823A5 (en)
JP2007267408A5 (en)
CN108833817B (en) Video data storage method and device
CN107168651B (en) A small file aggregate storage processing method
US20220262406A1 (en) System and methods for autonomous synchronous rendering of media objects obtained from a plurality of media sources
CN105872484A (en) Protection method of monitoring video abnormity
US20150022683A1 (en) Electronic device and video playing method
JP2009027428A5 (en)
CN115396729B (en) Video target frame determining method, device, equipment and storage medium
JP2015056889A5 (en)
CN102932640B (en) Method for controlling video stream frame rate
CN107124571B (en) Video storage method and device
CN111163297A (en) Method for realizing high concurrency and quick playback of video monitoring cloud storage
JP2010527482A5 (en)
KR102135347B1 (en) Digital video recorder and operation method thereof
CN105611307A (en) Multipath h264 video data caching method and system based on no-lock buffer queue
US20220210521A1 (en) Pre-fetch of data using seek intervals
CN114003763A (en) Method and device for storing video data and readable storage medium
WO2017008234A1 (en) Monitored data processing method and system
CN104394453B (en) video prerecording method and device
CN111147954A (en) Thumbnail extraction method and device

Legal Events

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