CN108833817A - A kind of video data storage method and device - Google Patents

A kind of video data storage method and device Download PDF

Info

Publication number
CN108833817A
CN108833817A CN201810679732.6A CN201810679732A CN108833817A CN 108833817 A CN108833817 A CN 108833817A CN 201810679732 A CN201810679732 A CN 201810679732A CN 108833817 A CN108833817 A CN 108833817A
Authority
CN
China
Prior art keywords
frame
index
code stream
writing position
written
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.)
Granted
Application number
CN201810679732.6A
Other languages
Chinese (zh)
Other versions
CN108833817B (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 Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201810679732.6A priority Critical patent/CN108833817B/en
Publication of CN108833817A publication Critical patent/CN108833817A/en
Application granted granted Critical
Publication of CN108833817B publication Critical patent/CN108833817B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/78Television signal recording using magnetic recording
    • H04N5/781Television signal recording using magnetic recording on disks or drums

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

A kind of video data storage method and device, this method include:After at least one code stream frame is written in video data file, the first I frame index frame is written, record has the writing position of writing position and with first I frame index frame adjacent next I frame index frame of the I frame for including at least one code stream frame in video data file in first I frame index frame, and the writing position of the first I frame index frame is determined according to the I frame index frame writing position recorded in the upper I frame index frame adjacent with the first I frame index frame.After the first I frame index frame, after continuing to write at least one code stream frame, when the writing position of the next I frame index frame recorded in reaching the first I frame index frame, the 2nd I frame index frame is written, record has the writing position of writing position and with twoth I frame index frame adjacent next I frame index frame of the I frame for including at least one the code stream frame continued to write in video data file in the 2nd I frame index frame.

Description

A kind of video data storage method and device
Technical field
This application involves video field of storage more particularly to a kind of video data storage methods and device.
Background technique
The core function that network video stores equipment (network video recorder, NVR) is to head end encoder The video data of acquisition is stored, and the general video data encoding format standard of industry is H264, includes tri- kinds of frame classes of I/P/B Type, wherein I frame (I frame) be can independent decoded video frame, and I the or P frame that P/B frame then needs to rely on adjacent is solved Code.
During storing video data file into hard disk, other than code stream frame is written, in order to which quick playback positions, It also needs to be written I frame index information, timestamp, position and the frame length of corresponding I frame is had recorded in I frame index information.Video returns During putting, when user needs to position the video at some time point, the time is found according to what I frame index information can be convenient The video data of point, without being looked for by traversing entire video file.Therefore, a video data file is by structure It is constituted based on the code stream frame and I frame index information of change.
In the prior art, in video data storing process, first hereof distribute fixed size head space, then according to Secondary write-in code stream frame jumps back to top of file if code stream frame is I frame, and corresponding I frame index information is written, then proceedes to be written Code stream frame.Drawback of the prior art is that:During code stream frame is written, needs to jump back to top of file and corresponding I frame index is written Information, cause hard disc magnetic head frequently jump and data buffer area frequently write with a brush dipped in Chinese ink.Moreover, top of file size is fixed, the I of write-in Frame index information bar number is limited.
Summary of the invention
The embodiment of the present application provides a kind of video data storage method and device, and video exists in the prior art to solve In data storage procedure, since the write-in of I frame index information causes hard disc magnetic head frequently to jump and the frequent brush of data buffer area The problem of writing.
In a first aspect, the application provides a kind of video data storage method, this method is specifically included:
After at least one code stream frame is written in video data file, the first I frame index frame, the first I frame index frame is written Middle record have writing position of the I frame for including at least one code stream frame in video data file and with the first I frame index frame The writing position of adjacent next I frame index frame, the writing position of the first I frame index frame are basis and the first I frame index frame phase What the I frame index frame writing position recorded in adjacent upper I frame index frame determined.
In a first aspect, after the first I frame index frame, continuing to write at least one in a kind of possible implementation After code stream frame, reach the first I frame index frame in record next I frame index frame writing position when, be written the 2nd I frame index Frame, record has the I frame for including at least one the code stream frame continued to write in video data file in the 2nd I frame index frame The writing position of writing position and the next I frame index frame adjacent with the 2nd I frame index frame.
Video data is written at the form of I frame index frame in I frame index information structuring by method provided by the embodiments of the present application In file, in video data storing process, code stream frame and I frame index frame keep cleanliness to be sequentially written in, and avoid rebound text The write-back movement of I frame index information is written in part head, improves storage efficiency.
In a first aspect, in a kind of possible implementation, two neighboring I frame index frame in video data file it Between at least one code stream frame is written, including:If the length between the writing position of two neighboring I frame index frame is equal to N number of code The length for flowing frame, then be written N number of code stream frame between the writing position of two neighboring I frame index frame.
In a first aspect, in a kind of possible implementation, if between the writing position of two neighboring I frame index frame Length is greater than the length of N-1 code stream frame and is less than the length of N number of code stream frame, then in the write-in position of two neighboring I frame index frame N-1 code stream frame is written between setting, and null frame is written at vacant place, null frame is invalid frame,.
In process of playback of video, video equipment skips parsing to null frame automatically, is not take up the parsing time.
First I frame index frame also records the frame length and timestamp for having the I frame for including at least one code stream frame.
In a kind of possible implementation of first aspect, method provided by first aspect may also include:In video counts File header frame is written according to the initial position of file, file header frame recording has write-in of first code stream frame in video data file The writing position of position and first I frame index frame.
Whether meet the frame of code stream frame to be written to the length between I frame index frame position by comparing the position of code stream frame Length is inserted into the null frame of certain length when being not enough to be written code stream frame, plays the role of polishing data, guarantees code stream frame and I Frame index frame is sequentially written in.
In a kind of possible implementation of first aspect, method provided by first aspect may also include:In the first I frame After index frame, during continuing to write at least one code stream frame, determines that video data file is closed, record the last one The writing position of the code stream frame of write-in.After reopening video data file, in the code stream frame of the last one write-in of record Writing position after null frame is written before the writing position of next I frame index frame that records into the first I frame index frame, null frame For invalid frame.When the writing position of the next I frame index frame recorded in reaching the first I frame index frame, the 2nd I frame index is written Frame.
Second aspect, the application also provide a kind of video data storage device, and described device specifically includes:
The first I frame index is written after at least one code stream frame is written in video data file in first writing unit Frame, record has the I frame for including at least one described code stream frame in the video data file in the first I frame index frame Writing position and the next I frame index frame adjacent with the first I frame index frame writing position, the first I frame index The writing position of frame is according to the I frame index frame write-in recorded in the upper I frame index frame adjacent with the first I frame index frame What position determined;
Second writing unit is used for after the first I frame index frame, after continuing to write at least one code stream frame, When reaching the writing position of the next I frame index frame recorded in the first I frame index frame, the 2nd I frame index frame is written, it is described Record has the I frame for including at least one the code stream frame continued to write in the video data file in 2nd I frame index frame Writing position and the next I frame index frame adjacent with the 2nd I frame index frame writing position.
In a kind of possible implementation of second aspect, first writing unit, the phase in video data file When at least one code stream frame is written between adjacent two I frame index frames, it is specifically used for:
If the length between the writing position of two neighboring I frame index frame is equal to the length of N number of code stream frame, adjacent N number of code stream frame is written between the writing position of two I frame index frames;
If the length between the writing position of two neighboring I frame index frame is greater than the length of N-1 code stream frame and is less than N-1 code stream frame is then written in the length of N number of code stream frame between the writing position of two neighboring I frame index frame, and at vacant place Null frame is written, the null frame is invalid frame.
In a kind of possible implementation of second aspect, the first I frame index frame also record have it is described at least one The frame length and timestamp for the I frame for including in code stream frame.
In a kind of possible implementation of second aspect, device described in second aspect further includes:
Third writing unit, for file header frame, the file header to be written in the initial position of the video data file Frame recording has the write-in position of writing position and first I frame index frame of first code stream frame in the video data file It sets.
In a kind of possible implementation of second aspect, the described device of second aspect may also include:
Recording unit is used for after the first I frame index frame, during continuing to write at least one code stream frame, It determines that the video data file is closed, records the writing position of the code stream frame of the last one write-in;
4th writing unit, for after reopening the video data file, in the last one write-in of record It is write before the writing position of the next I frame index frame recorded after the writing position of code stream frame into the first I frame index frame Enter null frame, the null frame is invalid frame;The write-in position of the next I frame index frame recorded in reaching the first I frame index frame When setting, the 2nd I frame index frame is written.
Ile repair method in the case of the improper closing of file provided by the present application is quickly navigated in the presence of abnormal code Flow frame position, and the data in polishing file, it is therefore prevented that data in the process of playback of video as caused by file improper closing The problem of position inaccurate.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without any creative labor, it can also be obtained according to these attached drawings His attached drawing.
Fig. 1 is the structural schematic diagram of video data file in the prior art;
Fig. 2 is a kind of structural schematic diagram of video data file provided by the embodiments of the present application;
Fig. 3 is a kind of schematic diagram of video data storage method provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of video data file provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of the video data file of improper closing provided by the embodiments of the present application;
Fig. 6 is a kind of schematic diagram of video data storage method provided by the embodiments of the present application;
Fig. 7 is a kind of structural schematic diagram of video data storage device provided by the embodiments of the present application.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into It is described in detail to one step, it is clear that described embodiments are only a part of the embodiments of the present invention, rather than whole implementation Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts All other embodiment, shall fall within the protection scope of the present invention.
Fig. 1 is the structural schematic diagram of video data file in the prior art.As shown in Figure 1, in the prior art, first in text The head space that fixed size is distributed in part, such as 384 kilobits (KB), then is sequentially written in code stream frame, if code stream frame is I frame, Top of file is then jumped back to, corresponding I frame index information is written, records the information of I frame in corresponding code stream frame, then proceedes to write-in code Flow frame.
Fig. 2 is a kind of structural schematic diagram of video data file provided by the embodiments of the present application.As shown in Fig. 2, the application In the video data file structure that embodiment provides, in top of file space, distribution certain space is as file header frame, file header Frame only has a frame in entire file, and record has writing position and first I of first code stream frame in video data file The writing position of frame index frame.Write-in position of at least one the corresponding I frame of each I frame index frame recording in video data file It sets, timestamp and frame length, also records the location information of adjacent next I frame index frame, constitute one-way circulation list structure. When needing in the code stream frame recorded without I frame, 0 I frame index information of I frame index frame recording;When in the code stream frame for needing to record When comprising at least one I frame, at least one I frame index information of I frame index frame recording.Null frame shown in Fig. 2 is invalid frame, mesh Be for polishing data, can be for any length not less than minimum frame length, minimum frame length fixed size frame head and The length of postamble.In video data writing process, video data maintains linear precedence write-in, avoids write-back movement.Depending on In frequency data read process, the I frame index frame recording relevant information of corresponding I frame can need to be accurately positioned according to user To the video sometime put, avoids the entire video file of traversal and find.In process of playback of video, file header is skipped automatically Frame, I frame index frame, null frame are parsed, and efficiency is improved.
Fig. 3 is a kind of schematic diagram of video data storage method provided by the embodiments of the present application.As shown in figure 3, this method Including:File header frame is written, the writing position of first code stream frame and writing for first I frame index frame are had recorded in file header frame Enter position.And the writing position of the writing position of first code stream frame and first I frame index frame is cached to file cache area. The writing position of first code stream frame and the writing position of first I frame index frame are obtained from file cache area.It is slow that file is set Area is deposited, avoids to jump back in file header frame in video data writing process and reads information, the write efficiency of the data of raising.First The writing position of a code stream frame is file header End of Frame position, and the writing position of first I frame index frame is according to video data The size of file carries out estimation acquisition.
Before code stream frame is written, need code stream frame writing position more to be written that position is written to the I frame index frame of record Whether the length between setting, the length are written the frame length of at least one code stream frame enough.
In data writing process, when code stream frame writing position to record I frame index frame writing position between length Greater than code stream frame to be written frame length when, be written at least one code stream frame enough, direct code stream frame, if the code stream frame of write-in For I frame, then I frame index information is cached, by the I frame index information structuring of caching at I frame index frame.
When the writing position of code stream frame is equal to code stream frame to be written to the length between the I frame index frame writing position of record Frame length when, write direct code stream frame, do not need insertion null frame, if write-in code stream frame be I frame, cache I frame index Information, by the I frame index information structuring of caching at I frame index frame, in file header frame or adjacent upper I frame index frame is remembered I frame index frame is written in the writing position of this I frame index frame of record.
When the writing position of code stream frame is less than code stream frame to be written to the length between the I frame index frame writing position of record Frame length when, be not enough to be written a code stream frame, be then inserted into the null frame of certain length, polishing data, so that video data arrives Up in file header frame or the writing position of the I frame index frame of adjacent upper I frame index frame recording, if write before insertion null frame There is at least one I frame in the code stream frame entered, then cache I frame index information, by the I frame index information structuring of caching at I frame index I frame index frame is written in frame.If without record I frame before the I frame index frame of write-in, the I frame index frame of this write-in is labeled It is invalid.
Fig. 4 is a kind of structural schematic diagram of video data file provided by the embodiments of the present application, below with reference to Fig. 4 and specifically Example video data storage method provided by the embodiments of the present application is described in detail.In specific example I frame index frame length compared with The code stream frame length of write-in is relatively small, more convenient in order to describe, and disregards the length of I frame index frame.Include multiple I frame index The video data file storage method of frame and multiple code stream frames is consistent with method provided by the embodiments of the present application, no longer goes to live in the household of one's in-laws on getting married It states.
File header frame is written, file header frame sign is 100KB, then the write-in point of first code stream frame is set in file the The position of 100KB, the position of first I frame index framing bit 800KB in file of file header frame recording, to be written first The length of code stream frame is 300KB, by comparing the position to the position of first I frame index frame that point is written from first code stream frame Between length be that much larger than the length of first code stream frame to be written the first code stream is directly written in 700KB hereof Frame.
After first code stream frame is written, and first code stream frame is I frame, the information of the I frame is cached, as first I frame The tectonic information of index frame.So, the write-in point of second code stream frame to be written is set at 400KB, and to be written second A code stream frame is 400KB, by comparing from the position of second code stream frame write-in point to the position of first I frame index frame Length be 400KB, be directly written the second code stream frame hereof, the second code stream frame is non-I frame.Second code stream frame is written Afterwards, the position of the code stream frame in file reaches first I frame index frame writing position.According to first I frame information, building first A I frame index frame, while first I frame index frame recording, the second I frame index frame adjacent with first I frame index frame First I frame index frame is written further according to the position of the first I frame index frame recorded in file header frame in position.First I It include the index information of an I frame in frame index frame, including the timestamp of first I frame, position, frame length, resolution in file Rate and other information.
First I frame index frame recording, the position of second I frame index framing bit 1600KB in file, it is to be written The length of third code stream frame is 400KB, and the writing position of third code stream frame to be written is located in file at 800KB, By comparing from third code stream frame writing position to length the position of second I frame index frame be 800KB, be much larger than to Third code stream frame is directly written in the length of the third code stream frame of write-in hereof.
After third code stream frame is written, and third code stream frame is non-I frame.So, the writing position of the 4th code stream frame The position of 1200KB in file, the 4th code stream frame to be written are 500KB.It is write by comparing from the 4th code stream frame Entering position to the length between the position of second I frame index frame is 400KB, is not enough to be written the 4th code stream frame, is then inserted into Length is the null frame of 400KB, polishing data, so that the frame in file reaches the position of second I frame index frame.According to first The location information of the adjacent second I frame index frame of I frame index frame recording, constructs second I frame index frame, and by second File is written in I frame index frame.There was only one in the code stream frame being written between first I frame index frame and second I frame index frame A non-I frame and null frame, then, it include 0 I frame index information in second I frame index frame.Second I frame index frame note simultaneously Record the position of third I frame index frame.
It after second I frame index frame is written, is not required to that code stream frame is written again, then the third recorded in second I frame index frame The position of a I frame index frame is identical as the position of the 2nd I frame index frame, indicates the ending for reaching file.File is closed, by file In all video datas deposit hard disk in.
Fig. 5 is a kind of structural schematic diagram of the video data file of improper closing provided by the embodiments of the present application.Such as Fig. 5 It is shown, the improper closing of video data file is caused due to restarting etc. power cutoff device, so that the I frame index frame in file comes Not as good as write-in, the I frame for including in the code stream frame having been written into file before causing video data file to be closed is not recorded to I frame In index frame, the I not being recorded cannot be timely and accurately found according to index information in file reading and process of playback of video Frame.
Fig. 6 is a kind of schematic diagram of video data storage method provided by the embodiments of the present application.As shown in fig. 6, from file Head frame starts to read the data in file, and the position of next I frame index frame of record is obtained from each I frame index frame, when When the position of next I frame index frame of I frame index frame recording before file knot exceeds the size of actual file, then, note The position of next I frame index frame of record is invalid, and expression file is improper closing.
After judging file for improper closing, the writing position of the code stream frame of the last one write-in is recorded.It is reopening After video data file, the writing position of the code stream frame of the last one write-in and the I frame index frame note before end of file are obtained The writing position of next I frame index frame of record, to note after the writing position of the code stream frame of the last one write-in of record Null frame is written before the writing position of next I frame index frame of record, null frame is invalid frame.And existing I frame index between caching Information constructs I frame index frame, and when reaching the writing position of next I frame index frame of record, I frame index frame is written.
In a specific example, next I frame index frame of the I frame index frame recording before getting end of file Location information be 500KB, file size only has 300KB when closing, then it represents that next I frame index frame position of record without Effect, supporting paper are improper closing, carry out file reparation.Video data file is reopened, the last one write-in is got Code stream frame writing position and the I frame index frame recording before file knot next I frame index frame writing position, insertion An I frame index frame is written in the null frame polishing data of 200KB.Between code stream frame in without I frame, then in the I frame index frame that is written I frame information is not recorded, it is invalid to be marked as.
In another specific example, the writing position and the I frame before file knot of the code stream frame of the last one write-in Index the code stream frame between the writing position of next I frame index frame of frame recording there are a frame length for 100KB, and the code Stream frame is I frame, then caches the I frame information, and intubating length is the null frame of 100KB.According to the I frame information of caching, I frame index is constructed I frame index frame is written at the position of next I frame index frame of record in frame.
If the improper closing of video data file, can quickly navigate to using method provided by the embodiments of the present application and deposit In abnormal code stream frame position, and the data in polishing file, it is therefore prevented that the video playback as caused by file improper closing In the process the problem of data position inaccurate.
Although video data storage method provided by the present application inserts some null frames during depositing and writing, generation is increased Video data file size, but due to avoid write-back movement, be always write-in in order, greatly improve data The efficiency of storage, meanwhile, by I frame index frame one-way circulation list structure, it is very fast to read all I frame index frames in file Speed, in addition, the later period is as needed to increase other frame types, also very convenient extension.It in actual application, can be further Optimization, be just collectively written into a string of I frame index frames after being stored in multiple I frame data, null frame can be reduced in this way in file overall length Occupation proportion in degree improves the storage efficiency of hard disc data.
Based on the above design, as shown in fig. 7, the application also provides a kind of video data storage device 700, described device 700 may include:
The first I frame is written after at least one code stream frame is written in video data file in first writing unit 701 Index frame, record has the I frame for including at least one described code stream frame in the video data text in the first I frame index frame The writing position of writing position and the next I frame index frame adjacent with the first I frame index frame in part, the first I frame The writing position of index frame is according to the I frame index frame recorded in the upper I frame index frame adjacent with the first I frame index frame What writing position determined;
Second writing unit 702 is used for after the first I frame index frame, after continuing to write at least one code stream frame, When the writing position of the next I frame index frame recorded in reaching the first I frame index frame, the 2nd I frame index frame, institute is written Stating record in the 2nd I frame index frame has the I frame for including at least one the code stream frame continued to write in the video data file In writing position and the next I frame index frame adjacent with the 2nd I frame index frame writing position.
Optionally, the first writing unit 701, be written between the two neighboring I frame index frame in video data file to When a few code stream frame, it is specifically used for:If the length between the writing position of two neighboring I frame index frame is equal to N number of code stream N number of code stream frame is then written in the length of frame between the writing position of two neighboring I frame index frame;If two neighboring I frame index Length between the writing position of frame is greater than the length of N-1 code stream frame and is less than the length of N number of code stream frame, then adjacent two N-1 code stream frame is written between the writing position of a I frame index frame, and null frame is written at vacant place, the null frame is invalid frame.
Optionally, the first I frame index frame also records the frame length for having the I frame for including at least one described code stream frame And timestamp.
Optionally, described device 700 may also include:Third writing unit, for the starting in the video data file File header frame is written in position, and the file header frame recording has writing position of first code stream frame in the video data file With the writing position of first I frame index frame.
Optionally, described device 700 may also include:Recording unit, for continuing after the first I frame index frame It during at least one code stream frame is written, determines that the video data file is closed, records the code stream of the last one write-in The writing position of frame;4th writing unit, for after reopening the video data file, the last one in record to be write The writing position of the next I frame index frame recorded into the first I frame index frame after the writing position of the code stream frame entered it Preceding write-in null frame, the null frame are invalid frame;The next I frame index frame recorded in reaching the first I frame index frame is write When entering position, the 2nd I frame index frame is written.
It can be found in the introduction of the above method about the specific implementation of above-mentioned apparatus 700, details are not described herein.
Above by reference to showing according to the method, apparatus (system) of the embodiment of the present application and/or the frame of computer program product Figure and/or flow chart describe the application.It should be understood that can realize that block diagram and or flow chart is shown by computer program instructions The combination of the block of a block and block diagram and or flow chart diagram for figure.These computer program instructions can be supplied to logical With computer, the processor of special purpose computer and/or other programmable data processing units, to generate machine, so that via meter The instruction that calculation machine processor and/or other programmable data processing units execute creates for realizing block diagram and or flow chart block In specified function action method.
Correspondingly, the application can also be implemented with hardware and/or software (including firmware, resident software, microcode etc.).More Further, the application can take computer usable or the shape of the computer program product on computer readable storage medium Formula has the computer realized in the medium usable or computer readable program code, to be made by instruction execution system It is used with or in conjunction with instruction execution system.In the present context, computer can be used or computer-readable medium can be with It is arbitrary medium, may include, stores, communicates, transmits or transmit program, is made by instruction execution system, device or equipment With, or instruction execution system, device or equipment is combined to use.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of video data storage method, which is characterized in that the method includes:
After at least one code stream frame is written in video data file, the first I frame index frame, the first I frame index frame is written Middle record has writing position of the I frame for including at least one described code stream frame in the video data file and with described the The writing position of the adjacent next I frame index frame of one I frame index frame, the writing position of the first I frame index frame be according to What the I frame index frame writing position recorded in the adjacent upper I frame index frame of the first I frame index frame determined;
After the first I frame index frame, after continuing to write at least one code stream frame, the first I frame index frame is reached When the writing position of next I frame index frame of middle record, the 2nd I frame index frame is written, recording in the 2nd I frame index frame has Writing position of the I frame for including at least one the code stream frame continued to write in the video data file and with described second The writing position of the adjacent next I frame index frame of I frame index frame.
2. the method according to claim 1, wherein the two neighboring I frame index frame in video data file Between at least one code stream frame is written, including:
If the length between the writing position of two neighboring I frame index frame is equal to the length of N number of code stream frame, two neighboring N number of code stream frame is written between the writing position of I frame index frame;
If the length between the writing position of two neighboring I frame index frame is greater than the length of N-1 code stream frame and is less than N number of N-1 code stream frame is then written between the writing position of two neighboring I frame index frame, and writes at vacant place for the length of code stream frame Enter null frame, the null frame is invalid frame.
3. the method according to claim 1, wherein the first I frame index frame, which also records, described at least one The frame length and timestamp for the I frame for including in a code stream frame.
4. the method according to claim 1, wherein the method also includes:
File header frame is written in the initial position of the video data file, the file header frame recording has first code stream frame to exist The writing position of writing position and first I frame index frame in the video data file.
5. the method according to claim 1, wherein the method also includes:
After the first I frame index frame, during continuing to write at least one code stream frame, the video data text is determined Part is closed, and records the writing position of the code stream frame of the last one write-in;
After reopening the video data file, arrived after the writing position of the code stream frame of the last one write-in of record Null frame is written before the writing position of the next I frame index frame recorded in the first I frame index frame, the null frame is invalid Frame;
When the writing position of the next I frame index frame recorded in reaching the first I frame index frame, the 2nd I frame index is written Frame.
6. a kind of video data storage device, which is characterized in that described device includes:
The first I frame index frame is written after at least one code stream frame is written in video data file in first writing unit, Record has the I frame for including at least one described code stream frame in the video data file in the first I frame index frame The writing position of writing position and the next I frame index frame adjacent with the first I frame index frame, the first I frame index frame Writing position be according to the I frame index frame write-in position recorded in the upper I frame index frame adjacent with the first I frame index frame It sets determining;
Second writing unit, for after continuing to write at least one code stream frame, reaching after the first I frame index frame When the writing position of the next I frame index frame recorded in the first I frame index frame, the 2nd I frame index frame of write-in, described second Record has I frame the writing in the video data file for including at least one the code stream frame continued to write in I frame index frame Enter the writing position of position and the next I frame index frame adjacent with the 2nd I frame index frame.
7. device according to claim 6, which is characterized in that first writing unit, in video data file When at least one code stream frame being written between two neighboring I frame index frame, it is specifically used for:
If the length between the writing position of two neighboring I frame index frame is equal to the length of N number of code stream frame, two neighboring N number of code stream frame is written between the writing position of I frame index frame;
If the length between the writing position of two neighboring I frame index frame is greater than the length of N-1 code stream frame and is less than N number of N-1 code stream frame is then written between the writing position of two neighboring I frame index frame, and writes at vacant place for the length of code stream frame Enter null frame, the null frame is invalid frame.
8. device according to claim 6, which is characterized in that the first I frame index frame, which also records, described at least one The frame length and timestamp for the I frame for including in a code stream frame.
9. device according to claim 6, which is characterized in that described device further includes:
Third writing unit, for file header frame, the file header frame note to be written in the initial position of the video data file Record has the writing position of writing position and first I frame index frame of first code stream frame in the video data file.
10. device according to claim 6, which is characterized in that described device further includes:
Recording unit, for during continuing to write at least one code stream frame, determining after the first I frame index frame The video data file is closed, and records the writing position of the code stream frame of the last one write-in;
4th writing unit, for after reopening the video data file, in code stream of the last one write-in of record Sky is written before the writing position of the next I frame index frame recorded after the writing position of frame into the first I frame index frame Frame, the null frame are invalid frame;When the writing position of the next I frame index frame recorded in reaching the first I frame index frame, The 2nd I frame index frame is written.
CN201810679732.6A 2018-06-27 2018-06-27 Video data storage method and device Active CN108833817B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810679732.6A CN108833817B (en) 2018-06-27 2018-06-27 Video data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810679732.6A CN108833817B (en) 2018-06-27 2018-06-27 Video data storage method and device

Publications (2)

Publication Number Publication Date
CN108833817A true CN108833817A (en) 2018-11-16
CN108833817B CN108833817B (en) 2020-09-29

Family

ID=64139292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810679732.6A Active CN108833817B (en) 2018-06-27 2018-06-27 Video data storage method and device

Country Status (1)

Country Link
CN (1) CN108833817B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486910A (en) * 2020-11-23 2021-03-12 天津津航计算技术研究所 Method for rapidly analyzing mass data files
CN113672588A (en) * 2021-07-16 2021-11-19 浙江大华技术股份有限公司 Data storage method, data storage device, storage node and management node
CN114374875A (en) * 2021-12-31 2022-04-19 浙江大华技术股份有限公司 MP4 file recording method and device and readable storage medium
CN114374875B (en) * 2021-12-31 2024-05-28 浙江大华技术股份有限公司 MP4 file recording method, device and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486910A (en) * 2020-11-23 2021-03-12 天津津航计算技术研究所 Method for rapidly analyzing mass data files
CN113672588A (en) * 2021-07-16 2021-11-19 浙江大华技术股份有限公司 Data storage method, data storage device, storage node and management node
CN114374875A (en) * 2021-12-31 2022-04-19 浙江大华技术股份有限公司 MP4 file recording method and device and readable storage medium
CN114374875B (en) * 2021-12-31 2024-05-28 浙江大华技术股份有限公司 MP4 file recording method, device and readable storage medium

Also Published As

Publication number Publication date
CN108833817B (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN103348690B (en) A kind of method and device of Video processing
US8225029B2 (en) Data storage processing method, data searching method and devices thereof
CN106231348B (en) A kind of back method of GOP data, device and system
JP5332773B2 (en) Image processing apparatus and method
CN107870973A (en) A kind of document storage system accelerated multi-path monitoring and played back simultaneously
CN102479249A (en) Method for eliminating cache data of memory of embedded browser
KR102274466B1 (en) Video streaming method using real time caching technique and system thereof
CN102479250A (en) Disk caching method for embedded browser
CN108833817A (en) A kind of video data storage method and device
CN100418071C (en) Method for establishing medium file system
KR101743411B1 (en) Method and apparatus for data access
JP4982383B2 (en) Recording apparatus for recording content on a plurality of recording media and control method therefor
KR100941382B1 (en) Apparatus and method for managing page buffer linked with flash memory and apparatus and method for changing page of flash memory
CN104702874A (en) Storing method for file monitored by video
US8300701B2 (en) Offspeed playback in a video editing system of video data compressed using long groups of pictures
CN103761194B (en) A kind of EMS memory management process and device
US9285996B2 (en) Tape drive buffer utilization
CN103731623B (en) The method and the digital hard disc video recorder that digital hard disc video recorder is recorded a video
JP4325194B2 (en) Apparatus and method for managing access to storage medium
CN116303139A (en) Method, device, equipment and medium for transferring hierarchical cache data
CN102695024A (en) Front-end recording system of network video recorder, and method therefor
CN105592281B (en) MPEG video processing method, device and system
CN100559487C (en) The method and system of the recording capacity of management accounts equipment
CN104980680B (en) A kind of method of video data access
JP4294009B2 (en) Video information recording / reproducing method and video information recording / reproducing apparatus

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