Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide the method and system that a kind of video capture stores, plays, when using digital electronic goods to carry out capture video for solving in prior art, the video file of shooting occupies the problem of a large amount of memory source.
For achieving the above object and other relevant objects, the invention provides a kind of video capture storage means, be applicable to digital electronic goods, comprise: under the state starting capture video, the shooting duration of monitoring capture video; Step 2, when described shooting duration equals the intercepting time, intercepts the video in described shooting duration, obtains video segment; Step 3, compresses described video segment, and preserves the described video segment through overcompression; Step 4, judges whether video takes end: if shooting terminates, then video capture stores and terminates; If shooting does not terminate, then reset described shooting duration, and again jump to step one.
Preferably, the described intercepting time is one pre-set the time.
Preferably, also comprise and judge whether described shooting duration reaches the described intercepting time in described step one: if do not reach the described intercepting time, then the direct video by shooting duration saves as described video segment, and jumps to described step 4; If reach the described intercepting time, then jump to described step 2.
Preferably, in described step 3, the described video segment through overcompression stores with video segment compressed package.
Preferably, need the described video segment of preservation or described video segment compressed package to be that the sequencing taken is numbered name, and be kept in a file.
A kind of video broadcasting method, described video comprises m file, described file is video segment or video segment compressed package, m described file is numbered name according to shooting sequencing, and be kept in identical file folder, the player method of described video comprises: step one, initiation parameter i:i=1; Step 2, judges i-th described file in described file: if described i-th described file is video segment, then jump to step 3; If described i-th described file is video segment compressed package, then copy and decompress(ion) video segment compressed package, obtain corresponding video segment, and jump to step 3; Step 3, plays described video segment, while broadcasting, judges described parameter i: if i<m, then judges the i-th+1 described file: if described the i-th+1 described file is video segment, then jump to step 4; If the i-th+1 described file is video segment compressed package, then copy and video segment compressed package described in decompress(ion), obtain corresponding video segment, then jump to step 4; If i=m, then directly jump to step 4; Step 4, at the end of the video segment that i-th described file is corresponding is play, judge described parameter i: if i<m, then i=i+1, jumps to step 3 again; If i=m, then video playback terminates.
Preferably, in described step 4, at the end of video segment is play, the internal memory that video segment occupies is eliminated.
A kind of video capture stores and Play System, is applicable to digital electronic goods, comprises: taking module, playing module, monitoring modular, control module, intercepting compression module, copy decompression module and memory module; Described taking module is used for capture video; Described monitoring modular is for monitoring the shooting time of video; Described control module for control described taking module, described playing module, described monitoring modular, described intercepting compression module, described in copy decompression module and described memory module; Described intercepting compression module is for intercepting video segment, compressed video fragment acquisition video segment compressed package; Describedly copy decompression module for replicating video fragment compressed package, decompressing video fragment compressed package to obtain corresponding video segment; Described playing module is used for displaying video fragment; Described memory module is for preserving video segment compressed package.
Preferably, described intercepting compression module intercepts video segment according to the intercepting time; And when described shooting duration is less than the described intercepting time, then the video being less than the described intercepting time is saved in described memory module as video segment.
Preferably, multiple video segment of same video or multiple video segment compressed package are numbered name according to the sequencing of shooting time and store, and are stored in the identical file folder of memory module.
As mentioned above, the method and system that a kind of video capture of the present invention stores, plays, takes the video of shooting and compresses, and during compression, intercepts and compression, save a large amount of memory space according to intercepting time slice.After shooting terminates, name according to shooting sequencing numbering by video segment with through the video segment compressed package of overcompression, and be kept in a file.During broadcasting in order, as being video segment, then video segment is play-overed; As being video segmentation compressed package, being then corresponding video segment by its decompress(ion), then playing.And while video segment is play, can judge next file, if be video segment compressed package, then be copied decompress(ion) to obtain the corresponding video segment that can play-over.And at the end of each video segment is play, this segment data can be removed by digital electronic product.The present invention carries out sectional compression storage to the video taken while video capture, while video playback, can carry out decompress(ion) and broadcasting simultaneously, greatly reduce the memory space of video to video compression fragment.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this specification can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this specification also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
Refer to Fig. 1 to Fig. 3, it should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Embodiment 1
Present embodiments provide a kind of video capture storage means being directed to digital electronic goods, as shown in Figure 1, the video capture storage means of the present embodiment capture video while, carries out compression to video data store, and comprising:
Step one S11, under the state starting capture video, the shooting duration of monitoring digital electronic goods capture video:
The length of video capture is random.For the video of shorter shooting duration, the size of its video file is relatively also smaller, even if therefore uncompressed, the memory headroom of the digital electronic goods taken is also smaller, so the video shorter to this shooting duration can not be treated, directly preserve as video segment.In the present embodiment, be using the intercepting time as foundation, shooting duration be less than the video of intercepting time and directly preserve as video segment; Be greater than the video of intercepting time, then need to jump to step 2.Wherein, the intercepting time is the time pre-set.
Step 2 S12, when taking duration and equaling the intercepting time, intercepts the video in this shooting duration, obtains video segment.In the present embodiment, the intercepting time is 5 minutes.
Step 3 S13, the video segment that compression intercepts, and preserve the video segment through overcompression:
The compress technique of video is very ripe, just repeats no longer one by one here.The compression that the present embodiment can adopt said method to come video segment, obtains the video segment through overcompression.Further, the video segment through overcompression is preserved with video segment compressed package.
For the video that one section of shooting is complete, comprise be stored in same file folder in multiple video segment compressed package or multiple video segment, and the plurality of video segment or multiple video segment compressed package are numbered name with the sequencing of shooting time, so that judge multiple video segment of a complete video and the sequencing of multiple video segment compressed package.
Step 4 S14, judges whether video takes end: if shooting terminates, then video capture stores and terminates; If shooting does not terminate, then reset shooting duration, again jump to step one.
Because video capture does not terminate, so after need resetting shooting duration, again monitor.
The video capture storage means of the present embodiment, while capture video, the video of shooting is intercepted as some video segments according to the intercepting time, and respectively some video segments are compressed, obtain several video segment compressed packages, and conveniently the searching and playing of complete video, several video segments of a complete video or several video segment compressed packages are stored in identical file folder, further, video segment or video segment compressed package are numbered name according to the sequencing of shooting and store.
Embodiment 2
For the video using the video storage method of embodiment 1 to store, this video comprises m file, m file is numbered name according to shooting sequencing, and be kept in identical file folder, file is video segment or video segment compressed package, present embodiment discloses a kind of player method of video, as shown in Figure 2, comprising:
Step one S21, initiation parameter i:i=1.
Step 2 S22, judges i-th described file in video storing documents folder:
If i-th described file is video segment, so jump to step 4 S23;
If i-th described file is video segment compressed package, then copies this video segment compressed package, be kept in the buffer memory of digital electronic goods, then decompress(ion), obtain the video segment of its correspondence, finally jump to step 3 S23.
Because video carries out taking according to the method for embodiment 1 storing, so video is made up of multiple file, and multiple file both can be video segment also can video segment compressed package, so will judge file before playing.And generally, video segment compressed package cannot directly be play, must be video segment by its decompress(ion), digital electronic goods could directly be play.
Step 3 S23, displaying video fragment, proceeds as follows simultaneously:
Judge parameter i: if i<m, then judge the i-th+1 file: if the i-th+1 described file is video segment, then jump to step 4 S24; If the i-th+1 file is video segment compressed package, then copy this video segment compressed package in the buffer memory of digital electronic goods, then decompress(ion) obtains corresponding video segment, then jumps to step 4 S24; If i=m, then directly jump to step 4 S24.
Although the video of the present embodiment is made up of multiple file, while video segment is play, judgement process can be carried out, to obtain the video segment corresponding to next file to next file (video segment or video segment compressed package).Like this, ensure that the continuity of the broadcasting of the video be made up of multiple file.
Step 4 S24, at the end of video segment is play, discharge the internal memory shared by i-th file, judge parameter i: if i<m, then i=i+1, jumps to step 3 S23 again; If i=m, the All Files namely in video all finishes, so video playback terminates.
The video broadcasting method of the present embodiment is the video for using the video capture storage means of embodiment 1 to store, when playing, order is by compressed package decompress(ion) in the buffer by number, play the video of decompress(ion), and at the end of the video playback of each compressed package, remove the internal memory of this segment data, then the next video compression bag of decompress(ion) in this buffer memory again, so, when displaying video, greatly reduce the memory space of the digital electronic goods occupied by video.
Embodiment 3
Present embodiment discloses a kind of video capture being applicable to digital electronic goods to store and Play System 300, as shown in Figure 3, comprise taking module 310, playing module 320, monitoring modular 330, control module 340, intercept compression module 350, copy decompression module 360 and memory module 370.
Video capture stores and Play System 300 uses control module 340 to control taking module 310, monitoring modular 330, intercepting compression module 350 and memory module 370 to carry out the shooting of video, and is multiple compressed package by the video storage of shooting; Control playing module 320, copy decompression module 360 and memory module 370 decompress(ion) and broadcasting are carried out to the video stored with multiple compressed package form.
Wherein, taking module 310 is for carrying out the shooting of video.Monitoring modular 330 is for monitoring the shooting duration of the capture video of taking module 310.The shooting duration of taking module 310 capture video that control module 340 monitors according to monitoring modular 330, control to intercept compression module 350 intercept the capture video in the intercepting time and compress, and the compressed package after overcompression is stored in memory module 370, of course, for the video segment of some shooting durations less than the time of intercepting, then do not carry out intercepting compression process, directly be stored in memory module 370, and, when the capture video that storage one is complete, the video segment of uncompressed or be numbered storage according to the sequencing of shooting through the compressed package of the video segment of overcompression, and under the video segment of a complete capture video or video segment compressed package be stored in same file folder.
During displaying video, this video comprises multiple video segment or video segment compressed package, and under multiple video segment or video segment compressed package be stored in a file according to shooting sequencing.Control module 340 processes each video segment under file or video segment compressed package according to the numbering of video segment or video segment compressed package: first judge the video segment that will play or video segment compressed package, if be video segment compressed package, then undertaken copying and decompressing by copying decompression module 350, and then play in playing module 320; If be video segment, then directly to be play by playing module 320 pairs of video segments.
In sum, the method and system that a kind of video capture of the present invention stores, plays, takes the video of shooting and compresses, and during compression, intercepts and compression, save a large amount of memory space according to intercepting time slice.After shooting terminates, name according to shooting sequencing numbering by video segment with through the video segment compressed package of overcompression, and be kept in a file.During broadcasting in order, as being video segment, then video segment is play-overed; As being video segmentation compressed package, being then corresponding video segment by its decompress(ion), then playing.And while video segment is play, can judge next file, if be video segment compressed package, then be copied decompress(ion) to obtain the corresponding video segment that can play-over.And at the end of each video segment is play, this segment data can be removed by digital electronic product.The present invention carries out sectional compression storage to the video taken while video capture, while video playback, can carry out decompress(ion) and broadcasting simultaneously, greatly reduce the memory space of video to video compression fragment.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.