A kind of method and system that video capture is stored, played
Technical field
The present invention relates to a kind of technical field of video processing, more particularly to it is a kind of and meanwhile to video carry out shooting storage,
And the method and system of decompression broadcasting is carried out to video simultaneously.
Background technique
Video file is study and entertainment resource indispensable in people's daily life, shooting, the equipment for playing video
It is to emerge one after another.Widely available with digital technology, present digital electronic goods emerge one after another, nearly all support video
Shooting and broadcasting.But video is when shooting, shooting is entire picture, and also unprocessed when video is stored,
Most of memory headroom of digital electronic goods will be often occupied in this way.
Since there is a large amount of redundancies in video data, thus in order to solve untreated video file occupy it is larger
The problem of memory headroom, sight is concentrated on the huge compression space of video data by everybody, is dedicated to studying the data of video
Compress technique, and many video data compression methods are had also discovered, for example, distributed video compress technique, is based on content
The methods of video compress.Present video data compression method is divided into two classes: one kind is incited somebody to action in video after shooting terminates
Video data uses video data compression to complete video data after exporting in digital electronic goods, through apparatus such as computer
Method is compressed;It is that compression processing is carried out to video data in real time there are also one kind.Use the video data compression side of the first kind
Method can not be handled the video data at digital electronic goods end, and in digital electronic goods, the video data of shooting is still
A large amount of space can so be occupied.And use second type of video data compression method then relatively high to the requirement of digital electronic goods,
Embedded processor need to be configured, in digital electronic goods generally in order to carry out real-time video number to the video data of shooting
According to compression processing, also will inevitably lead to being significantly increased for the cost of digital electronic goods in this way.Therefore, existing video data
Compression method the problem of effective solution video data does not occupy a large amount of memory spaces of digital electronic goods.
Summary of the invention
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of storages of video capture, broadcasting
Method and system, for solve carry out shooting video using digital electronic goods in the prior art when, the video file of shooting
The problem of occupying a large amount of memory sources.
In order to achieve the above objects and other related objects, the present invention provides a kind of video capture storage method, is suitable for number
Code electronic product, comprising: in the state that starting shoots video, the shooting duration of video of monitoring shooting video;Step 2, when the bat
When taking the photograph duration equal to interception time, the video in the shooting duration of video is intercepted, obtains video clip;Step 3 compresses the view
Frequency segment, and save the video clip through overcompression;Step 4, judging whether video shoots terminates: if shooting terminates,
Then video capture storage terminates;If shooting is not over, the shooting duration of video is reset, and gos to step one again.
Preferably, the interception time presets the time for one.
It preferably, further include judging whether the shooting duration of video reaches the interception time in the step 1: if not
Reach the interception time, then the video of shooting duration of video is directly saved as into the video clip, and jumps to the step 4;
If reaching the interception time, the step 2 is jumped to.
Preferably, in the step 3, the video clip through overcompression is stored with video segment compressed package.
Preferably, the video clip or the video segment compressed package for needing to save be with the sequencing of shooting into
Row number name, and be stored in a file.
A kind of video broadcasting method, the video include m file, and the file is that video clip or video clip are compressed
Packet, the m files are name to be numbered according to shooting sequencing, and be stored in same file folder, the video
Playback method includes: step 1, initiation parameter i:i=1;Step 2 judges i-th of file in the file:
If i-th of file is video clip, three are gone to step;If i-th of file is piece of video
Section compressed package then replicates and decompresses video segment compressed package, obtains corresponding video clip, and go to step three;Step 3,
The video clip is played, while playing, judges the parameter i: if i < m, judging the i+1 file: such as
The file of i+1 described in fruit is video clip, then gos to step four;If the i+1 file is video clip
Compressed package then replicates and decompresses the video segment compressed package, obtains corresponding video clip, then gos to step four;If i
=m, then jump directly to step 4;Step 4 judges institute at the end of the corresponding video clip of i-th of file plays
It states parameter i: if i < m, i=i+1, going to step three again;If i=m, video playing terminates.
Preferably, in the step 4, at the end of video clip plays, the memory that video clip occupies is removed.
A kind of video capture storage and play system, be suitable for digital electronic goods, comprising: shooting module, playing module,
Monitoring modular, control module, intercepting compression module, duplication decompression module and memory module;The shooting module is for shooting view
Frequently;The monitoring modular is used to monitor the shooting time of video;The control module is for controlling the shooting module, described broadcasting
Amplification module, the monitoring modular, the intercepting compression module, the duplication decompression module and the memory module;The interception
Compression module is for intercepting video clip, compression video clip acquisition video segment compressed package;The duplication decompression module is used for
Replicating video segment compressed package, decompressing video segment compressed package are to obtain corresponding video clip;The playing module is for broadcasting
Put video clip;The memory module is for saving video segment compressed package.
Preferably, the intercepting compression module is to intercept video clip according to interception time;And when the shooting
When length is less than the interception time, then the video for being less than the interception time is saved as video clip to the memory module
In.
Preferably, the multiple video clips or multiple video segment compressed packages of same video are according to the successive suitable of shooting time
Name and storage is numbered in sequence, and is stored in the same file folder of memory module.
As described above, the method and system that a kind of video capture of the invention is stored, played, the video of shooting is clapped on one side
It takes the photograph and compresses on one side, when compression, interception and compression are segmented according to interception time, save a large amount of memory spaces.After shooting, it will regard
Frequency segment and video segment compressed package through overcompression are stored in a file according to shooting sequencing number name
In.When broadcasting in order, for example video clip then directly plays video clip;For example video segmentation compressed package, then decompressed
For corresponding video clip, then play.And while video clip plays, next file can be judged, such as
Fruit is video segment compressed package, then is replicated decompression to obtain the corresponding video clip that can directly play.Moreover, every
At the end of one video clip plays, digital electronic product can remove this segment data.The present invention is while video capture pair
Filmed video carries out sectional compression storage, while video playing, can decompress simultaneously to video compress segment
And broadcasting, greatly reduce the memory space of video.
Detailed description of the invention
Fig. 1 is shown as a kind of flow diagram of video capture storage method disclosed by the embodiments of the present invention.
Fig. 2 is shown as a kind of flow diagram of the playback method of video disclosed by the embodiments of the present invention.
Fig. 3 is shown as a kind of structural schematic diagram of video capture storage and play system disclosed by the embodiments of the present invention.
Component label instructions
S11~S14 step
S21~S24 step
300 video capture storage and play systems
310 shooting modules
320 playing modules
330 monitoring modulars
340 control modules
350 intercepting compression modules
360 duplication decompression modules
370 memory modules
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification
Other advantages and efficacy of the present invention can be easily understood for disclosed content.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also based on different viewpoints and application, without departing from
Various modifications or alterations are carried out under spirit of the invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It please refers to Fig.1 to Fig.3, it should be noted that diagram provided in following embodiment only illustrates in a schematic way
Basic conception of the invention, only shown in schema then with related component in the present invention rather than package count when according to actual implementation
Mesh, shape and size are drawn, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its
Assembly layout kenel may also be increasingly complex.
Embodiment 1
A kind of video capture storage method for being directed to digital electronic goods is present embodiments provided, as shown in Figure 1, this reality
The video capture storage method for applying example is to carry out compression storage to video data while shooting video, comprising:
Step 1 S11, in the state that starting shoots video, the shooting duration of video of monitoring digital electronic goods shooting video:
The length of video capture is random.For the video of shorter shooting duration of video, the size of video file is relatively
It is smaller, even if therefore it is uncompressed, the memory headroom of the digital electronic goods of occupancy is also smaller, so when to this shooting
Long shorter video can be saved without processing directly as video clip.It in the present embodiment, is to make interception time
For foundation, the video that shooting duration of video is less than interception time is directly saved as video clip;Greater than the view of interception time
Frequently, then need to go to step two.Wherein, interception time is the pre-set time.
Step 2 S12 intercepts the video in the shooting duration of video when shooting duration of video is equal to interception time, obtains piece of video
Section.In the present embodiment, interception time is 5 minutes.
Step 3 S13 compresses the video clip of interception, and saves the video clip through overcompression:
The compress technique of video is very mature, just no longer repeats one by one here.The present embodiment can use above-mentioned side
Method completes the compression to video clip, obtains the video clip through overcompression.Also, the video clip through overcompression is with video
Segment compressed package is saved.
For one section of complete video of shooting, including multiple video segment compressed packages for being stored in same file folder or
Multiple video clips, and multiple video clip or multiple video segment compressed packages are to carry out in the order of shooting time
Number name, in order to judge a complete video multiple video clips and multiple video segment compressed packages it is successive suitable
Sequence.
Step 4 S14, judging whether video shoots terminates: if shooting terminates, video capture storage terminates;If clapped
It takes the photograph and is not finished, then reset shooting duration of video, go to step one again.
Since video capture is not finished, so being monitored again after need to being reset to shooting duration of video.
The video capture storage method of the present embodiment, while shooting video, by the video of shooting according to interception time
Interception is several video clips, and is compressed respectively to several video clips, several video segment compressed packages are obtained, and
In order to facilitate the lookup and broadcasting of complete video, by several video clips or several video clip pressures of a complete video
Contracting packet is stored in same file folder, also, video clip or video segment compressed package are compiled according to the sequencing of shooting
Number name and storage.
Embodiment 2
For the video for using the video storage method of embodiment 1 to store, which includes m file, m file be by
Name is numbered according to shooting sequencing, and is stored in same file folder, file is that video clip or video clip are compressed
Packet, present embodiment discloses a kind of playback methods of video, as shown in Figure 2, comprising:
Step 1 S21, initiation parameter i:i=1.
Step 2 S22 judges i-th of file in video storage file:
If i-th of file is video clip, go to step four S23;
If i-th of file is video segment compressed package, the video segment compressed package is replicated, number is saved it in
In the caching of code electronic product, then decompresses, obtain its corresponding video clip, finally go to step three S23.
Since video is to carry out shooting storage according to the method for embodiment 1, so video is made of multiple files
, and multiple files either video clip can also with video segment compressed package, so before playing out will to file into
Row judgement.And under normal circumstances, video segment compressed package can not be played out directly, it is necessary to decompress it into piece of video
Section, digital electronic goods could be played directly.
Step 3 S23 plays video clip, proceeds as follows simultaneously:
Judge parameter i: if i < m, judging i+1 file: if the i+1 file is video clip,
Go to step four S24;If i+1 file is video segment compressed package, the video segment compressed package is replicated in number
In the caching of code electronic product, then decompression obtains corresponding video clip, then four S24 that go to step;If i=m, directly
Meet four S24 that go to step.
It, can be under while video clip plays although the video of the present embodiment is made of multiple files
One file (video clip or video segment compressed package) carries out judgement processing, to obtain piece of video corresponding to next file
Section.This way it is ensured that the continuity of the broadcasting for the video being made of multiple files.
Step 4 S24 discharges the occupied memory of i-th of file, judges parameter i: such as at the end of video clip plays
Fruit i < m, then i=i+1, go to step three S23 again;If i=m, i.e., the All Files in video all finish, so
Video playing terminates.
The video broadcasting method of the present embodiment is the video stored for the video capture storage method using embodiment 1,
When playing out, compressed package is decompressed in numerical order in the buffer, plays the video of decompression, and in each compressed package
At the end of video playing, the memory of the segment data is removed, then decompresses next video compress packet in the caching again, such as
This greatly reduces the memory space of digital electronic goods occupied by video when playing video.
Embodiment 3
Present embodiment discloses a kind of video capture storage and play systems 300 suitable for digital electronic goods, such as Fig. 3
It is shown, including shooting module 310, playing module 320, monitoring modular 330, control module 340, intercepting compression module 350, duplication
Decompression module 360 and memory module 370.
Video capture storage and play system 300 using control module 340 control shooting module 310, monitoring modular 330,
Intercepting compression module 350 and memory module 370 carry out the shooting of video, and the video of shooting is stored as multiple compressed packages;Control
Record and broadcast amplification module 320, duplication decompression module 360 and memory module 370 carry out the video with multiple compression packet form storages
Decompression and broadcasting.
Wherein, shooting module 310 is used to carry out the shooting of video.Monitoring modular 330 is used to monitor the bat of shooting module 310
Take the photograph the shooting duration of video of video.Control module 340 shoots the shooting of video according to the shooting module 310 that monitoring modular 330 monitors
Duration, control intercepting compression module 350 is intercepted and is compressed to the shooting video in interception time, and will be passed through compressed
Compressed package is stored into memory module 370, is of coursed, the video clip for some shooting duration of video less than interception time, then not
Interception compression processing is carried out, is directly stored into memory module 370, also, when storing a complete shooting video,
Storage is numbered according to the sequencing of shooting in the compressed package of uncompressed video clip or the video clip through overcompression,
And a complete video clip for shooting video or video segment compressed package are stored under same file folder.
When playing video, which includes multiple video clips or video segment compressed package, and multiple video clips or view
Frequency segment compressed package is stored under a file according to shooting sequencing.Control module 340 according to video clip or
The number of video segment compressed package under file each video clip or video segment compressed package handle: it is right first
The video clip or video segment compressed package to be played out are judged, if it is video segment compressed package, pass through duplication
Decompression module 350 is replicated and is decompressed, and is then played in playing module 320 again;It is directly logical if it is video clip
Playing module 320 is crossed to play out video clip.
In conclusion the method and system that a kind of video capture of the invention is stored, played, the video of shooting is clapped on one side
It takes the photograph and compresses on one side, when compression, interception and compression are segmented according to interception time, save a large amount of memory spaces.After shooting, it will regard
Frequency segment and video segment compressed package through overcompression are stored in a file according to shooting sequencing number name
In.When broadcasting in order, for example video clip then directly plays video clip;For example video segmentation compressed package, then decompressed
For corresponding video clip, then play.And while video clip plays, next file can be judged, such as
Fruit is video segment compressed package, then is replicated decompression to obtain the corresponding video clip that can directly play.Moreover, every
At the end of one video clip plays, digital electronic product can remove this segment data.The present invention is while video capture pair
Filmed video carries out sectional compression storage, while video playing, can decompress simultaneously to video compress segment
And broadcasting, greatly reduce the memory space of video.So the present invention effectively overcomes various shortcoming in the prior art and has
High industrial utilization value.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all without departing from the spirit and scope of the present invention, carries out modifications and changes to above-described embodiment.Cause
This, institute is complete without departing from the spirit and technical ideas disclosed in the present invention by those of ordinary skill in the art such as
At all equivalent modifications or change, should be covered by the claims of the present invention.