[go: up one dir, main page]

CN117041583A - Video compression method, device, equipment and medium - Google Patents

Video compression method, device, equipment and medium Download PDF

Info

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
Application number
CN202311043785.6A
Other languages
Chinese (zh)
Inventor
杜君
李强
张海军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN202311043785.6A priority Critical patent/CN117041583A/en
Publication of CN117041583A publication Critical patent/CN117041583A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/17Methods 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/172Methods 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods 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

Video compression method, device, equipment and medium
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)

1.一种视频压缩方法,其特征在于,包括:1. A video compression method, characterized by comprising: 获取已压缩的视频数据;Get compressed video data; 获取所述视频数据中各视频帧的运动矢量信息;其中,所述运动矢量信息表征所述视频数据中相邻所述视频帧之间的像素点位置的变化信息;Obtain the motion vector information of each video frame in the video data; wherein the motion vector information represents the change information of the pixel position between adjacent video frames in the video data; 根据所述运动矢量信息判断在预设视频时间段内所述视频数据中的视频帧画面的变化程度是否超出预设变化范围;Determine according to the motion vector information whether the degree of change of the video frames in the video data exceeds the preset change range within the preset video time period; 若否,则通过预设压缩算法对所述预设视频时间段内的所述视频数据进行再次压缩。If not, the video data in the preset video time period is compressed again using a preset compression algorithm. 2.根据权利要求1所述的视频压缩方法,其特征在于,所述根据所述运动矢量信息判断在预设视频时间段内所述视频数据中的视频帧画面的变化程度是否超出预设变化范围包括:2. The video compression method according to claim 1, wherein the step of determining based on the motion vector information whether the degree of change of the video frames in the video data exceeds a preset change within a preset video time period is Scope includes: 判断所述预设视频时间段内所述视频数据中各所述视频帧的所述运动矢量信息的大小情况及分布情况是否满足预设条件;Determine whether the size and distribution of the motion vector information of each video frame in the video data within the preset video time period meet preset conditions; 若是,则确认在所述预设视频时间段内所述视频数据中的所述视频帧画面的所述变化程度未超出所述预设变化范围;If so, confirm that the degree of change of the video frames in the video data within the preset video time period does not exceed the preset change range; 若否,则确认在所述预设视频时间段内所述视频数据中的所述视频帧画面的所述变化程度超出所述预设变化范围。If not, it is confirmed that the degree of change of the video frame in the video data exceeds the preset change range within the preset video time period. 3.根据权利要求2所述的视频压缩方法,其特征在于,所述判断所述预设视频时间段内所述视频数据中各所述视频帧的所述运动矢量信息的大小情况及分布情况是否满足预设条件包括:3. The video compression method according to claim 2, wherein the step is to determine the size and distribution of the motion vector information of each video frame in the video data within the preset video time period. Whether the preset conditions are met include: 获取所述视频数据中各所述视频帧的所述运动矢量信息的平均值,以得到所述运动矢量信息的大小情况;Obtain the average value of the motion vector information of each video frame in the video data to obtain the size of the motion vector information; 获取所述视频数据中各所述视频帧的所述运动矢量信息的方差,以得到所述运动矢量信息的分布情况;Obtain the variance of the motion vector information of each video frame in the video data to obtain the distribution of the motion vector information; 判断在所述预设视频时间段内是否存在所述视频帧的所述运动矢量信息的所述平均值小于第一阈值,且所述视频帧的所述运动矢量信息的所述方差小于第二阈值;Determine whether the average value of the motion vector information of the video frame is less than a first threshold within the preset video time period, and the variance of the motion vector information of the video frame is less than a second threshold; 若是,则满足所述预设条件,确认在所述预设视频时间段内所述视频数据中的所述视频帧画面的所述变化程度未超出所述预设变化范围;If so, the preset condition is met and it is confirmed that the degree of change of the video frames in the video data within the preset video time period does not exceed the preset change range; 若否,则不满足所述预设条件,确认在所述预设视频时间段内所述视频数据中的所述视频帧画面的所述变化程度超出所述预设变化范围。If not, the preset condition is not met, and it is confirmed that the degree of change of the video frame in the video data exceeds the preset change range within the preset video time period. 4.根据权利要求3所述的视频压缩方法,其特征在于,当所述预设压缩算法为高度压缩数字视频编解码器标准时,所述通过预设压缩算法对所述预设视频时间段内的所述视频数据进行再次压缩包括:4. The video compression method according to claim 3, characterized in that, when the preset compression algorithm is a highly compressed digital video codec standard, the preset compression algorithm is used to compress the preset video within the preset video time period. The video data to be compressed again includes: 获取所述预设视频时间段内的所述视频数据的预测帧;Obtain predicted frames of the video data within the preset video time period; 根据预设规则对所述预测帧进行删除,以得到剩余的所述预测帧。The predicted frames are deleted according to preset rules to obtain the remaining predicted frames. 5.根据权利要求4所述的视频压缩方法,其特征在于,所述根据预设规则对所述预测帧进行删除包括:5. The video compression method according to claim 4, wherein deleting the predicted frame according to preset rules includes: 在所述预设视频时间段内删除第一预设数量的所述视频数据的所述预测帧。Delete a first preset number of the predicted frames of the video data within the preset video time period. 6.根据权利要求4所述的视频压缩方法,其特征在于,所述根据预设规则对所述预测帧进行删除包括:6. The video compression method according to claim 4, wherein deleting the predicted frame according to preset rules includes: 分别在所述预设视频时间段内的各预设时间单位内,删除第二预设数量的所述视频数据的所述预测帧。Delete a second preset number of the predicted frames of the video data in each preset time unit within the preset video time period. 7.根据权利要求1至6任意一项所述的视频压缩方法,其特征在于,在所述通过预设压缩算法对所述预设视频时间段内的所述视频数据进行再次压缩之后,还包括:7. The video compression method according to any one of claims 1 to 6, characterized in that after the video data in the preset video time period is re-compressed by the preset compression algorithm, include: 将再次压缩的所述预设视频时间段内的所述视频数据和已压缩的所述预设视频时间段之外的所述视频数据进行合成,以生成压缩后的视频;Synthesizing the re-compressed video data within the preset video time period and the compressed video data outside the preset video time period to generate a compressed video; 输出所述压缩后的视频。Output the compressed video. 8.一种视频压缩装置,其特征在于,包括:8. A video compression device, characterized by comprising: 第一获取模块,用于获取已压缩的视频数据;The first acquisition module is used to acquire compressed video data; 第二获取模块,用于获取所述视频数据中各视频帧的运动矢量信息;其中,所述运动矢量信息表征所述视频数据中相邻所述视频帧之间的像素点位置的变化信息;The second acquisition module is used to acquire the motion vector information of each video frame in the video data; wherein the motion vector information represents the change information of the pixel position between adjacent video frames in the video data; 判断模块,用于根据所述运动矢量信息判断在预设视频时间段内所述视频数据中的视频帧画面的变化程度是否超出预设变化范围;若否,则触发压缩模块;A judgment module, configured to judge whether the degree of change of the video frame in the video data exceeds the preset change range within the preset video time period based on the motion vector information; if not, trigger the compression module; 所述压缩模块,用于通过预设压缩算法对所述预设视频时间段内的所述视频数据进行再次压缩。The compression module is configured to re-compress the video data within the preset video time period through a preset compression algorithm. 9.一种视频压缩设备,其特征在于,包括:9. A video compression device, characterized by comprising: 存储器,用于存储计算机程序;Memory, used to store computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的视频压缩方法的步骤。A processor, configured to implement the steps of the video compression method according to any one of claims 1 to 7 when executing the computer program. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的视频压缩方法的步骤。10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the video of any one of claims 1 to 7 is implemented. Compression method steps.
CN202311043785.6A 2023-08-18 2023-08-18 Video compression method, device, equipment and medium Pending CN117041583A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
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