A kind of method using a variety of compress mode recorded videosTechnical field
The present invention relates to video record field, more particularly to a kind of method using a variety of compress mode recorded videos.
Background technology
At present, video monitoring system has had been directed to all trades and professions of social life, such as traffic intersection, supermarket, silverRow, station and residential area etc., at the same time, also match somebody with somebody in guard's work in various large-scale activity places and important defendance regionMany monitoring devices, such as Olympic Games place, People's Square, Expo Site are put.At the same time, due to magnanimity monitor video numberAccording to appearance, fully rely on the traditional video surveillance system manually supervised and be unable to meet demand, people need it is more intelligent,Automation, the video monitoring system of autonomy-oriented, therefore intelligent video monitoring system become lifting video monitoring system efficiencyThe main direction of development.
It is increasing to possess the electronic product of recording function on the market, but these electronic product overwhelming majority are required for possessingThe caching process that video process provides picture is saved as in larger.However, with the compression of electronic product production cost, how to causeProduct ensures its equal function while production cost is reduced, such as which data can be differentiated is key data, whichData are low priority data, turn into the focus of industry research to improve the competitiveness of electronic product.
The content of the invention
It is existing to solve it is an object of the present invention to provide a kind of method using a variety of compress mode recorded videosThe problem of can not carrying out classified compression to video in technology.
Especially, the invention provides a kind of method using a variety of compress mode recorded videos, including:
S1, record command is received, creates a recorded file in memory, and gather video data, by the video of collectionData buffer storage is into internal memory random access memory;Wherein, video data is the raw image data captured by camera sensor;
S2, when the video data in the random access memory reaches a preset value, continue to gather video data, wherein,The residual memory space of the memory is detected, when the residual memory space of the memory is less than preset value, described in traversalVideo data in random access memory, moving target will be included in the video data in the random access memory respectively and do not includedThe data content of moving target carries out video compress with different compress modes;
S3, the video data after compression is write into recorded file.
Alternatively, the different compress mode, which carries out video compress, includes:
Obtain at least two frames of the difference preset time in video;
Contrast the pattern of two frame;
If the pattern of two frame is approximate, the first compress mode is taken, if the pattern of two frame is had any different, is takenSecond of compress mode.
Alternatively, the different compress mode includes H.26X series, MPEG series etc..
Alternatively, the first compress mode or the second compress mode are used when starting recorded video, when the figure of two frameDuring case approximation, the compress mode is constant;When the pattern of two frame is had any different, the compress mode changes.
Alternatively, video compress is the video file with the first default definition by shown first compress mode, describedVideo file compression is the video file with the second default definition by the second compress mode.
Alternatively, the video file with the first default definition of equal time is preset clearly with described with secondThe internal memory that the video file of clear degree takes is different.
Alternatively, the preset time is 1S.
The method using a variety of compress mode recorded videos of the present invention, due to respectively by regarding in the random access memoryData content of the frequency in comprising moving target and not comprising moving target carries out video compress with different compress modes, becauseThis can farthest save storage internal memory, moreover it is possible to information be classified, it is ensured that important information completely preserves.
Further, the pattern correspondance at least two frames that the present invention passes through the difference preset time in video, to carry out notSame compress mode carries out video compress, can effectively improve recognition efficiency, reduces error.
According to the accompanying drawings will be brighter to the detailed description of the specific embodiment of the invention, those skilled in the artAbove-mentioned and other purposes, the advantages and features of the present invention.
Brief description of the drawings
Some specific embodiments of the present invention are described in detail by way of example, and not by way of limitation with reference to the accompanying drawings hereinafter.Identical reference denotes same or similar part or part in accompanying drawing.It should be appreciated by those skilled in the art that theseWhat accompanying drawing was not necessarily drawn to scale.In accompanying drawing:
Fig. 1 is the schematic flow of the method according to an embodiment of the invention using a variety of compress mode recorded videosFigure.
Embodiment
Fig. 1 is the schematic flow of the method according to an embodiment of the invention using a variety of compress mode recorded videosFigure.As shown in figure 1, included using the method for a variety of compress mode recorded videos:
S1, record command is received, creates a recorded file in memory, and gather video data, by the video of collectionData buffer storage is into internal memory random access memory;Wherein, video data is the raw image data captured by camera sensor;
S2, when the video data in the random access memory reaches a preset value, continue to gather video data, wherein,The residual memory space of the memory is detected, when the residual memory space of the memory is less than preset value, described in traversalVideo data in random access memory, moving target will be included in the video data in the random access memory respectively and do not includedThe data content of moving target carries out video compress with different compress modes;
S3, the video data after compression is write into recorded file.
The method using a variety of compress mode recorded videos of the present invention, due to respectively by regarding in the random access memoryData content of the frequency in comprising moving target and not comprising moving target carries out video compress with different compress modes, becauseThis can farthest save storage internal memory, moreover it is possible to information be classified, it is ensured that important information completely preserves.
In one embodiment of the invention, the different compress mode, which carries out video compress, includes:
Obtain at least two frames of the difference preset time in video;
Contrast the pattern of two frame;
If the pattern of two frame is approximate, the first compress mode is taken, if the pattern of two frame is had any different, is takenSecond of compress mode.
In other embodiments, video data can also be classified using other modes, such as, according to patternColor-values etc..
Further, the pattern correspondance at least two frames that the present invention passes through the difference preset time in video, to carry out notSame compress mode carries out video compress, can effectively improve recognition efficiency, reduces error.
In one embodiment of the invention, the different compress mode includes H.26X series, MPEG series etc..In the other embodiment of the present invention, video file can also be compressed using other compress modes, to reduce video textThe internal memory of part, increase recording time.
In one embodiment of the invention, the first compress mode or the second compression side are used when starting recorded videoFormula, two frames of video data are contrasted at any time, when the pattern approximation of two frame, the compress mode is constant;WhenWhen the pattern of two frame is had any different, the compress mode changes.
In yet another embodiment of the present invention, video compress is default clear with first by shown first compress modeVideo file compression is the video file with the second default definition by the video file of degree, second compress mode.
In another embodiment of the present invention, the video file with the first default definition of equal time withThe internal memory that there is the second video file for presetting definition to take is different.
In the further embodiment of the present invention, the preset time is 1S.In other embodiments, can be withIt it is the time that other arbitrarily set, depending on the concrete condition of place to use.
So far, although those skilled in the art will appreciate that detailed herein have shown and described multiple showing for the present inventionExample property embodiment, still, still can be direct according to present disclosure without departing from the spirit and scope of the present inventionIt is determined that or derive many other variations or modifications for meeting the principle of the invention.Therefore, the scope of the present invention is understood that and recognizedIt is set to and covers other all these variations or modifications.