CN117041583A - Video compression method, device, equipment and medium - Google Patents
Video compression method, device, equipment and medium Download PDFInfo
- Publication number
- CN117041583A CN117041583A CN202311043785.6A CN202311043785A CN117041583A CN 117041583 A CN117041583 A CN 117041583A CN 202311043785 A CN202311043785 A CN 202311043785A CN 117041583 A CN117041583 A CN 117041583A
- Authority
- CN
- China
- Prior art keywords
- video
- preset
- video data
- time period
- motion vector
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000006835 compression Effects 0.000 title claims abstract description 116
- 238000007906 compression Methods 0.000 title claims abstract description 116
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000008859 change Effects 0.000 claims abstract description 116
- 230000033001 locomotion Effects 0.000 claims abstract description 111
- 239000013598 vector Substances 0.000 claims abstract description 105
- 238000004590 computer program Methods 0.000 claims description 15
- 230000002194 synthesizing effect Effects 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 abstract description 12
- 238000012545 processing Methods 0.000 abstract description 8
- 230000008569 process Effects 0.000 description 10
- 238000012790 confirmation Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/172—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/85—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention discloses a video compression method, a device, equipment and a medium, and relates to the technical field of digital image processing. By acquiring compressed video data; acquiring motion vector information of each video frame in video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
Description
Technical Field
The present invention relates to the field of digital image processing technologies, and in particular, to a video compression method, apparatus, device, and medium.
Background
Video compression is a process that reduces the amount of data while maintaining video quality. Conventional video compression methods are typically based on a video domain, such as artificial intelligence based video compression methods.
However, for a video in which the video content does not significantly change in a specific period of time, the existing video compression method based on the video domain also compresses a portion of the video in the specific period of time when video compression is performed. Video obtained by this compression wastes storage space and transmission resources since the video content over a certain period of time has no more valuable information.
In view of the above-mentioned problems, how to solve the problem that the existing video compression method based on video domain wastes storage space and transmission resources is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a video compression method, a device, equipment and a medium, which are used for solving the problem that the existing video compression method based on a video domain wastes storage space and transmission resources.
In order to solve the above technical problems, the present invention provides a video compression method, including:
acquiring compressed video data;
acquiring motion vector information of each video frame in the video data; wherein the motion vector information characterizes the change information of pixel point positions between adjacent video frames in the video data;
judging whether the change degree of the video frame picture in the video data exceeds a preset change range in a preset video time period according to the motion vector information;
if not, the video data in the preset video time period is compressed again through a preset compression algorithm.
In one aspect, the determining, according to the motion vector information, whether the degree of change of the video frame picture in the video data in the preset video time period exceeds the preset change range includes:
judging whether the size condition and the distribution condition of the motion vector information of each video frame in the video data in the preset video time period meet preset conditions or not;
if yes, confirming that the change degree of the video frame picture in the video data does not exceed the preset change range in the preset video time period;
if not, confirming that the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range.
On the other hand, the determining whether the size and distribution of the motion vector information of each video frame in the video data in the preset video time period satisfy the preset condition includes:
acquiring an average value of the motion vector information of each video frame in the video data to obtain the size of the motion vector information;
acquiring variances of the motion vector information of each video frame in the video data to obtain distribution conditions of the motion vector information;
determining whether the average value of the motion vector information of the video frame is smaller than a first threshold value within the preset video time period, and the variance of the motion vector information of the video frame is smaller than a second threshold value;
if yes, the preset condition is met, and the change degree of the video frame picture in the video data in the preset video time period is confirmed to be not beyond the preset change range;
if not, the preset condition is not met, and the change degree of the video frame picture in the video data in the preset video time period is confirmed to exceed the preset change range.
On the other hand, when the preset compression algorithm is a highly compressed digital video codec standard, the recompressing the video data in the preset video period by the preset compression algorithm includes:
acquiring a predicted frame of the video data in the preset video time period;
and deleting the predicted frame according to a preset rule to obtain the rest predicted frames.
In another aspect, the deleting the predicted frame according to a preset rule includes:
deleting a first preset number of the predicted frames of the video data within the preset video period.
In another aspect, the deleting the predicted frame according to a preset rule includes:
and deleting a second preset number of the predicted frames of the video data in each preset time unit in the preset video time period.
On the other hand, after the recompression of the video data in the preset video period by the preset compression algorithm, the method further includes:
synthesizing the video data in the recompressed preset video time period and the video data outside the compressed preset video time period to generate a compressed video;
and outputting the compressed video.
In order to solve the above technical problem, the present invention further provides a video compression device, including:
the first acquisition module is used for acquiring compressed video data;
the second acquisition module is used for acquiring motion vector information of each video frame in the video data; wherein the motion vector information characterizes the change information of pixel point positions between adjacent video frames in the video data;
the judging module is used for judging whether the change degree of the video frame picture in the video data in the preset video time period exceeds a preset change range or not according to the motion vector information; if not, triggering the compression module;
the compression module is used for compressing the video data in the preset video time period again through a preset compression algorithm.
In order to solve the above technical problem, the present invention further provides a video compression apparatus, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the video compression method when executing the computer program.
To solve the above technical problem, the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the video compression method described above.
The video compression method provided by the invention is characterized in that compressed video data are obtained; acquiring motion vector information of each video frame in video data; the motion vector information represents the change information of the pixel point positions between adjacent video frames in the video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
In addition, the invention also provides a video compression device, equipment and medium, and the effects are the same as the above.
Drawings
For a clearer description of embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
Fig. 1 is a flowchart of a video compression method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a video compression apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a video compression apparatus according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
The invention provides a video compression method, a device, equipment and a medium, which are used for solving the problem that the existing video compression method based on a video domain wastes storage space and transmission resources.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
Video compression is a process that reduces the amount of data while maintaining video quality. Currently, for a video whose video content has no significant change in a specific time period, when video compression is performed in the existing video compression method based on a video domain, a part of the video in the specific time period is also compressed. Video obtained by this compression wastes storage space and transmission resources since the video content over a certain period of time has no more valuable information. Based on the above problems, the present invention provides a video compression method.
Fig. 1 is a flowchart of a video compression method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
s10: compressed video data is acquired.
Specifically, a compressed video data is first acquired. It should be noted that the compression standard adopted for the compressed video data in this embodiment is not limited, and may be a highly compressed digital video codec standard (h.264), a moving picture expert group format (Moving Picture Expert Group, MPEG), or other compression standards, depending on the specific implementation.
S11: motion vector information of each video frame in video data is acquired.
Wherein the motion vector information characterizes change information of pixel positions between adjacent video frames in the video data.
In order to determine whether there is a change in a picture in video data, motion information within the picture in the video data needs to be acquired first. Specifically, motion vector information of each video frame in the video data.
It will be appreciated that video data is made up of a plurality of video frames, each of which contains a plurality of motion vector information. The motion vector information characterizes the change information of pixel locations between adjacent video frames in the video data. It reflects the movement information of the object in the picture: if the current frame picture does not move compared with the previous frame picture, most or all motion vectors in the current frame picture are close to zero; conversely, if there is a large motion or change in the current frame as compared to the previous frame, the motion vector in the current frame will become large as compared to the previous frame. Therefore, whether or not a picture has changed can be judged by the motion vector.
It should be noted that, in this embodiment, the specific acquisition manner of the motion vector information of each video frame in the video data is not limited, and an appropriate extraction manner, extraction tool or extraction function may be selected according to the actual situation. The following is illustrative:
when the compressed video data is h.264 video data, the motion vector information is extracted by parsing the compressed code stream of the video. For h.264 video data, motion vector information is an important component in h.264 coding, which represents the pixel offset between the current macroblock (or partition, depending on the particular mode of h.264) and the macroblock at the corresponding position in the reference frame. The extraction of motion vectors in h.264 video does not require inverse quantization and inverse transformation. In the implementation, an extract_mvs.c function may be used to directly obtain a set of motion vector information corresponding to each macroblock in the h.264 video data.
S12: and judging whether the change degree of the video frame picture in the video data in the preset video time period exceeds a preset change range or not according to the motion vector information. If not, the process proceeds to step S13.
S13: and compressing the video data in the preset video time period again through a preset compression algorithm.
Further, since the motion vector information characterizes the movement information of the object in the picture, it can be determined whether the degree of change of the video frame picture in the video data in the preset video time period exceeds the preset change range according to the obtained motion vector information.
It is understood that the preset video time period refers to a preset video time length in the video data. For example, when the preset video period is 1 minute, the meaning of the characterization thereof is a video duration of 1 minute in the video data. It should be noted that the preset video period should be less than or equal to the total duration of the video data. In this embodiment, the specific duration of the preset video time period is not limited, and depends on the specific implementation situation. In addition, the preset variation range is not limited in this embodiment, and depends on the specific implementation.
When the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range according to the motion vector information, the picture of the video data in the preset video time period is considered to be dynamic, and the information of object movement is included; therefore, in order to preserve the dynamic information content, the video data in the preset video time period is not compressed again, and the process is finished. When the change degree of the video frame picture in the video data in the preset video time period is not beyond the preset change range according to the motion vector information, the picture of the video data in the preset video time period is considered to be static, and no information of object movement exists; therefore, in order to save storage space and transmission resources, the video data in the preset video time period is compressed again.
It should be noted that, in this embodiment, the specific process of determining whether the change degree of the picture in the video exceeds the preset change range according to the motion vector information is not limited, and may be determined according to the size of the motion vector information of each video frame, may be determined according to the distribution of the motion vector information, or may be determined by combining the size of the motion vector information with the distribution, depending on the specific implementation. In addition, the preset compression algorithm used for recompression of video data is not limited, and depends on the specific implementation.
In this embodiment, compressed video data is acquired; acquiring motion vector information of each video frame in video data; the motion vector information represents the change information of the pixel point positions between adjacent video frames in the video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
In order to better determine whether there is a change in the video frame, in some embodiments, determining whether the degree of change in the video frame in the video data in the preset video period exceeds the preset change range according to the motion vector information includes:
s120: judging whether the size condition and the distribution condition of motion vector information of each video frame in video data in a preset video time period meet preset conditions or not; if yes, go to step S121; if not, the process proceeds to step S122.
S121: and confirming that the change degree of the video frame picture in the video data in the preset video time period does not exceed the preset change range.
S122: and confirming that the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range.
In a specific implementation, whether the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range is judged according to the motion vector information, and whether the size condition and the distribution condition of the motion vector information of each video frame in the video data in the preset video time period meet the preset condition is judged. By using the size and distribution of the motion vector information as the judgment basis, the change condition of the picture can be more accurately determined.
When the size condition and the distribution condition of the motion vector information of each video frame in the video data in the preset video time period are determined to meet the preset condition, confirming that the change degree of the video frame picture in the video data in the preset video time period does not exceed the preset change range; when the size and distribution of the motion vector information of each video frame in the video data in the preset video time period are determined to not meet the preset condition, confirming that the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range. In this embodiment, the preset conditions are not limited, and they depend on the specific implementation.
In some embodiments, determining whether the size and distribution of motion vector information of each video frame in the video data in the preset video time period satisfy the preset condition includes:
s123: and obtaining an average value of motion vector information of each video frame in the video data to obtain the size of the motion vector information.
S124: and acquiring the variance of the motion vector information of each video frame in the video data to obtain the distribution condition of the motion vector information.
S125: and judging whether the average value of the motion vector information of the video frames in the preset video time period is smaller than a first threshold value, and the variance of the motion vector information of the video frames is smaller than a second threshold value. If yes, go to step S126; if not, the process advances to step S127.
S126: and (3) meeting a preset condition, and confirming that the change degree of the video frame picture in the video data in the preset video time period does not exceed the preset change range.
S127: and if the preset condition is not met, confirming that the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range.
Specifically, firstly, obtaining an average value of motion vector information of each video frame in video data, wherein the average value represents the size of the motion vector information in the corresponding video frame; and acquiring variances of motion vector information of each video frame in the video data, wherein the variances represent distribution conditions of the motion vector information in the corresponding video frames. Further judging whether the average value of the motion vector information of the video frames in the preset video time period is smaller than a first threshold value, and the variance of the motion vector information of the video frames is smaller than a second threshold value.
It should be noted that, since the first threshold is a threshold of the average value and the second threshold is a threshold of the variance, there is no magnitude relation between the first threshold and the second threshold. When the average value of the motion vector information of the video frames in the preset video time period is confirmed to be smaller than a first threshold value and the variance of the motion vector information of the video frames is confirmed to be smaller than a second threshold value, the preset condition is considered to be met, and the change degree of the video frame pictures in the video data in the preset video time period is confirmed to be not beyond the preset change range. When the average value of the motion vector information of the video frames in the preset video time period is confirmed to be not smaller than a first threshold value, or the variance of the motion vector information of the video frames is not smaller than a second threshold value, or the average value of the motion vector information is not smaller than the first threshold value and the variance of the motion vector information of the video frames is not smaller than the second threshold value, the preset condition is considered not met, and the change degree of the video frame pictures in the video data in the preset video time period is confirmed to be beyond the preset change range. Therefore, the judgment of whether the change degree of the video frame picture exceeds the preset change range is realized.
On the basis of the above embodiments, in some embodiments, when the preset compression algorithm is a highly compressed digital video codec standard, re-compressing the video data within the preset video period by the preset compression algorithm includes:
s130: and obtaining a predicted frame of the video data in a preset video time period.
S131: and deleting the predicted frames according to a preset rule to obtain the residual predicted frames.
In some embodiments, the preset compression algorithm may select a highly compressed digital video codec standard, i.e., the h.264 compression standard. In the h.264 video compression standard, a key frame (I-frame) is an independent frame in a video sequence that is decoded independent of other frames and can be used as a reference point at which a decoder starts decoding the video sequence. Key frames represent a complete image by compressing pixel data within a video frame. The predicted frame (P frame) calculates the difference of the current frame by predicting the previous reference frame (typically the key frame or the previous predicted frame), and stores only the difference information to achieve a higher compression ratio. The decoder needs to decode the reference frame first and then restore the current frame according to the difference information. Through the combined use of key frames and predicted frames, the h.264 compression standard is able to efficiently compress video data while maintaining a high visual quality.
Therefore, when the video data in the preset video period is compressed again using the h.264 compression standard, a predicted frame of the video data in the preset video period can be acquired. Because the predicted frames are only calculated and stored for pixel differences between the current frame and the reference frame, the predicted frames can be deleted according to preset rules to obtain residual predicted frames, and key frames are reserved, so that the number of the predicted frames in the video data is reduced, and the recompression of the video data is realized. It should be noted that, in this embodiment, the preset rule is not limited, and depends on the specific implementation.
In some embodiments, deleting the predicted frame according to the preset rule includes:
s132: deleting a first preset number of predicted frames of video data within a preset video period.
Specifically, when deleting the predicted frames, a first preset number of predicted frames can be selected from the video data in the preset video time period, and the predicted frames are deleted, so that the number of the predicted frames of the video data in the predicted video time period is reduced, and secondary compression of the video data is realized. The first preset number is not limited in this embodiment, and depends on the specific implementation.
In some embodiments, deleting the predicted frame according to the preset rule includes:
s133: and deleting the predicted frames of the video data of the second preset quantity in each preset time unit in the preset video time period respectively.
Specifically, when deleting the predicted frame, the preset video period may also be selectively divided in preset time units. For example, when the preset video period is 1 minute, the preset time unit may be set to 1 second, and then the preset video period is equally divided into 60 parts by the preset time unit.
And further deleting the predicted frames of the second preset number of video data in each preset time unit in the preset video time period respectively. For example, when the preset video period is 1 minute and the preset time unit is 1 second, it is equivalent to deleting the second preset number of predicted frames in the video data per second in the video of 1 minute. The second preset number is not limited in this embodiment, and depends on the specific implementation.
It should be noted that, since the deletion manners of the predicted frames where the first preset number and the second preset number are located are different, there is no size relationship between the first preset number and the second preset number.
In some embodiments, after recompressing the video data within the preset video period by the preset compression algorithm, the method further includes:
s14: and synthesizing the video data in the recompressed preset video time period and the video data outside the compressed preset video time period to generate a compressed video.
S15: and outputting the compressed video.
In a specific implementation, after the video data in the preset video time period is compressed again by the preset compression algorithm, the video data of the picture that is not moving is compressed again. In order to enable the compressed video to be normally output, it is also necessary to synthesize video data within a pre-set video period that is compressed again with video data outside the pre-set video period that has been compressed to generate the compressed video.
It will be understood that, here, the video data outside the compressed preset video period actually refers to the input video data subjected to the preliminary compression, and the degree of change of the video frame picture in the video data exceeds the preset change range, so that the recompression is not required. Thus, the video data subjected to primary compression and the video data subjected to secondary compression are synthesized, so that a complete compressed video can be generated, and the compressed video is output. The quality of the finally output video is almost lossless, and the integrity and quality of the video are ensured.
In the above embodiments, the video compression method is described in detail, and the present invention further provides a corresponding embodiment of the video compression apparatus.
Fig. 2 is a schematic diagram of a video compression apparatus according to an embodiment of the present invention. As shown in fig. 2, the video compression apparatus includes:
a first acquisition module 10 for acquiring compressed video data.
A second obtaining module 11, configured to obtain motion vector information of each video frame in the video data; wherein the motion vector information characterizes change information of pixel positions between adjacent video frames in the video data.
A judging module 12, configured to judge whether the degree of change of the video frame picture in the video data in the preset video time period exceeds the preset change range according to the motion vector information; if not, triggering the compression module 13;
the compression module 13 is configured to recompress the video data in the preset video time period by using a preset compression algorithm.
In some embodiments, the determination module 12 includes:
the preset condition judging sub-module is used for judging whether the size condition and the distribution condition of the motion vector information of each video frame in the video data in the preset video time period meet the preset condition; if yes, triggering the first confirmation module, and if not, triggering the second confirmation module.
The first confirming module is used for confirming that the change degree of the video frame picture in the video data in the preset video time period does not exceed the preset change range.
The second confirming module is used for confirming that the change degree of the video frame picture in the video data in the preset video time period exceeds the preset change range.
In some embodiments, the preset condition judgment submodule includes:
the average value obtaining module is used for obtaining the average value of the motion vector information of each video frame in the video data so as to obtain the size condition of the motion vector information.
The variance acquisition module is used for acquiring variances of the motion vector information of each video frame in the video data so as to obtain distribution conditions of the motion vector information.
The threshold judging sub-module is used for judging whether the average value of the motion vector information of the video frames in the preset video time period is smaller than a first threshold value, and the variance of the motion vector information of the video frames is smaller than a second threshold value; if yes, triggering a first confirmation module; if not, triggering a second confirmation module.
In some embodiments, when the preset compression algorithm is a highly compressed digital video codec standard, the compression module comprises:
and the predicted frame acquisition module is used for acquiring predicted frames of video data in a preset video time period.
And the predicted frame deleting module is used for deleting the predicted frames according to a preset rule to obtain the residual predicted frames.
In some embodiments, the predicted frame deletion module includes:
and the first predicted frame deleting sub-module is used for deleting the predicted frames of the first preset number of video data in the preset video time period.
In some embodiments, the predicted frame deletion module includes:
and the second predicted frame deleting sub-module is used for deleting predicted frames of the second preset number of video data in each preset time unit in the preset video time period.
In some embodiments, further comprising:
and the synthesis module is used for synthesizing the video data in the recompressed preset video time period and the video data outside the compressed preset video time period to generate a compressed video.
And the output module is used for outputting the compressed video.
In this embodiment, the video compression device includes a first acquisition module, a second acquisition module, a judgment module, and a compression module. The video compression apparatus is capable of implementing all the steps of the video compression method described above when running. By acquiring compressed video data; acquiring motion vector information of each video frame in video data; the motion vector information represents the change information of the pixel point positions between adjacent video frames in the video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
Fig. 3 is a schematic diagram of a video compression apparatus according to an embodiment of the present invention. As shown in fig. 3, the video compression apparatus includes:
a memory 20 for storing a computer program.
A processor 21 for implementing the steps of the video compression method as mentioned in the above embodiments when executing a computer program.
The video compression device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 21 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processor (Graphics Processing Unit, GPU) for use in connection with rendering and rendering of content to be displayed by the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing a computer program 201, which, when loaded and executed by the processor 21, is capable of implementing the relevant steps of the video compression method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202, data 203, and the like, where the storage manner may be transient storage or permanent storage. The operating system 202 may include Windows, unix, linux, among others. The data 203 may include, but is not limited to, data related to video compression methods.
In some embodiments, the video compression device may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the structure shown in fig. 3 is not limiting of the video compression apparatus and may include more or fewer components than shown.
In this embodiment, a video compression apparatus includes a memory and a processor. The memory is used for storing a computer program. The processor is arranged to implement the steps of the video compression method as mentioned in the above embodiments when executing the computer program. By acquiring compressed video data; acquiring motion vector information of each video frame in video data; the motion vector information represents the change information of the pixel point positions between adjacent video frames in the video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
Finally, the invention also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this embodiment, a computer program is stored on a computer readable storage medium, and when the computer program is executed by a processor, the steps described in the above method embodiments are implemented. By acquiring compressed video data; acquiring motion vector information of each video frame in video data; the motion vector information represents the change information of the pixel point positions between adjacent video frames in the video data; judging whether the change degree of video frames in the video data in a preset video time period exceeds a preset change range or not according to the motion vector information; if not, the video data in the preset video time period is compressed again through a preset compression algorithm. Therefore, the scheme adopts a video compression mode based on a compression domain, and the video data with lower code rate is compressed on the part of the video data with the picture change degree not exceeding the preset change range according to the change condition of the video frame picture by acquiring the video data which is primarily compressed. Therefore, the volume of video data is obviously reduced while the video quality and the integrity are ensured, so that the storage space and the transmission bandwidth are effectively saved.
The video compression method, the device, the equipment and the medium provided by the invention are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311043785.6A CN117041583A (en) | 2023-08-18 | 2023-08-18 | Video compression method, device, equipment and medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311043785.6A CN117041583A (en) | 2023-08-18 | 2023-08-18 | Video compression method, device, equipment and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117041583A true CN117041583A (en) | 2023-11-10 |
Family
ID=88644641
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311043785.6A Pending CN117041583A (en) | 2023-08-18 | 2023-08-18 | Video compression method, device, equipment and medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117041583A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120726607A (en) * | 2025-08-21 | 2025-09-30 | 蜂巢智行(上海)技术有限公司 | Distillation training data transmission method and system based on visual semantic compression |
-
2023
- 2023-08-18 CN CN202311043785.6A patent/CN117041583A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120726607A (en) * | 2025-08-21 | 2025-09-30 | 蜂巢智行(上海)技术有限公司 | Distillation training data transmission method and system based on visual semantic compression |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20190182500A1 (en) | Image coding apparatus, method for coding image, program therefor, image decoding apparatus, method for decoding image, and program therefor | |
| EP1162573A2 (en) | Image processing apparatus and method | |
| US11082699B2 (en) | Codec | |
| KR102599314B1 (en) | Quantization step parameters for point cloud compression | |
| EP1407611B1 (en) | Track for improved video compression | |
| EP3104613A1 (en) | Video processing system | |
| JP4023324B2 (en) | Watermark embedding and image compression unit | |
| JP6769231B2 (en) | Moving image coding device, moving image coding method, moving image decoding device, moving image decoding method, and moving image coding computer program and moving image decoding computer program | |
| CN117041583A (en) | Video compression method, device, equipment and medium | |
| US8032719B2 (en) | Method and apparatus for improved memory management in data analysis | |
| WO2007026302A2 (en) | Method and device for coding and decoding of video error resilience | |
| JPWO2014167609A1 (en) | Information processing apparatus, control method, program, and recording medium | |
| US8594194B2 (en) | Compression method using adaptive field data selection | |
| JP2001145112A (en) | Moving image synthesizing apparatus, moving image synthesizing method, and recording medium | |
| JP2017192080A (en) | Image compression apparatus, image decoding apparatus, image compression method, and image compression program | |
| CN110798715A (en) | Video playing method and system based on image string | |
| CN101237573A (en) | Image Data Compression Algorithm | |
| JP2001145106A (en) | Image compression apparatus and method | |
| US20120014675A1 (en) | Method and Device for Storing a Portion of a Video Stream | |
| JPH04369191A (en) | Picture compression/decoding device | |
| US20140341304A1 (en) | Transform system and method in video and image compression | |
| JP6377222B2 (en) | Information processing apparatus, control method, program, and recording medium | |
| KR102897441B1 (en) | Server and control method thereof | |
| US20040001548A1 (en) | Method and apparatus to facilitate variable-loss image compression for images of objects in motion | |
| JP6117818B2 (en) | Encoding and decoding using perceptual representation |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |