CN113242434A - Video compression method and related device - Google Patents

Video compression method and related device Download PDF

Info

Publication number
CN113242434A
CN113242434A CN202110599275.1A CN202110599275A CN113242434A CN 113242434 A CN113242434 A CN 113242434A CN 202110599275 A CN202110599275 A CN 202110599275A CN 113242434 A CN113242434 A CN 113242434A
Authority
CN
China
Prior art keywords
frame loss
performance
source data
resolution
resolution adjustment
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.)
Granted
Application number
CN202110599275.1A
Other languages
Chinese (zh)
Other versions
CN113242434B (en
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.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center 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 Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202110599275.1A priority Critical patent/CN113242434B/en
Publication of CN113242434A publication Critical patent/CN113242434A/en
Application granted granted Critical
Publication of CN113242434B publication Critical patent/CN113242434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • 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/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a video compression method, which comprises the following steps: running a detection script to detect the performance of the system to obtain a performance value of the system; determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value; performing frame loss processing on video source data according to the frame loss rate; adjusting the resolution of the video source data according to the resolution adjustment target value; and compressing the video source data subjected to frame loss processing and resolution adjustment. The method can guarantee the system performance and the compressed video quality as much as possible. The application also discloses a video compression device, equipment and a computer readable storage medium, which have the technical effects.

Description

Video compression method and related device
Technical Field
The application relates to the technical field of computers, in particular to a video compression method; it also relates to a video compression apparatus, a device and a computer readable storage medium.
Background
The traditional video compression and transmission scheme in the base plate management control system is that the video data of a host is firstly transmitted to a frame loss module, and when the processing of a compression module at the later stage is not in time, the frame loss module executes the frame loss operation through flow control information. Since video compression is performed in units of BLOCK (8 × 8 macroblocks) and video source Data is input in lines, video Data passing through the frame loss module is first written in the DDR in lines and then read out from the DDR (Double Data Rate) in a form of BLOCK. The compression module compresses macro BLOCK data with BLOCK as a unit to obtain video compression data, and then writes the video compression data into DDR again. And when the network driver initiates a command of reading the compressed video, reading the video compressed data from the DDR, and performing network packaging. And then the network packet containing the video compression data is converted into an Ethernet frame format and then transmitted to a far end through a network or a network cable.
However, the video of the video card is continuously generated, and the occupation of the frame loss module and the compression module on the read-write of the DDR always exists. In the video compression process, the DDR is read and written for many times, which seriously affects the access of other applications in the SoC (System on Chip) System to the DDR, resulting in the reduction of the overall performance of the SoC System.
Therefore, how to combine system performance and compressed video quality has become a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a video compression method which can guarantee the quality of compressed video as far as possible while guaranteeing the system performance. It is another object of the present application to provide a video compression apparatus, a device and a computer readable storage medium, all having the above technical effects.
In order to solve the above technical problem, the present application provides a video compression method, including:
running a detection script to detect the performance of the system to obtain a performance value of the system;
determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
performing frame loss processing on video source data according to the frame loss rate;
adjusting the resolution of the video source data according to the resolution adjustment target value;
and compressing the video source data subjected to frame loss processing and resolution adjustment.
Optionally, the determining the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system includes:
and inquiring a preset corresponding relation table according to the performance value of the system to obtain the corresponding frame loss rate and the resolution adjustment target value.
Optionally, before querying a preset correspondence table to obtain the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system, the method further includes:
and determining the preset corresponding relation table corresponding to the detection script according to the detection script.
Optionally, the adjusting the resolution of the video source data according to the resolution adjustment target value includes:
and adjusting the resolution of the video source data output by the frame loss module according to the resolution adjustment target value.
Optionally, the detecting the performance of the system by the running detection script, and obtaining the performance value of the system includes:
and running the detection script to periodically detect the performance of the system to obtain the performance value of the system.
Optionally, the method further includes:
and after receiving the flow control information, performing frame loss processing on the video source data.
Optionally, the processing of frame loss for the video source data includes:
and performing frame loss processing on the video source data by taking a frame as a unit.
In order to solve the above technical problem, the present application further provides a video compression apparatus, including:
the detection module is used for running a detection script to detect the performance of the system and obtain a performance value of the system;
a configuration module for determining the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
the frame loss module is used for performing frame loss processing on video source data according to the frame loss rate;
the adjusting module is used for adjusting the resolution of the video source data according to the resolution adjusting target value;
and the compression module is used for compressing the video source data subjected to frame loss processing and resolution adjustment.
In order to solve the above technical problem, the present application further provides a video compression apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the video compression method as claimed in any one of the above when executing said computer program.
To solve the above technical problem, the present application further provides a computer-readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the video compression method as described in any one of the above.
The video compression method provided by the application comprises the following steps: running a detection script to detect the performance of the system to obtain a performance value of the system; determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value; performing frame loss processing on video source data according to the frame loss rate; adjusting the resolution of the video source data according to the resolution adjustment target value; and compressing the video source data subjected to frame loss processing and resolution adjustment.
Therefore, the video compression method provided by the application detects the performance of the system, determines the frame loss rate and the resolution adjustment target value according to the performance value of the system obtained by detection on the basis, further performs frame loss processing on video source data according to the frame loss rate, and adjusts the resolution of the video source data according to the resolution adjustment target value. Because the frame loss rate is negatively correlated with the performance value of the system, when the performance of the system is lower, the frame loss rate is higher, and the data volume of the video source data subjected to frame loss processing is reduced, so that the data volume interacted with the memory can be reduced, and the performance of the system is improved. Because the resolution adjustment target value is in positive correlation with the performance value of the system, when the performance of the system is low, the resolution adjustment target value is small, namely when the performance of the system is low, the resolution of the video source data is reduced, the data volume interacting with the memory is reduced, and the performance of the system is improved. When the system performance is better, the frame loss rate is smaller, and the resolution adjustment target value is larger, so that the quality of the compressed video can be effectively guaranteed. By reasonably setting the corresponding relation among the performance value, the frame loss rate and the resolution adjustment target value, the quality of the compressed video can be guaranteed as far as possible while the system performance is guaranteed.
The video compression device, the video compression equipment and the computer-readable storage medium have the technical effects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the prior art and the embodiments are briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of a video compression method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a video compression apparatus according to an embodiment of the present application;
fig. 3 is a schematic diagram of a video compression apparatus according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a video compression method, which can guarantee the system performance and the compressed video quality as much as possible. At the other core of the present application, there are provided a video compression apparatus, a device and a computer readable storage medium, all having the above technical effects.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application.
Referring to fig. 1, fig. 1 is a schematic flowchart of a video compression method according to an embodiment of the present application, and referring to fig. 1, the method includes:
s101: running a detection script to detect the performance of the system to obtain a performance value of the system;
specifically, an operating system is run on a Central Processing Unit (CPU), and the operating system is generally a Linux system. The detection script is run under the operating system. The function of the detection script is to run a benchmark test program (for example, benchmark program) to detect the performance of the system, and obtain a performance value of the system. The performance values of the system may be expressed in the form of scores.
The performance of the system may be a rate at which the system performs a certain operation, or a time taken for the system to complete a certain operation. For example, the rate at which the system performs a preset number of for cycles; the rate at which the system performs the matrix operation. Correspondingly, the performance value of the system is the corresponding fraction of the time taken by the system to complete an operation. For example, the time taken for the system to complete a certain matrix operation is 2s, and the corresponding fraction is 80%, i.e. the performance value of the system is 80%.
In addition, the method for running the detection script to detect the performance of the system and obtaining the performance value of the system may be: and running the detection script to periodically detect the performance of the system to obtain the performance value of the system. For example, the performance of the system is detected every 2 minutes by running a detection script, and a performance value of the system is obtained. The specific detection period can be set differently according to the actual application requirements.
S102: determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
specifically, on the basis of the performance value of the system obtained by detection, a corresponding frame loss rate is further determined according to the obtained performance value, so that frame loss processing is performed on video source data before the video source data is written into a memory (for example, DDR) according to the determined frame loss rate. In addition, a corresponding resolution adjustment target value is determined according to the obtained performance value, so that the resolution of the video source data is adjusted before the video source data is written into the memory according to the resolution adjustment target value.
The frame loss rate is inversely related to the performance value of the system. Therefore, the better the performance of the system is, the higher the performance value of the system is, and the lower the frame loss rate is, so that when the system performance is better, frames can not be lost or can be lost less, and the quality of the compressed video is guaranteed. The worse the performance of the system is, the lower the performance value of the system is, and the higher the frame loss rate is, so that when the performance of the system is poor, the performance of the system can be improved by multiple frame loss.
The resolution adjustment target value is positively correlated with the performance value of the system. Therefore, the better the performance of the system is, the higher the performance value of the system is, and the higher the resolution adjustment target value is, so that when the performance of the system is better, the quality of the compressed video can be effectively guaranteed by increasing the resolution of the video source data. The worse the performance of the system is, the lower the performance value of the system is, and the lower the resolution adjustment target value is, so that when the performance of the system is poor, the data volume of the video source data is reduced by adjusting the resolution of the video source data downwards, the data volume of interaction with the memory is reduced, and the performance of the system is improved.
In a specific embodiment, the manner of determining the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system is as follows: and inquiring a preset corresponding relation table according to the performance value of the system to obtain the corresponding frame loss rate and the corresponding resolution adjustment target value.
Specifically, a corresponding relation table of the system performance value, the frame loss rate and the resolution adjustment target value can be set by configuring a register in advance, and after the system performance value is detected, the frame loss rate and the resolution adjustment target value corresponding to the current system performance value are obtained by table lookup according to the configuration in the register.
For example, as shown in table 1:
TABLE 1
Figure BDA0003092198720000061
In table 1, the performance of the system is divided into 5 grades, and the performance values are 100%, 80%, 60%, 40% and 20% from high to low. Different performance values correspond to different frame loss rates and resolution adjustment target values. The frame loss rate corresponding to 100% of the performance value is 0, that is, no frame is lost, and the resolution adjustment target value is 1920 × 1440, that is, the original resolution is kept unchanged. That is, when the system performance is better, the resolution of the video source data is not adjusted and the original resolution of the video source data is kept unchanged without losing frames. The frame loss rate corresponding to the performance value of 20% is 4/7, and the resolution adjustment target value is 800 × 600, at this time, the frame loss processing is performed on the video source data according to the frame loss rate of 4/7, and the resolution of the video source data is adjusted to 800 × 600.
It can be understood that, for the grade division of the performance value, the combination mode of the performance value, the frame dropping rate and the resolution adjustment target value is not limited uniquely, and can be set adaptively according to the actual application requirements.
Besides, the corresponding relationship among the performance value, the frame dropping rate and the resolution adjustment target value is set by corresponding to the performance value, the frame dropping rate and the resolution, and the corresponding relationship among the performance value, the frame dropping rate and the resolution adjustment target value can also be set by corresponding to the performance value interval, the frame dropping rate and the resolution. For example, the frame loss rate corresponding to the performance value in the interval 80% to 100% is 0, and the resolution adjustment target value corresponding to the performance value is 1920 × 1440.
Further, on the basis of the foregoing embodiment, as a specific implementation manner, before querying a preset correspondence table to obtain the corresponding frame loss rate and the resolution adjustment target value according to the performance value of the system, the method may further include: and determining the preset corresponding relation table corresponding to the detection script according to the detection script.
In particular, different test scripts may differ in the goodness of the system performance as reflected by the performance values they detect. For example, a performance value of 100% as detected by test script 1 reflects better system performance, while a performance value of 100% as detected by test script 2 reflects more general system performance. Therefore, in order to be well suitable for different test scripts, different corresponding relation tables can be set in advance for different test scripts. Before obtaining the corresponding frame loss rate and the resolution adjustment target value according to the performance value of the system and a preset corresponding relation table, firstly determining the preset corresponding relation table corresponding to the detection script according to the detection script, and then determining the frame loss rate and the resolution according to the performance value of the system and the preset corresponding relation table corresponding to the test script.
For example, the preset correspondence table corresponding to the test script 1 is shown in table 1, and the preset correspondence table corresponding to the test script 2 is shown in table 2:
TABLE 2
Figure BDA0003092198720000071
When the test script is the test script 1, at this time, it is first determined that the corresponding preset corresponding relationship table is the corresponding relationship shown in table 1, if the performance value of the system detected at this time is 100%, the corresponding frame loss rate is 0, and the corresponding resolution adjustment target value is 1920 × 1440, that is, the original resolution of the video source data is kept unchanged. When the test script is the test script 2, at this time, it is first determined that the corresponding preset corresponding relationship table is the corresponding relationship shown in table 2, if the performance value of the system detected at this time is 100%, the corresponding frame loss rate is 1/3, and the corresponding resolution adjustment target value is 1280 x 960, that is, the video source data is adjusted from the original resolution 1920 x 1440 to 1280 x 960.
S103: performing frame loss processing on video source data according to the frame loss rate;
specifically, after determining the corresponding frame loss rate according to the performance value of the system, frame loss processing is performed on the video source data according to the frame loss rate. In order to ensure that the frame data is completely compressed, frame dropping can be performed in units of frames in the frame dropping process.
S104: and adjusting the resolution of the video source data according to the resolution adjustment target value.
S105: and compressing the video source data subjected to frame loss processing and resolution adjustment.
Specifically, after the corresponding resolution adjustment target value is determined according to the performance value of the system, the resolution of the video source data is adjusted according to the resolution adjustment target value. And then subsequently compressing the video source data after resolution adjustment, and writing compressed data obtained by compression into a memory. The network driver reads the compressed data from the memory and transmits the compressed data to a remote end for display through the network.
It should be noted that, in the present application, video source data refers to video data that is not compressed, and video data transmitted by a host and video data that is subjected to frame dropping processing by a frame dropping module are both referred to as video source data because they are not compressed.
The execution sequence of step S103 and step S104 is not limited uniquely in this application. Step S103 may be executed first, and then step S104 may be executed, after performing frame dropping processing on the video source data according to the frame dropping rate, the resolution of the video source data subjected to the frame dropping processing may be adjusted according to the resolution adjustment target value. Step S104 may be executed first, and then step S103 may be executed, and after the resolution of the video source data is adjusted according to the resolution adjustment target value, the video source data with the resolution adjusted may be subjected to frame dropping according to the frame dropping rate.
In order to increase the resolution adjustment speed, in a specific embodiment, the manner of adjusting the resolution of the video source data according to the resolution adjustment target value may be: and adjusting the resolution of the video source data output by the frame loss module according to the resolution adjustment target value.
Specifically, the present embodiment specifically adjusts the resolution of the video source data passing through the frame loss module. The video data of the host is firstly transmitted to a frame loss module, and the frame loss module has the function of carrying out frame loss processing. The video source data passing through the frame loss module is transmitted to the resolution adjustment module, the resolution adjustment module adjusts the resolution, and the video source data with the adjusted resolution is written into the memory. The data volume of the video source data after frame loss processing can be reduced, so that the data volume for subsequent resolution adjustment is reduced, and the resolution adjustment speed can be improved.
Further, on the basis of the above embodiment, the method further includes: and after receiving the flow control information, performing frame loss processing on the video source data.
In addition to actively detecting the performance of the system and performing frame dropping processing on the video source data according to the frame dropping rate corresponding to the performance value of the system, the embodiment also performs frame dropping processing on the video source data when passively receiving the flow control information. That is, the present embodiment has two parallel frame loss schemes, one of which is to actively perform frame loss according to the frame loss rate, and the other is to perform frame loss after passively receiving the flow control information.
For the specific implementation process of frame dropping processing and the specific implementation process of resolution adjustment, details are not repeated herein, and reference may be made to the related art.
In summary, the video compression method provided by the present application detects the performance of the system, and on this basis, determines the frame loss rate and the resolution adjustment target value according to the detected performance value of the system, and further performs frame loss processing on the video source data according to the frame loss rate, and adjusts the resolution of the video source data according to the resolution adjustment target value. Because the frame loss rate is negatively correlated with the performance value of the system, when the performance of the system is lower, the frame loss rate is higher, and the data volume of the video source data subjected to frame loss processing is reduced, so that the data volume interacted with the memory can be reduced, and the performance of the system is improved. Because the resolution adjustment target value is in positive correlation with the performance value of the system, when the performance of the system is low, the resolution adjustment target value is small, namely when the performance of the system is low, the resolution of the video source data is reduced, the data volume interacting with the memory is reduced, and the performance of the system is improved. When the system performance is better, the frame loss rate is smaller, and the resolution adjustment target value is larger, so that the quality of the compressed video can be effectively guaranteed. By reasonably setting the corresponding relation among the performance value, the frame loss rate and the resolution adjustment target value, the quality of the compressed video can be guaranteed as far as possible while the system performance is guaranteed.
The present application also provides a video compression apparatus, which is described below and to which the above-described method can be mutually referenced. Referring to fig. 2, fig. 2 is a schematic diagram of a video compression apparatus according to an embodiment of the present application, and referring to fig. 2, the apparatus includes:
the detection module 10 is used for running a detection script to detect the performance of the system and obtain a performance value of the system;
a configuration module 20, configured to determine a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
a frame loss module 30, configured to perform frame loss processing on video source data according to the frame loss rate;
an adjusting module 40, configured to adjust the resolution of the video source data according to the resolution adjustment target value;
and the compression module 50 is configured to perform compression processing on the video source data after frame loss processing and resolution adjustment.
In a specific embodiment, the frame loss module 30 is further configured to perform frame loss processing on the video source data after receiving the flow control information. The frame loss module 30 is specifically configured to perform frame loss processing on the video source data in units of frames.
Specifically, the detection module 10 runs the detection script to detect the performance of the system, and after obtaining the detection result, i.e. the performance value of the system, sends the performance value to the configuration module 20. After receiving the performance value of the system, the configuration module 20 determines the corresponding frame loss rate and resolution adjustment target value according to the performance value of the system. The configuration module 20 then configures the frame loss module 30 and the adjustment module 40.
The host video data first passes through a frame dropping module 30 before being compressed. The frame dropping module 30 has two main functions. One is to perform frame dropping processing on video source data according to the flow control information of the post-stage compression module 50, specifically, frame dropping processing can be performed in units of frames; and the second is to perform frame loss processing after receiving the frame loss rate issued by the configuration module 20.
The adjusting module 40 receives the configuration of the configuration module 20, adjusts the resolution of the video source data, realizes the inconsistency between the source resolution output by the host and the resolution compressed by the compression module, and reduces the data volume of the compressed video, thereby reducing the data volume interacting with the DDR and improving the system performance.
On the basis of the foregoing embodiment, optionally, the configuration module 20 is specifically configured to query a preset correspondence table according to the performance value of the system to obtain the corresponding frame loss rate and the resolution adjustment target value.
On the basis of the above embodiment, optionally, the method further includes:
and the determining module is used for determining the preset corresponding relation table corresponding to the detection script according to the detection script.
On the basis of the foregoing embodiment, optionally, the adjusting module 40 is specifically configured to adjust the resolution of the video source data output by the frame loss module 30 according to the resolution adjustment target value.
On the basis of the above embodiment, optionally, the detection module 10 is configured to run the detection script to periodically detect the performance of the system, so as to obtain a performance value of the system.
The video compression device and the video compression method provided by the application detect the performance of a system, determine a frame loss rate and a resolution adjustment target value according to the performance value of the system obtained by detection on the basis, further perform frame loss processing on video source data according to the frame loss rate, and adjust the resolution of the video source data according to the resolution adjustment target value. Because the frame loss rate is negatively correlated with the performance value of the system, when the performance of the system is lower, the frame loss rate is higher, and the data volume of the video source data subjected to frame loss processing is reduced, so that the data volume interacted with the memory can be reduced, and the performance of the system is improved. Because the resolution adjustment target value is in positive correlation with the performance value of the system, when the performance of the system is low, the resolution adjustment target value is small, namely when the performance of the system is low, the resolution of the video source data is reduced, the data volume interacting with the memory is reduced, and the performance of the system is improved. When the system performance is better, the frame loss rate is smaller, and the resolution adjustment target value is larger, so that the quality of the compressed video can be effectively guaranteed. By reasonably setting the corresponding relation among the performance value, the frame loss rate and the resolution adjustment target value, the quality of the compressed video can be guaranteed as far as possible while the system performance is guaranteed.
The present application also provides a video compression device, as shown with reference to fig. 3, comprising a memory 1 and a processor 2.
A memory 1 for storing a computer program;
a processor 2 for executing a computer program to implement the steps of:
running a detection script to detect the performance of the system to obtain a performance value of the system; determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value; performing frame loss processing on video source data according to the frame loss rate; adjusting the resolution of the video source data according to the resolution adjustment target value; and compressing the video source data subjected to frame loss processing and resolution adjustment.
For the introduction of the device provided in the present application, please refer to the above method embodiment, which is not described herein again.
The present application further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
running a detection script to detect the performance of the system to obtain a performance value of the system; determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value; performing frame loss processing on video source data according to the frame loss rate; adjusting the resolution of the video source data according to the resolution adjustment target value; and compressing the video source data subjected to frame loss processing and resolution adjustment.
The computer-readable storage medium may include: 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.
For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The video compression method, apparatus, device and computer readable storage medium provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method of video compression, comprising:
running a detection script to detect the performance of the system to obtain a performance value of the system;
determining a corresponding frame loss rate and a corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
performing frame loss processing on video source data according to the frame loss rate;
adjusting the resolution of the video source data according to the resolution adjustment target value;
and compressing the video source data subjected to frame loss processing and resolution adjustment.
2. The method of claim 1, wherein determining the respective frame loss rate and the respective resolution adjustment target value based on the system performance value comprises:
and inquiring a preset corresponding relation table according to the performance value of the system to obtain the corresponding frame loss rate and the corresponding resolution adjustment target value.
3. The video compression method of claim 2, wherein before querying a preset mapping table to obtain the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system, the method further comprises:
and determining the preset corresponding relation table corresponding to the detection script according to the detection script.
4. The video compression method of claim 1, wherein the adjusting the resolution of the video source data according to the resolution adjustment target value comprises:
and adjusting the resolution of the video source data output by the frame loss module according to the resolution adjustment target value.
5. The video compression method of claim 1, wherein the running test script tests the performance of the system, and obtaining the performance value of the system comprises:
and running the detection script to periodically detect the performance of the system to obtain the performance value of the system.
6. The video compression method of claim 5, further comprising:
and after receiving the flow control information, performing frame loss processing on the video source data.
7. The video compression method of claim 1 or 6, wherein the frame loss processing of the video source data comprises:
and performing frame loss processing on the video source data by taking a frame as a unit.
8. A video compression apparatus, comprising:
the detection module is used for running a detection script to detect the performance of the system and obtain a performance value of the system;
a configuration module for determining the corresponding frame loss rate and the corresponding resolution adjustment target value according to the performance value of the system; wherein the frame loss rate is negatively correlated with the system performance value, and the resolution adjustment target value is positively correlated with the system performance value;
the frame loss module is used for performing frame loss processing on video source data according to the frame loss rate;
the adjusting module is used for adjusting the resolution of the video source data according to the resolution adjusting target value;
and the compression module is used for compressing the video source data subjected to frame loss processing and resolution adjustment.
9. A video compression device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the video compression method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the video compression method according to any one of claims 1 to 7.
CN202110599275.1A 2021-05-31 2021-05-31 Video compression method and related device Active CN113242434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110599275.1A CN113242434B (en) 2021-05-31 2021-05-31 Video compression method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110599275.1A CN113242434B (en) 2021-05-31 2021-05-31 Video compression method and related device

Publications (2)

Publication Number Publication Date
CN113242434A true CN113242434A (en) 2021-08-10
CN113242434B CN113242434B (en) 2023-02-28

Family

ID=77135774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110599275.1A Active CN113242434B (en) 2021-05-31 2021-05-31 Video compression method and related device

Country Status (1)

Country Link
CN (1) CN113242434B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114466196A (en) * 2022-04-11 2022-05-10 苏州浪潮智能科技有限公司 Video data processing method, system, device and computer readable storage medium
CN114827662A (en) * 2022-03-18 2022-07-29 百果园技术(新加坡)有限公司 Video resolution self-adaptive adjusting method, device, equipment and storage medium
CN114827662B (en) * 2022-03-18 2024-06-25 百果园技术(新加坡)有限公司 Video resolution adaptive adjustment method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017080214A1 (en) * 2015-11-09 2017-05-18 乐视控股(北京)有限公司 Adaptive video definition adjustment method and apparatus, terminal device, and storage medium
CN109936744A (en) * 2017-12-19 2019-06-25 腾讯科技(深圳)有限公司 Video coding processing method, device and the application with Video coding function
CN111683251A (en) * 2020-05-28 2020-09-18 浪潮(北京)电子信息产业有限公司 Video data storage method and device and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017080214A1 (en) * 2015-11-09 2017-05-18 乐视控股(北京)有限公司 Adaptive video definition adjustment method and apparatus, terminal device, and storage medium
CN109936744A (en) * 2017-12-19 2019-06-25 腾讯科技(深圳)有限公司 Video coding processing method, device and the application with Video coding function
CN111683251A (en) * 2020-05-28 2020-09-18 浪潮(北京)电子信息产业有限公司 Video data storage method and device and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827662A (en) * 2022-03-18 2022-07-29 百果园技术(新加坡)有限公司 Video resolution self-adaptive adjusting method, device, equipment and storage medium
WO2023174216A1 (en) * 2022-03-18 2023-09-21 百果园技术(新加坡)有限公司 Video resolution adaptive adjustment method, apparatus and device, and storage medium
CN114827662B (en) * 2022-03-18 2024-06-25 百果园技术(新加坡)有限公司 Video resolution adaptive adjustment method, device, equipment and storage medium
CN114466196A (en) * 2022-04-11 2022-05-10 苏州浪潮智能科技有限公司 Video data processing method, system, device and computer readable storage medium

Also Published As

Publication number Publication date
CN113242434B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
CN109756230B (en) Data compression storage method, data compression method, device, equipment and medium
CN113242434B (en) Video compression method and related device
US20230281385A1 (en) Fpga-based fast protocol decoding method, apparatus, and device
CN107404654B (en) JPEG image decompression method, device and platform
US12001289B2 (en) Data recovery method, apparatus and device, and readable storage medium
CN113873255B (en) Video data transmission method, video data decoding method and related devices
CN112214366B (en) Test method, device, system, equipment and medium
CN111552669A (en) Data processing method and device, computing equipment and storage medium
CN111314640A (en) Video compression method, device and medium
CN106373616B (en) Method and device for detecting faults of random access memory and network processor
CN110955390B (en) Data processing method, device, electronic equipment and storage medium
WO2022228500A1 (en) Data storage method and apparatus for bios, device and storage medium
CN108599774B (en) Compression method, system, device and computer readable storage medium
US20240098316A1 (en) Video encoding method and apparatus, real-time communication method and apparatus, device, and storage medium
CN112671412A (en) Radar echo data compression method and device
US20180246657A1 (en) Data compression with inline compression metadata
US20170221447A1 (en) Data transmission method, data transmission system and portable display device
CN110909085A (en) Data processing method, device, equipment and storage medium
CN107708036B (en) Method and device for debugging output power of audio equipment
US11463493B2 (en) Method and apparatus for playing media file
CN110677728B (en) Method, device and equipment for playing video and storage medium
CN110189388B (en) Animation detection method, readable storage medium, and computer device
CN109542531B (en) File layout adjustment method and device
CN112558747A (en) Power capping method, system and related components of server
CN106970824B (en) Virtual machine migration compression method and system based on bandwidth sensing

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
GR01 Patent grant
GR01 Patent grant