Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Embodiment 1
The embodiment of the invention provides a kind of method of video record, and as shown in Figure 1, this method comprises:
101, when needs are recorded current video, in coding side or decoding end coded system according to video code flow, obtain selected constantly the reconstructed image of corresponding frame of video, the described selected moment is the moment that begins to record the current video code stream.The described selected moment can need begin to record any time of present image for the user, and the embodiment of the invention does not limit this.
Wherein, described coded system according to video code flow, the reconstructed image that obtains the corresponding frame of video of selected institute constantly comprises: when the coded system of described video code flow is single reference frame coded system, obtain a frame reconstructed image that begins from the selected moment; When the coded system of described video code flow is the multi-reference frame coded system, obtain the corresponding multiframe reconstructed image that constantly begins from selected.
102, described reconstructed image is carried out lossless compression-encoding, obtain the video code flow behind the lossless compression-encoding.
Wherein, any lossless compression-encoding may be used in the embodiment of the invention in the prior art, and the invention process does not limit this, but the lossless coding mode that adopts is corresponding with the coded system that coding side is adopted; For example, when described coding side adopted that H.264 the coded system of consensus standard is encoded, described lossless compression-encoding can be encoded for I_PCM.
103, the video code flow behind the described lossless compression-encoding is deposited in the recording and storing device, and the video code flow of described reconstructed image successive image correspondence is directly deposited in the described recording and storing device.
Wherein, described recording and storing device can for but be not limited to hard disk, any memory device that can be used for the store video code stream all can be used for the embodiment of the invention, the embodiment of the invention does not limit this.
In the embodiment of the invention, when carrying out video record, according to the coded system of video code flow the reconstructed image of corresponding frame of video is carried out lossless compression-encoding, do not need again image during the decoding of video code flow behind the lossless compression-encoding with reference to the front, the code stream of back is at most only with reference to current frame image, therefore avoided the dependence of inter coded images, realized from any time recorded video content to previous image; And when video code flow is recorded, after this reconstructed image carried out depositing in the recording and storing device behind the lossless compression-encoding, the subsequent video code stream that described coding side has been encoded is directly recorded, the process of storage after image behind the coding of having avoided receiving is decoded and encoded, thereby, guaranteed the video record quality not increasing operand, not increasing under the prerequisite of peripheral hardware; In a word, the technical scheme that the embodiment of the invention provides is not increasing operand, is not increasing peripheral hardware, and guarantees to have realized from any time recorded video content under the prerequisite of video record quality.
Embodiment 2
The embodiment of the invention provides a kind of method of video record, wherein, the method of video record can be implemented at the video coding end, also can implement at the video decode end, the embodiment of the invention is an example to implement video record at the video decode end, the concrete method of setting forth video record, as shown in Figure 2, this method comprises:
201, decoding end receiver, video code stream with the described video code flow formation reconstructed image of decoding, and is play described reconstructed image and is shown.
202, described decoding end described video code flow is decoded play to show in, whether need record current video, when detecting need record current video the time execution in step 203 if detecting; When detecting when not needing to record current video, do not carry out recording of current video.
203, judge whether to record a selected frame or the multiframe reconstructed image that constantly begins, if judging to record selectes a frame or the multiframe reconstructed image that constantly begins, then execution in step 204; If judge and do not record a selected frame or the multiframe reconstructed image that constantly begins, then execution in step 207.
Wherein, the described selected moment is the moment that begins to record the current video code stream.The described selected moment can need begin to record any time of present image for the user, and the embodiment of the invention does not limit this.
204,, determine and obtain a frame or multiframe reconstructed image that the selected moment begins according to the coded system of video code flow.
Wherein, the coded system of described video code flow comprises single reference frame coding and multi-reference frame coded system; When the coded system of described video code flow is single reference frame coded system, obtain a selected frame reconstructed image that constantly begins; When the coded system of described video code flow is the multi-reference frame coded system, obtain the corresponding multiframe reconstructed image that constantly begins from selected.
205, described decoding end is carried out lossless compression-encoding with the described reconstructed image that obtains, and obtains the video code flow behind the lossless compression-encoding.
Wherein, any lossless compression-encoding may be used in the embodiment of the invention in the prior art, and the invention process does not limit this, but the lossless coding mode that adopts is corresponding with the coded system that coding side is adopted; For example, when described coding side adopted that H.264 the coded system of consensus standard is encoded, described lossless compression-encoding can be encoded for I_PCM; In agreement H.264, a two field picture is divided into several macro blocks (MB), for example, when image adopted the sampling of 4:2:0 form, a MB comprised the luminance block of a 16x16 pixel and the chrominance block of 2 8x8 pixels.This kind I_PCM coding mode is a kind of macro-block coding pattern, is meant each MB in the two field picture is not compressed, directly to the brightness of this macro block, the coding mode that the chroma pixel value is encoded.
206, the video code flow of described decoding end after with described lossless compression-encoding deposits in the recording and storing device.
Wherein, described recording and storing device can for but be not limited to hard disk, any memory device that can be used for the store video code stream all can be used for the embodiment of the invention, the embodiment of the invention does not limit this.
207, described decoding end directly deposits the video code flow of described reconstructed image successive image correspondence in the described recording and storing device, and the video code flow of the described reconstructed image successive image correspondence that promptly described decoding end will receive directly deposits in the described recording and storing device.
Wherein, directly deposit the video code flow of described reconstructed image successive image correspondence in the described recording and storing device process in described decoding end, this method also comprises: whether the frame of video sequence number of judging the frame of video sequence number of video code flow of described successive image correspondence and reconstructed image is continuous; If the frame of video sequence number of the video code flow of the described successive image correspondence of judgement and the frame of video sequence number of reconstructed image are discontinuous, then adjust the frame of video sequence number of the video code flow of described successive image correspondence, make the frame of video sequence number of itself and reconstructed image continuous, and the video code flow of the successive image correspondence after the described adjustment frame of video sequence number is directly deposited in the described recording and storing device.
In the embodiment of the invention, when carrying out video record, according to the coded system of video code flow the reconstructed image of corresponding frame of video is carried out lossless compression-encoding, do not need again image during the decoding of video code flow behind the lossless compression-encoding with reference to the front, the code stream of back is at most only with reference to current frame image, therefore avoided the dependence of inter coded images, realized from any time recorded video content to previous image; And when video code flow is recorded, after this reconstructed image carried out depositing in the recording and storing device behind the lossless compression-encoding, the video code flow that the described coding side that receives has been encoded is directly recorded, the process of storage after image behind the coding of having avoided receiving is decoded and encoded, thereby, guaranteed the video record quality not increasing operand, not increasing under the prerequisite of peripheral hardware; In a word, the technical scheme that the embodiment of the invention provides is not increasing operand, is not increasing peripheral hardware, and guarantees to have realized from any time recorded video content under the prerequisite of video record quality.
Embodiment 3
The embodiment of the invention provides a kind of method of video record, is example to implement video record at the video coding end, specifically sets forth the method for video record, and as shown in Figure 3, this method comprises:
301, the video code flow after coding side will be encoded sends to the video code flow receiving terminal, so that described receiving terminal is after receiving this video code flow, described video code flow decoded play to be shown.
Whether when 302, the video code flow after described coding side will be encoded sends, detecting needs to record current video, when detecting need record current video the time execution in step 303; When detecting when not needing to record current video, do not carry out recording of current video.
303, described coding side judges whether to record a selected frame or the multiframe reconstructed image that constantly begins, if judging to record selectes a frame or the multiframe reconstructed image that constantly begins, then execution in step 304; If judge and do not record a selected frame or the multiframe reconstructed image that constantly begins, then execution in step 307.
Wherein, the described selected moment is the moment that begins to record the current video code stream.The described selected moment can need begin to record any time of present image for the user, and the embodiment of the invention does not limit this.
304, described coding side is according to the coded system of video code flow, determines and obtains a frame or the multiframe reconstructed image that constantly begins from selected.
Wherein, the coded system of described video code flow comprises single reference frame coding and multi-reference frame coded system; When the coded system of described video code flow is single reference frame coded system, obtain a frame reconstructed image that constantly begins from selected; When the coded system of described video code flow is the multi-reference frame coded system, obtain the corresponding multiframe reconstructed image that constantly begins from selected.
305, described coding side carries out lossless compression-encoding with the described reconstructed image that obtains, and obtains the video code flow behind the lossless compression-encoding.
Wherein, any lossless compression-encoding may be used in the embodiment of the invention in the prior art, and the invention process does not limit this, but the lossless coding mode that adopts is corresponding with the coded system that coding side is adopted; For example, when described coding side adopted that H.264 the coded system of consensus standard is encoded, described lossless compression-encoding can be encoded for I_PCM; In agreement H.264, a two field picture is divided into several macro blocks (MB), for example, when image adopted the sampling of 4:2:0 form, a MB comprised the luminance block of a 16x16 pixel and the chrominance block of 2 8x8 pixels.This kind I_PCM coding mode is a kind of macro-block coding pattern, is meant each MB in the two field picture is not compressed, directly to the brightness of this macro block, the coding mode that the chroma pixel value is encoded.
306, the video code flow of described coding side after with described lossless compression-encoding deposits in the recording and storing device.
Wherein, described recording and storing device can for but be not limited to hard disk, any memory device that can be used for the store video code stream all can be used for the embodiment of the invention, the embodiment of the invention does not limit this.
307, described coding side directly deposits the video code flow of its described reconstructed image successive image correspondence of having encoded in the described recording and storing device.
Wherein, directly deposit the video code flow of described reconstructed image successive image correspondence in the described recording and storing device process in described decoding end, this method also comprises: whether the frame of video sequence number of judging the frame of video sequence number of video code flow of described successive image correspondence and reconstructed image is continuous; If the frame of video sequence number in the video code flow of the described successive image correspondence of judgement and the frame of video sequence number of reconstructed image are discontinuous, then adjust the frame number of the video code flow of described successive image correspondence, make the frame of video sequence number of itself and reconstructed image continuous, and the video code flow of the successive image correspondence of described adjustment is directly deposited in the described recording and storing device.
In the embodiment of the invention, when carrying out video record, according to the coded system of video code flow the reconstructed image of corresponding frame of video is carried out lossless compression-encoding, do not need again image during the decoding of video code flow behind this lossless compression-encoding with reference to the front, the code stream of back is at most only with reference to current frame image, therefore avoided the dependence of inter coded images, realized from any time recorded video content to previous image; And when video code flow is recorded, after this reconstructed image carried out depositing in the recording and storing device behind the lossless compression-encoding, the subsequent video code stream that described coding side has been encoded is directly recorded, the process of storage after image behind the coding of having avoided receiving is decoded and encoded, thereby, guaranteed the video record quality not increasing operand, not increasing under the prerequisite of peripheral hardware; In a word, the technical scheme that the embodiment of the invention provides is not increasing operand, is not increasing peripheral hardware, and guarantees to have realized from any time recorded video content under the prerequisite of video record quality.
Embodiment 4
The embodiment of the invention provides a kind of device of video record, and this device can be the video coding end, also can be the video decode end, and as shown in Figure 4, this device comprises: acquiring unit 41, coding unit 42, first memory cell 43 and second memory cell 44.
Acquiring unit 41 is used for when needs are recorded current video, according to the coded system of video code flow obtain selected constantly the reconstructed image of corresponding frame of video, the described selected moment is the moment that begins to record the current video code stream; The described selected moment can need begin to record any time of present image for the user, and the embodiment of the invention does not limit this.The coded system of described video code flow comprises single reference frame coded system and multi-reference frame coded system; When the coded system of described video code flow was single reference frame coded system, described acquiring unit 41 was used for, and obtains a frame reconstructed image that constantly begins from selected; When the coded system of described video code flow was the multi-reference frame coded system, described acquiring unit 41 was used for, and obtained the corresponding multiframe reconstructed image that constantly begins from selected.
Coding unit 42 is used for the described reconstructed image that described acquiring unit 41 obtains is carried out lossless compression-encoding, obtains the video code flow behind the lossless compression-encoding; Wherein, when 42 pairs of described reconstructed images of described coding unit carry out lossless compression-encoding, can adopt any lossless compression-encoding mode in the prior art, the invention process does not limit this, but the lossless coding mode that adopts is corresponding with the coded system that coding side is adopted; For example, when described coding side adopted that H.264 the coded system of consensus standard is encoded, described lossless compression-encoding can be encoded for I_PCM; In agreement H.264, a two field picture is divided into several macro blocks (MB), for example, when image adopted the sampling of 4:2:0 form, a MB comprised the luminance block of a 16x16 pixel and the chrominance block of 2 8x8 pixels.This kind I_PCM coding mode is a kind of macro-block coding pattern, is meant each MB in the two field picture is not compressed, directly to the brightness of this macro block, the coding mode that the chroma pixel value is encoded.
First memory cell 43 is used for depositing the video code flow behind described coding unit 42 lossless compression-encodings in the recording and storing device; Wherein, described recording and storing device can for but be not limited to hard disk, any memory device that can be used for the store video code stream all can be used for the embodiment of the invention, the embodiment of the invention does not limit this.Second memory cell 44 is used for directly depositing the video code flow of described reconstructed image successive image correspondence in described recording and storing device.
Further, as shown in Figure 5, this device also comprises: judging unit 45 and adjustment unit 46.
Judging unit 45, be used for directly depositing in the process of described recording and storing device, judge whether the frame of video sequence number of the frame of video sequence number of video code flow of described successive image correspondence and reconstructed image is continuous at the video code flow of described second memory cell 44 with described reconstructed image successive image correspondence; When described judging unit 45 judges that the frame of video sequence number of the frame of video sequence number of video code flow of described successive image correspondence and reconstructed image is discontinuous, adjustment unit 46, be used to adjust the frame of video sequence number of the video code flow of described successive image correspondence, make the frame of video sequence number of itself and reconstructed image continuous.
In the embodiment of the invention, when carrying out video record, according to the coded system of video code flow the reconstructed image of corresponding frame of video is carried out lossless compression-encoding, do not need again image during the decoding of video code flow behind this lossless compression-encoding with reference to the front, the code stream of back is at most only with reference to current frame image, therefore avoided the dependence of inter coded images, realized from any time recorded video content to previous image; And when video code flow is recorded, after this reconstructed image carried out depositing in the recording and storing device behind the lossless compression-encoding, the subsequent video code stream that described coding side has been encoded is directly recorded, the process of storage after image behind the coding of having avoided receiving is decoded and encoded, thereby, guaranteed the video record quality not increasing operand, not increasing under the prerequisite of peripheral hardware; In a word, the technical scheme that the embodiment of the invention provides is not increasing operand, is not increasing peripheral hardware, and guarantees to have realized from any time recorded video content under the prerequisite of video record quality.
Through the above description of the embodiments, the those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential common hardware, can certainly pass through hardware, but the former is better execution mode under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium that can read, floppy disk as computer, memory or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; only be the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of described claim.