CN114584781A - Video compression method and device and computer readable storage medium - Google Patents
Video compression method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN114584781A CN114584781A CN202210199553.9A CN202210199553A CN114584781A CN 114584781 A CN114584781 A CN 114584781A CN 202210199553 A CN202210199553 A CN 202210199553A CN 114584781 A CN114584781 A CN 114584781A
- Authority
- CN
- China
- Prior art keywords
- video
- compressed
- region
- code rate
- compression
- 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
Images
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/20—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video object coding
-
- 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/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- 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/48—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data
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 and a device and a computer readable storage medium, wherein the video compression method comprises the following steps: acquiring a video to be compressed; when the available bandwidth is smaller than the video code rate of the video to be compressed, performing target detection on the video to be compressed to determine whether each video frame in the video to be compressed contains a key target; when a video frame in the video to be compressed contains the key target, performing first compression on a first area of the video frame containing the key target, and performing second compression on a second area of the video frame not containing the key target. By using the technical scheme, the adaptive compression method is adopted for the video according to the network condition and whether the video contains the key target, so that the video code rate is reduced while the video picture quality is ensured.
Description
Technical Field
The present invention relates to the field of video transmission technologies, and in particular, to a video compression method and apparatus, and a computer-readable storage medium.
Background
At present, cameras are widely applied to various scenes, so that users can monitor the important areas more conveniently. Data interaction of the camera depends on a network environment, and video transmission is performed when available bandwidth is insufficient, so that other users are affected. In addition, the video needs to be compressed, otherwise, communication line failure and data storage capacity shortage are easily caused.
In the prior art, when a video is compressed, the whole video needs to be compressed.
However, when compressing a video, the prior art reduces the overall picture quality of the video in order to achieve a higher video compression ratio.
Disclosure of Invention
The invention solves the technical problem of how to adopt a proper compression method for the video according to the network condition, and improve the overall picture quality of the video on the basis of ensuring the reliable transmission of the video.
To solve the foregoing technical problem, an embodiment of the present invention provides a video compression method, where the video compression method includes: acquiring a video to be compressed; when the available bandwidth is smaller than the video code rate of the video to be compressed, performing target detection on the video to be compressed to determine whether each video frame in the video to be compressed contains a key target; when a video frame in the video to be compressed contains the key target, performing first compression on a first region containing the key target in the video frame, and performing second compression on a second region not containing the key target in the video frame, wherein the compressed first region has a first code rate, the compressed second region has a second code rate, the definition of the compressed first region is greater than that of the compressed second region, and the sum of the first code rate and the second code rate is less than or equal to the available bandwidth.
Optionally, when the resolutions of the compressed first region and the compressed second region are the same, the compressed first region has a first adjustment code rate, and the first adjustment code rate is greater than the second code rate.
Optionally, the performing target detection on the video to be compressed includes: inputting the video to be compressed into a target detection model to determine whether each video frame in the video to be compressed contains the key target.
Optionally, the compressed first region and the compressed second region are merged to obtain a compressed video.
Optionally, the video compression method further includes: and when the available bandwidth is larger than the video code rate of the video to be compressed, performing third compression on the video to be compressed, wherein the compressed video has a third code rate, and the third code rate is equal to the available bandwidth or the third code rate is the product of the available bandwidth and a preset ratio.
Optionally, the video compression method further includes: and when the available bandwidth is smaller than the video code rate of the video to be compressed and each video frame does not contain the key target, performing fourth compression on the video to be compressed, wherein the compressed video has a fourth code rate, and the fourth code rate is smaller than or equal to the available bandwidth.
Optionally, the method for acquiring the available bandwidth includes: the network environment is periodically checked to obtain the size of the available bandwidth.
Optionally, the video compression method further includes: and taking the compressed video as a result video and storing the result video in a cache region.
Optionally, the video compression method further includes: determining a current bandwidth; and taking the compressed video as a result video, and transmitting the result video to target equipment when the video code rate of the result video is smaller than the current bandwidth.
The embodiment of the invention also discloses a video compression device, which comprises: the acquisition module is used for acquiring a video to be compressed; the target detection module is used for performing target detection on the video to be compressed when the available bandwidth is smaller than the video code rate of the video to be compressed so as to determine whether each video frame in the video to be compressed comprises a key target; the compression module is used for performing first compression on a first region containing the key target in the video frame and performing second compression on a second region not containing the key target in the video frame when the video frame in the video to be compressed contains the key target, the compressed first region has a first code rate, the compressed second region has a second code rate, the definition of the compressed first region is greater than that of the compressed second region, and the sum of the first code rate and the second code rate is less than or equal to the available bandwidth.
The embodiment of the invention also discloses a server, which comprises a memory and a processor, wherein the memory is stored with a computer program capable of running on the processor, and the computer program is run by the processor to execute any one of the steps of the video compression method.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer program executes the steps of any one of the video compression methods.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
the invention provides a video compression method, which is characterized in that a video to be compressed is obtained, the video code rate of the video to be compressed is compared with available bandwidth, and whether the current available bandwidth is enough to transmit the video to be compressed is determined, so that other users in the current network state are prevented from being influenced. When the available bandwidth is smaller than the video code rate of the video to be compressed, target detection is carried out on the video to be compressed to determine whether a video picture comprises a key target, different compression strategies are adopted for regions containing the key target and regions not containing the key target in the video to be compressed, the region containing the key target can have high definition, and simultaneously the video code rate of the video to be compressed is compressed to be suitable for the available bandwidth, so that the reliability of video transmission is ensured.
Further, by determining the current bandwidth, it can be determined whether the code rate of the resulting video is smaller than the current bandwidth, and when the video code rate of the resulting video is smaller than the current bandwidth, the resulting video is uploaded to the target device. The transmission conditions are set for the result video according to the current bandwidth, and the uploading time of the result video can be controlled, so that the result video is transmitted only when the current bandwidth is enough, and other users using the bandwidth are not influenced.
Drawings
FIG. 1 is an overall flow chart of a method provided by an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of video compression and transmission;
FIG. 3 is a detailed flow chart of video frame merging according to an embodiment of the present invention;
fig. 4 is a specific flowchart of a result video transmission using a buffer according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a video compression apparatus according to an embodiment of the present invention.
Detailed Description
As described in the background art, data interaction of a camera depends on a network environment, video transmission is performed when available bandwidth is insufficient, which may affect other users, and in addition, video needs to be compressed, otherwise, communication line failure and data storage capacity shortage are easily caused. In the prior art, when a video is compressed, the whole video needs to be compressed, and in order to obtain a higher video compression ratio, the whole picture quality of the video is reduced.
In the embodiment of the invention, the video code rate of the video to be compressed is compared with the available bandwidth by acquiring the video to be compressed, and whether the current available bandwidth is enough to transmit the video to be compressed is determined so as to avoid influencing other users in the current network state. When the available bandwidth is smaller than the video code rate of the video to be compressed, target detection is carried out on the video to be compressed to determine whether a video picture comprises a key target, different compression strategies are adopted for regions containing the key target and regions not containing the key target in the video to be compressed, the region containing the key target can have high definition, and simultaneously the video code rate of the video to be compressed is compressed to be suitable for the available bandwidth, so that the reliability of video transmission is ensured.
Further, by determining the current bandwidth, it can be determined whether the code rate of the resulting video is smaller than the current bandwidth, and when the video code rate of the resulting video is smaller than the current bandwidth, the resulting video is uploaded to the target device. The transmission conditions are set for the result video according to the current bandwidth, and the uploading time of the result video can be controlled, so that the result video is transmitted only when the current bandwidth is enough, and other users using the bandwidth are not affected.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is an overall flowchart of a video compression method according to an embodiment of the present invention.
The video compression method may be performed by a computer device, for example, may be performed by a server. It should be noted that the computer device may not be limited to the server, and may be other devices with data processing capability.
Specifically, as shown in fig. 1, the video compression method may include the steps of:
in step 101, a video to be compressed is acquired.
In a particular implementation, a video to be compressed may be obtained from a camera.
In step 102, when the available bandwidth is smaller than the video bitrate of the video to be compressed, performing target detection on the video to be compressed to determine whether each video frame in the video to be compressed contains a key target.
In an implementation, the network environment is periodically checked, and the size of the available bandwidth can be obtained. For example, the network environment may be checked once per second to obtain the size of the available bandwidth.
In specific implementation, the available bandwidth is compared with the video code rate of the video to be compressed, and when the available bandwidth is smaller than the video code rate of the video to be compressed, the video to be compressed is input into the target detection model. And performing target detection on the video to be compressed to determine whether each video frame in the video to be compressed contains a key target, so as to determine the area of the key target in each video frame. For example, the target detection model may be a neural network model and the key target may be a human.
In step 103, when there is a video frame in the video to be compressed that includes the key target, a first region of the video frame that includes the key target is first compressed, and a second region of the video frame that does not include the key target is second compressed.
In specific implementation, whether each video frame in the video to be compressed contains a key target or not is judged according to the result of target detection. When a video frame containing a key target exists in a video to be compressed, taking a region containing the key target in the video frame as a first region, and taking a region not containing the key target as a second region. Performing first compression on the first area, wherein the first compression can be quality-first compression, namely compressing the first area on the premise of ensuring the quality of a video picture; and performing second compression on the second area, wherein the second compression can be code rate first compression, namely compressing the second area, so that the video code rate of the video to be compressed can adapt to the available bandwidth.
In a specific implementation, the compressed first region has a first code rate, and the compressed second region has a second code rate. The first compression needs to ensure the video picture quality of the first region, the second compression compresses the second region until the second region adapts to the available bandwidth, the definition of the compressed first region is greater than that of the compressed second region, the sum of the first code rate and the second code rate is less than or equal to the available bandwidth, and the compressed video can be transmitted by using the available bandwidth.
In a specific implementation, the resolution of the compressed first region is adjusted to make the resolution of the compressed first region the same as the resolution of the compressed second region, and at this time, the compressed first region has a first adjustment code rate, and the first adjustment code rate is greater than the second code rate.
In the embodiment, when a video frame in the video to be compressed contains a key target, the region containing the key target and the region not containing the key target are respectively processed by using different compression methods, so that the video code rate can be suitable for the available bandwidth while the region picture where the key target is located has high definition.
It should be noted that, the sequence numbers of the steps in this embodiment do not represent a limitation on the execution order of the steps.
Fig. 2 is a flowchart illustrating an embodiment of video compression and transmission.
Specifically, as shown in fig. 2, video compression and transmission may include the following steps:
in an implementation of step 202, the network environment is periodically checked to obtain the size of the available bandwidth.
In the implementation of step 203, it is determined whether the available bandwidth is greater than the video bitrate of the video to be compressed. If yes, step 204 is executed to perform a third compression on the video to be compressed, where the third compression may be quality-first compression, that is, on the premise of ensuring the video picture quality, the video to be compressed is compressed. The third compressed video has a third code rate equal to the available bandwidth or a product of the available bandwidth and the preset ratio. For example, in the case of 10Mbps, the third code rate may be 10Mbps, or may be 80% of the available bandwidth, i.e., 8Mbps, and the preset ratio may be set by the user.
If not, step 205 is executed to perform dynamic detection on the video to be compressed, specifically, decode the video to be compressed to obtain each video frame, and input all the video frames into the target detection model to determine whether each video frame in the video to be compressed includes the key target.
In the specific implementation of step 206, it is determined whether a video frame including a key target exists in the video to be compressed, if yes, step 207 is executed, where an area including the key target in the video frame is taken as a first area, the first area is extracted, and image information of the first area is stored, where the image information includes a position and a size of the first area. And performing first compression on the first area, wherein the first compression can compress the video code rate while ensuring the definition of the video. The compressed first region has a first code rate, and the difference between the available bandwidth and the first code rate is calculated to be the residual available bandwidth. If not, step 208 is executed to perform fourth compression on the video to be compressed, where the fourth compression may be rate-first compression, that is, the video to be compressed is compressed, so that the video rate of the video to be compressed can adapt to the available bandwidth, and the compressed video has a fourth rate that is less than or equal to the available bandwidth.
In the specific implementation of step 209, the region not including the key target is taken as a second region, and the second region is subjected to a second compression, where the second compression may be rate-first compression, that is, the second region is subjected to rate-first compression on the premise of ensuring the picture quality of the first region. The compressed second region has a second code rate, and the second code rate is less than or equal to the residual available bandwidth of the first region after the first compression.
In an implementation of step 210, the compressed first region and the compressed second region are stitched according to the image information to generate a merged image frame. And arranging all the combined image frames according to the original sequence and carrying out video coding to obtain a compressed video.
For example, as shown in fig. 3, fig. 3 is a specific flowchart of video frame merging according to an embodiment of the present invention, and the merging of the first region and the second region will now be described in detail with reference to fig. 3.
In step 301, the video frame is converted into a two-dimensional matrix, a first matrix of the region where the key object is located is extracted, and the position of the first matrix in the two-dimensional matrix is filled with a pure color.
In the specific implementation of step 302, the first matrix of the area where the key object is located and the two-dimensional matrix after the pure color filling are converted into images, i.e., the first area and the second area are obtained.
In step 303, the first region is first compressed, the second region is second compressed, and the compressed first region and second region are converted into a two-dimensional matrix.
In step 304, according to the size and position of the first area in the image information, the matrix of the first area is filled into the matrix of the second area to obtain a result matrix, and the result matrix is converted into an image to obtain a combined image frame.
In the specific implementation of step 211, the size of the current bandwidth is obtained, the compressed video obtained in step 204, step 208, or step 210 is used as a result video, and when the current bandwidth is greater than the bitrate of the result video, the result video is transmitted to a target device, where the target device may be a cloud server.
In the embodiment of the invention, the available bandwidth is compared with the video code rate of the video to be compressed, so that the compression strategy of the video to be compressed is determined. According to different network conditions and whether key targets are contained, different compression methods are adopted for the video to be compressed, the code rate of the video to be compressed can be ensured to be suitable for available bandwidth, meanwhile, the key areas have good picture quality, and the video watching experience of users is improved.
Fig. 4 is a specific flowchart of a result video transmission using a buffer according to an embodiment of the present invention.
In contrast to the foregoing implementation in which the resulting video is transmitted directly, in the implementation of step 401, the resulting video is saved to a buffer. Specifically, the cache may be stored locally in the server; alternatively, the cache may be a peripheral cache and communicate with the server.
In the specific implementation of step 402, the size of the current bandwidth is obtained, and when the current bandwidth is greater than the bitrate of the result video, the result video in the buffer is transmitted to the target device.
In specific implementation, if a plurality of result videos need to be transmitted, the result videos are sorted according to the time sequence of adding the result videos into the cache region, and the result videos which are added into the cache region first are transmitted first.
In the embodiment of the invention, the compressed result video is stored in the buffer area and is transmitted in the form of the queue, so that the problem of network congestion caused by simultaneous transmission of a plurality of result videos can be avoided, and the video transmission is ensured under the condition of not influencing the network environment.
As shown in fig. 5, an embodiment of the present invention further discloses a video compression apparatus. The video compression apparatus 50 includes:
an obtaining module 501, configured to obtain a video to be compressed.
A target detection module 502, configured to perform target detection on the video to be compressed when the available bandwidth is smaller than the video bitrate of the video to be compressed, so as to determine whether each video frame in the video to be compressed includes a key target.
A compressing module 503, configured to, when a video frame in the video to be compressed includes the key target, perform first compression on a first region of the video frame that includes the key target, and perform second compression on a second region of the video frame that does not include the key target, where the first region after compression has a first code rate, the second region after compression has a second code rate, a definition of the first region after compression is greater than a definition of the second region after compression, and a sum of the first code rate and the second code rate is less than or equal to the available bandwidth.
In a specific implementation, the video compression apparatus may correspond to a Chip having a video compression function in a server, such as a System-On-a-Chip (SOC), a baseband Chip, or the like; or the server comprises a chip module with a video compression function; or to a chip module having a chip with a data processing function, or to a server.
For more details of the operation principle and the operation manner of the video compression apparatus 50, reference may be made to the relevant description in fig. 1 to fig. 4, and details are not repeated here.
Each module/unit included in each apparatus and product described in the above embodiments may be a software module/unit, or may also be a hardware module/unit, or may also be a part of a software module/unit and a part of a hardware module/unit. For example, for each device or product applied to or integrated into a chip, each module/unit included in the device or product may be implemented by hardware such as a circuit, or at least a part of the module/unit may be implemented by a software program running on a processor integrated within the chip, and the rest (if any) part of the module/unit may be implemented by hardware such as a circuit; for each device or product applied to or integrated with the chip module, each module/unit included in the device or product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules/units may be implemented by using a software program running on a processor integrated within the chip module, and the rest (if any) of the modules/units may be implemented by using hardware such as a circuit; for each device and product applied to or integrated in the terminal, each module/unit included in the device and product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program running on a processor integrated in the terminal, and the rest (if any) part of the modules/units may be implemented by using hardware such as a circuit.
The embodiment of the invention also discloses a storage medium, which is a computer-readable storage medium and stores a computer program thereon, and the computer program can execute the steps of the methods shown in fig. 1 to 4 when running. The storage medium may include ROM, RAM, magnetic or optical disks, etc. The storage medium may further include a non-volatile memory (non-volatile) or a non-transitory memory (non-transient), and the like.
The embodiment of the invention also discloses a server, which may include a memory and a processor, where the memory stores a computer program operable on the processor, and the processor may execute the steps of the methods shown in fig. 1 to 4 when executing the computer program.
The "plurality" appearing in the embodiments of the present application means two or more.
The descriptions of the first, second, etc. appearing in the embodiments of the present application are only for illustrating and differentiating the objects, and do not represent the order or the particular limitation of the number of the devices in the embodiments of the present application, and do not constitute any limitation to the embodiments of the present application.
It should be understood that, in the embodiment of the present application, the processor may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example and not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (enhanced SDRAM), SDRAM (SLDRAM), synchlink DRAM (SLDRAM), and direct bus RAM (DR RAM).
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire or wirelessly. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately and physically included, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (12)
1. A method of video compression, comprising:
acquiring a video to be compressed;
when the available bandwidth is smaller than the video code rate of the video to be compressed, performing target detection on the video to be compressed to determine whether each video frame in the video to be compressed contains a key target;
when a video frame in the video to be compressed contains the key target, performing first compression on a first region containing the key target in the video frame, and performing second compression on a second region not containing the key target in the video frame, wherein the compressed first region has a first code rate, the compressed second region has a second code rate, the definition of the compressed first region is greater than that of the compressed second region, and the sum of the first code rate and the second code rate is less than or equal to the available bandwidth.
2. The method of claim 1, wherein the compressed first region has a first adjusted bitrate when the resolution of the compressed first region is the same as the resolution of the compressed second region, and wherein the first adjusted bitrate is greater than the second bitrate.
3. The video compression method according to claim 1, wherein the performing target detection on the video to be compressed comprises:
inputting the video to be compressed into a target detection model to determine whether each video frame in the video to be compressed contains the key target.
4. The video compression method of claim 1, further comprising:
and merging the compressed first region and the compressed second region to obtain a compressed video.
5. The video compression method of claim 1, further comprising:
and when the available bandwidth is larger than the video code rate of the video to be compressed, performing third compression on the video to be compressed, wherein the compressed video has a third code rate, and the third code rate is equal to the available bandwidth or the third code rate is the product of the available bandwidth and a preset proportion.
6. The video compression method of claim 1, further comprising:
and when the available bandwidth is smaller than the video code rate of the video to be compressed and each video frame does not contain the key target, performing fourth compression on the video to be compressed, wherein the compressed video has a fourth code rate, and the fourth code rate is smaller than or equal to the available bandwidth.
7. The video compression method according to claim 1, wherein the method for obtaining the available bandwidth comprises:
the network environment is periodically checked to obtain the size of the available bandwidth.
8. The video compression method according to any one of claims 4-6, further comprising:
and taking the compressed video as a result video and storing the result video in a cache region.
9. The video compression method according to any one of claims 4-6, further comprising:
determining a current bandwidth;
and taking the compressed video as a result video, and transmitting the result video to target equipment when the video code rate of the result video is smaller than the current bandwidth.
10. A video compression apparatus, comprising:
the acquisition module is used for acquiring a video to be compressed;
the target detection module is used for performing target detection on the video to be compressed when the available bandwidth is smaller than the video code rate of the video to be compressed so as to determine whether each video frame in the video to be compressed contains a key target;
the compression module is used for performing first compression on a first region containing the key target in the video frame and performing second compression on a second region not containing the key target in the video frame when the video frame in the video to be compressed contains the key target, the compressed first region has a first code rate, the compressed second region has a second code rate, the definition of the compressed first region is greater than that of the compressed second region, and the sum of the first code rate and the second code rate is less than or equal to the available bandwidth.
11. A server comprising a memory and a processor, the memory having stored thereon a computer program operable on the processor, wherein the processor, when executing the computer program, performs the steps of the video compression method of any of claims 1 to 9.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the video compression method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210199553.9A CN114584781A (en) | 2022-03-01 | 2022-03-01 | Video compression method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210199553.9A CN114584781A (en) | 2022-03-01 | 2022-03-01 | Video compression method and device and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114584781A true CN114584781A (en) | 2022-06-03 |
Family
ID=81776214
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210199553.9A Pending CN114584781A (en) | 2022-03-01 | 2022-03-01 | Video compression method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114584781A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116996617A (en) * | 2023-07-31 | 2023-11-03 | 咪咕音乐有限公司 | Video color ring display method and device, electronic equipment and medium |
-
2022
- 2022-03-01 CN CN202210199553.9A patent/CN114584781A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116996617A (en) * | 2023-07-31 | 2023-11-03 | 咪咕音乐有限公司 | Video color ring display method and device, electronic equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110222758B (en) | Image processing method, device, equipment and storage medium | |
US10728553B2 (en) | Visual quality preserving quantization parameter prediction with deep neural network | |
WO2019001108A1 (en) | Video processing method and apparatus | |
KR20180105294A (en) | Image compression device | |
US20180091768A1 (en) | Apparatus and methods for frame interpolation based on spatial considerations | |
CN109413434B (en) | Image processing method, device, system, storage medium and computer equipment | |
CN111445487A (en) | Image segmentation method and device, computer equipment and storage medium | |
CN114584781A (en) | Video compression method and device and computer readable storage medium | |
CN111243046B (en) | Image quality detection method, device, electronic equipment and storage medium | |
CN112990299A (en) | Depth map acquisition method based on multi-scale features, electronic device and storage medium | |
WO2023142715A1 (en) | Video coding method and apparatus, real-time communication method and apparatus, device, and storage medium | |
CN113613024B (en) | Video preprocessing method and device | |
CN112565819B (en) | Video data processing method and device, electronic equipment and storage medium | |
CN108933945B (en) | GIF picture compression method, device and storage medium | |
CN110475044B (en) | Image transmission method and device, electronic equipment and computer readable storage medium | |
CN112633198A (en) | Picture processing method and device, storage medium and electronic device | |
CN114638748A (en) | Image processing method, image restoration method, computer device, and storage medium | |
CN114040197B (en) | Video detection method, device, equipment and storage medium | |
CN112866692B (en) | HEVC-based coding unit dividing method and device and electronic equipment | |
KR20240124304A (en) | A Hybrid Framework for Point Cloud Compression | |
CN118283298A (en) | Video transmission method, processing method, apparatus, device, medium, and program product | |
CN117732042A (en) | Picture data processing method, device, electronic equipment, medium and program product | |
CN117560524A (en) | Video processing method, device, electronic equipment and storage medium | |
CN118827953A (en) | Video processing method, apparatus, device, storage medium and program product | |
CN116033167A (en) | Code rate control method, device, equipment and storage medium |
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 |