Summary of the invention
The purpose of the embodiment of the invention provides a kind of method and device of management of video of video monitoring system, can carry out the accurate deletion of video file according to client's indication.
To achieve these goals, on the one hand, provide a kind of method of management of video of video monitoring system, comprised the steps:
Step 1 makes the video flowing of the storing predetermined duration of each video file, and the filename of each described video file contains the rise time of video stream stored to some extent;
Step 2, the removal request of reception client obtains the pairing deletion time period of video flowing that will delete;
Step 3 is searched according to the filename of described video file, and the video file that finds the video flowing that includes the described deletion time period is as file destination;
Step 4, judge whether described file destination institute video stream stored includes the non-deletion video flowing outside the described deletion time period, is then described non-deletion video flowing to be duplicated storage, generates new video file, delete described file destination afterwards, otherwise directly delete described file destination.
Preferably, in the above-mentioned method, in described step 4, described non-deletion video flowing is duplicated storage specifically comprise: locate described non-deletion video flowing by the video index of described file destination, and described non-deletion video flowing is copied in the internal memory.
Preferably, in the above-mentioned method, described video index only generates at described file destination after finding described file destination.
Preferably, in the above-mentioned method, described video index generates simultaneously at each described video file when generating each described video file.
Preferably, in the above-mentioned method, each described video file all includes index area and video recording data field, described video recording data field is used for store video stream, described index area is used to store described video index, and described video index writes down the memory location of each second video data in described video recording data field.
Another aspect of the present invention provides a kind of device of management of video of video monitoring system, it is characterized in that, comprising:
Memory cell is used for: make the video flowing of the storing predetermined duration of each video file, the filename of each described video file contains the rise time of video stream stored to some extent;
Receiving element is used for: receive the removal request of client, obtain the pairing deletion time period of video flowing that will delete;
Search the unit, be used for: the filename according to described video file is searched, and the video file that finds the video flowing that includes the described deletion time period is as file destination;
Delete cells, be used for: judge whether described file destination institute video stream stored includes the non-deletion video flowing outside the described deletion time period, be then described non-deletion video flowing to be duplicated storage, generate new video file, delete described file destination afterwards, otherwise directly delete described file destination.
Preferably, in the above-mentioned device, also include internal memory, be used for the described non-deletion video flowing of buffer memory.
Preferably, in the above-mentioned device, also comprise the index generation unit, be used for: generate video index to described file destination or to each described video file, described video index writes down each second video data memory location hereof.
There is following technique effect at least in the embodiment of the invention:
1) the non-deletion video flowing in the file destination is duplicated and generate new video file, can accomplish accurate deletion, avoid deleting more and deleting less.
2) according to video recording rise time name video file, can be by the very fast file destination that finds the needs deletion of filename.
3) video file all has scheduled duration, time is generally not long, most of file destination all is whole deletion, the file that only is in the beginning and end of deletion time period just relates to the part deletion, because want the non-deleted file of copying and saving very short, when ensureing accurately deletion, it is very short that the spent time is handled in deletion.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention is clearer, specific embodiment is described in detail below in conjunction with accompanying drawing.
The embodiment of the invention provides a kind of video recording delet method that can realize specifying the precise time section from customer demand.Under the file system of video recording server, video file adopts the mode of pressing one of certain hour section generation; The video file name is used the video recording rise time, and video file is made of video recording data and file index district, and the file index district has marked the position in the video file of video file each second video recording place, and video file leaves on the storage server; The client specifies the time period of deletion video recording to send to storage server; Storage server is searched the file that comprises this section period according to the time period that receives.Having following several situation during this period of time exists in the video file:
The one, be present in a certain complete video file or the video file that some is complete, directly delete these video files;
The 2nd, what be present in a certain video file begins to certain position, centre of this video file or certain position, centre of next video file from video file;
The 3rd, certain position, centre that is present in a certain video file is to the end position of this file or certain position, centre of other video files;
The 4th, certain position, centre that is present in a certain video file is to the next position of the centre of this file or certain position, centre of other video files;
For situation two to situation four, to begin or the end position of recording a video according to the video recording that finds, after the video file data that does not need to delete regenerated one or more new video files, and generate the filename of new video file, thereby delete the video recording deletion that original video file is realized the precise time section then according to the video time of reading the video recording index area.
The flow chart of steps of the method that Fig. 1 provides for the embodiment of the invention, as figure, the method for the management of video of video monitoring system comprises:
Step 101 makes the video flowing of the storing predetermined duration of each video file, and the filename of each described video file contains the rise time of video stream stored to some extent;
Step 102, the removal request of reception client obtains the pairing deletion time period of video flowing that will delete;
Step 103 is searched according to the filename of described video file, and the video file that finds the video flowing that includes the described deletion time period is as file destination;
Step 104, judge whether described file destination institute video stream stored includes the non-deletion video flowing outside the described deletion time period, be then described non-deletion video flowing to be duplicated storage, generate new video file, delete described file destination afterwards, otherwise directly delete described file destination.
Below be that example makes a more detailed description with the concrete time period.
Video recording server real-time storage video file, for example per 5 minutes video recording (video flowing) generates a video file, if since the video recording of six o'clock, then the video file that generates successively is 6:00,6:05,6:10,6:15,6:20.......
Suppose that the client will delete the video flowing in the 6:02-6:12 time period, the server of then recording a video is searched, and finds that the file that comprises the video flowing that will delete has: 6:00,6:05, three files of 6:10.
Wherein all video flowings among the 6:05 (time period of institute store video stream is 6:05-6:10) are all within the time period 6:02-6:12 that will delete, so the 6:05 file can directly be deleted.
The structure chart of the video file that Fig. 2 provides for the embodiment of the invention;
For the 6:00 file, because the video in the 6:00-6:02 time period can not be deleted, its processing procedure is as follows: the video index of the index area by the 6:00 file, and the video of searching 6: 02: 00 is at the particular location of video recording data field; Begin reading of data from the beginning of video recording data field, read till the data of locating in 00 second in 02 minute in 6 o'clock, the storage that is read (also can directly store the presumptive area as buffer memory on the hard disk into) in internal memory; Deletion 6:00 file generates new 6:00 file (storing on the hard disk) with the data of storing in the internal memory.
For the 6:10 file, because the video in the 6:13-6:15 time period can not be deleted, its processing procedure is as follows: the video index of the index area by the 6:10 file, and the video of searching 6: 13: 00 is at the particular location of video recording data field; Begin to read from 6: 13: 00 data of video recording data field, read till the data that end of file (6:15) locates, the storage that is read is in internal memory; Deletion 6:10 file generates new 6:13 file with the data of storing in the internal memory.
What described video index write down is the memory location of each second video data in the video recording data field of file.Video index can generate at each described video file when generating each described video file simultaneously, but can relatively expend system resource like this, a lot of files may always can not used index, therefore, also can after finding described file destination, only generate video index at described file destination, (this length does not influence response speed with the time that generates index and is advisable and because each file all has predetermined length, for example 4 minutes 5 minutes or 6 minutes), so can not influence reaction speed.
The embodiment of the invention also provides a kind of device of management of video of video monitoring system, the structure chart of the device that Fig. 3 provides for the embodiment of the invention, and device 20 comprises:
Memory cell 21 is used for: make the video flowing of the storing predetermined duration of each video file, the filename of each described video file contains the rise time of video stream stored to some extent;
Receiving element 22 is used for: receive the removal request of client, obtain the pairing deletion time period of video flowing that will delete;
Search unit 23, be used for: the filename according to described video file is searched, and the video file that finds the video flowing that includes the described deletion time period is as file destination;
Delete cells 24, be used for: judge whether described file destination institute video stream stored includes the non-deletion video flowing outside the described deletion time period, be then described non-deletion video flowing to be duplicated storage, generate new video file, delete described file destination afterwards, otherwise directly delete described file destination.
Also include internal memory, be used for the described non-deletion video flowing of buffer memory.
Also comprise the index generation unit, be used for: generate video index to described file destination or to each described video file, described video index writes down each second video data memory location hereof.
As from the foregoing, the embodiment of the invention has following advantage:
1) the non-deletion video flowing in the file destination is duplicated and generate new video file, can accomplish accurate deletion, avoid deleting more and deleting less.
2) according to video recording rise time name video file, can be by the very fast file destination that finds the needs deletion of filename.
3) video file all has scheduled duration, time is generally not long, most of file destination all is whole deletion, the file that only is in the beginning and end of deletion time period just relates to the part deletion, because want the non-deleted file of copying and saving very short, when ensureing accurately deletion, it is very short that the spent time is handled in deletion.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.