CN113411587B - Video compression method, device and computer readable storage medium - Google Patents

Video compression method, device and computer readable storage medium Download PDF

Info

Publication number
CN113411587B
CN113411587B CN202110952206.4A CN202110952206A CN113411587B CN 113411587 B CN113411587 B CN 113411587B CN 202110952206 A CN202110952206 A CN 202110952206A CN 113411587 B CN113411587 B CN 113411587B
Authority
CN
China
Prior art keywords
video
picture
picture similarity
compression
video 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.)
Active
Application number
CN202110952206.4A
Other languages
Chinese (zh)
Other versions
CN113411587A (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.)
Beijing Century TAL Education Technology Co Ltd
Original Assignee
Beijing Century TAL Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Century TAL Education Technology Co Ltd filed Critical Beijing Century TAL Education Technology Co Ltd
Priority to CN202110952206.4A priority Critical patent/CN113411587B/en
Publication of CN113411587A publication Critical patent/CN113411587A/en
Application granted granted Critical
Publication of CN113411587B publication Critical patent/CN113411587B/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/42Methods 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/48Methods 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

Abstract

The embodiment of the disclosure provides a video compression method, a video compression device and a computer-readable storage medium, wherein the video compression method comprises the following steps: determining video compression parameters used when the first video is compressed according to the video attribute information of the first video; compressing the first video according to the video compression parameters to obtain a second video; calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value; if so, outputting a second video to play on the portable mobile terminal; and if the video similarity does not reach the preset threshold value, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value of the picture similarity. The video definition of the second video is guaranteed, and meanwhile the volume of the second video is made to be as small as possible.

Description

Video compression method, device and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer video processing technologies, and in particular, to a video compression method and apparatus, and a computer-readable storage medium.
Background
Video is the most popular way of information transfer, through which people can quickly learn the content of video and know the relevant information. However, since the video is too bulky to be transmitted and stored, it is necessary to compress the video and then store and transmit the compressed video.
In the existing video compression technology, video compression is generally performed according to the requirement of a fixed compression size, for example, according to preset fixed compression parameters, such as: code rate, resolution, etc.
However, in some application scenarios, how to guarantee the definition of the video in the video compression process and make the compressed volume as small as possible so as to facilitate storage and transmission become a technical problem to be solved urgently.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide a video compression method, apparatus, and computer storage medium to solve some or all of the above problems.
According to a first aspect of the embodiments of the present disclosure, there is provided a video compression method, including: determining video compression parameters used when the first video is compressed according to the video attribute information of the first video; compressing the first video according to the video compression parameters to obtain a second video; calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value; if so, outputting a second video to play on the portable mobile terminal; and if the video similarity does not reach the preset threshold value, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value of the picture similarity.
According to a second aspect of the embodiments of the present disclosure, there is provided a video compression apparatus including: the video compression parameter determining unit is used for determining video compression parameters used when the first video is compressed according to the video attribute information of the first video; the video compression unit is used for compressing the first video according to the video compression parameters to obtain a second video; the picture similarity calculation unit is used for calculating the picture similarity of the second video and the first video and judging whether the picture similarity reaches a set picture similarity threshold value; the video output unit outputs a second video to play on the portable mobile terminal if the picture similarity reaches a set picture similarity threshold; and the video compression parameter adjusting unit is used for adjusting the video compression parameters to re-compress the first video until the picture similarity between the obtained second video and the first video reaches the set picture similarity threshold value if the picture similarity does not reach the set picture similarity threshold value.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of the above embodiments.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer program comprising the method of any one of the above embodiments when the computer program is executed by a processor.
In the technical scheme provided by the embodiment of the disclosure, video compression parameters used when the first video is compressed are determined according to the video attribute information of the first video; compressing the first video according to the video compression parameters to obtain a second video; calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value; if so, outputting a second video to play on the portable mobile terminal; if the video compression parameter is not reached, the video compression parameter is adjusted to compress the first video again until the picture similarity of the obtained second video and the first video reaches a set picture similarity threshold value, so that the video definition of the second video is ensured, and the volume of the second video is convenient to store and transmit as small as possible.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a flowchart illustrating steps of a video compression method according to a first embodiment of the disclosure;
fig. 2 is a flowchart illustrating steps of a video compression method according to a second embodiment of the disclosure;
fig. 3 is a flowchart illustrating steps of a video compression method according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a video compression apparatus according to a fourth embodiment of the disclosure;
fig. 5 is a block diagram of an electronic device according to a fifth embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, but not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present disclosure should fall within the scope of protection of the embodiments in the present disclosure.
The following further describes specific implementations of the embodiments of the present disclosure with reference to the drawings of the embodiments of the present disclosure.
Referring to fig. 1, a flow chart of steps of a video compression method according to a first embodiment of the present disclosure is shown. The video compression method of the embodiment comprises the following steps:
step 101, determining a video compression parameter used when the first video is compressed according to video attribute information of the first video;
optionally, the video attribute information is used for describing video characteristics, such as: video size, video duration, rate, frame rate, etc., where a rate may be characterized by the number of transmitted bits per unit time and a frame rate may be characterized by the frequency with which images appear on a display in succession, in units of frames.
Optionally, the video compression parameters include impact factors that impact the compressed video volume and video sharpness, such as: at least one of a constant quality factor, a resolution and a frame rate, wherein, by the constant quality factor, the same type of video frame pictures can be compressed by the same number of frames in the compression process to realize constant quality, namely, the frame pictures containing the same or similar amount of information are discarded, and one frame of video frame pictures containing the information is reserved. The value range of the constant quality factor is, for example, 0 to 51, and when the value of the constant quality factor is smaller, the compression result is better, and the compression video is larger; when the value of the constant quality factor is larger, the more information contained in the video frame is omitted, and the smaller the first video is compressed, namely the smaller the compressed video is.
In one embodiment, before the first video is compressed, the video attribute information of the first video is analyzed from the description file of the first video in an automatic identification manner, or the video attribute information of the first video is copied from the description file of the first video by manually viewing the description file of the first video.
And 102, compressing the first video according to the video compression parameters to obtain a second video.
In particular, as mentioned above, the video compression parameters may include at least one of the above-mentioned constant quality factor, resolution, and frame rate. It should be noted that, by using the compression scheme of the present disclosure, the playing time of the video before and after compression is not changed, that is, the playing time of the first video after compression is not changed.
And 103, calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value.
Optionally, the picture similarity may include at least one of a picture brightness similarity, a picture contrast similarity, and a picture structure similarity, and may be specifically selected according to the requirements of the application scene.
Specifically, in calculating the picture Similarity, the calculation may be performed based on at least one of Mean Square Error (MSE), Structural Similarity Index (SSIM), and Peak Signal to Noise Ratio (PSNR).
Optionally, after obtaining a second video, performing key frame picture capturing processing on the first video and the second video respectively to obtain at least one first video key frame picture and at least one second video key frame picture, where the first video key frame picture and the second video key frame picture are defined based on picture content, for example; as described above, since the playing time of the video before and after compression is not changed, and the playing time of the first video after compression is not changed, that is, the first video and the second video have the same playing time, in step 103, the picture similarity between the first video key frame picture and the second video key frame picture at the same video playing time point is calculated, and it is determined whether the picture similarity reaches the set picture similarity threshold, and it is determined whether all the picture similarities reach the set picture similarity threshold.
104, if yes, outputting a second video to play on the portable mobile terminal; and if the video similarity does not reach the preset threshold value, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value of the picture similarity.
Specifically, the portable mobile terminal refers to a portable mobile terminal with a video playing function, for example: mobile phones, learning machines, tablets and the like. The display screens of such portable mobile terminals are all relatively small, so that high requirements are placed on the transmission speed and the storage size, and generally, under the condition that the network bandwidth for transmitting videos is not changed, the faster the transmission speed is, the smaller the occupied storage space is, the more the video playing is performed by the portable mobile terminal, but in the scheme of the embodiment, the picture similarity of the first video and the second video is compared with a preset picture similarity threshold, and if the picture similarity threshold is reached, the second video is directly output to be played on the portable mobile terminal; if the video compression parameter does not reach the preset threshold value, the video compression parameter is adjusted to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value, so that whether the video compression parameter needs to be adjusted to compress the first video again is determined through the picture similarity, the definition of the compressed video is ensured, the obtained compressed video is small in size, high-speed transmission is facilitated, and meanwhile, the occupied storage space is small. Specifically, when the picture similarity between the second video and the first video is greater than or equal to the picture similarity threshold, it indicates that the compressed second video is transmitted to the portable mobile terminal quickly, and has a higher video definition, and the storage space occupied on the portable mobile terminal is smaller. When the picture similarity between the second video and the first video is smaller than the similarity threshold, the obtained compressed video does not meet the video compression requirement, including video definition and video volume, and the video compression parameters, such as at least one value of constant quality factor, picture resolution and frame rate, are readjusted to re-compress the first video until the picture similarity between the obtained second video and the first video reaches the set picture similarity threshold.
In summary, in this embodiment, the picture similarity between the first video and the second video is compared with a preset picture similarity threshold, and if the picture similarity reaches the preset picture similarity threshold, the second video is directly output to be played on the portable mobile terminal; if the video compression parameter does not reach the preset threshold value, the video compression parameter is adjusted to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value, so that whether the video compression parameter needs to be adjusted to compress the first video again is determined through the picture similarity, the definition of the compressed video is ensured, the obtained compressed video is small in size, high-speed transmission is facilitated, and meanwhile, the occupied storage space is small.
Referring to fig. 2, a flow chart of steps of a video compression method according to a second embodiment of the present disclosure is shown. The video compression method of the embodiment comprises the following steps:
step 201, determining a video encoding format of the first video to determine a compression mode when compressing the first video.
Specifically, in this embodiment, the video encoding format may be an MP4 format such as h.263, h.264, and the like. Of course, this is merely an example and not a limitation.
Specifically, the compression mode may be determined based on the compression effect, and in the embodiment of the present disclosure, the compression mode is preferably an intermediate mode in which both the compressed video size and the video definition are guaranteed.
Step 202, determining video compression parameters used when the first video is compressed according to the video attribute information of the first video;
optionally, in this embodiment, the step 202 determines, according to the video attribute information of the first video, a video compression parameter used when performing compression processing on the first video, and includes: a plurality of sets of video compression parameters are stored in advance; correspondingly, in this embodiment, in step 202, specifically, according to the video attribute information of the first video, matching is performed on the sets of video compression parameters, so as to determine the video compression parameters used when performing compression processing on the first video.
In this embodiment, a plurality of sets of video compression parameters are stored in advance, so that after the video attribute information of the first video is obtained, the video compression parameters used when the first video is compressed are quickly matched from the plurality of sets of video compression parameters, and the efficiency of video compression is improved.
In this embodiment, the sets of prestored video compression parameters may be determined according to the requirements of the application scenario.
And 203, compressing the first video according to the video compression parameters to obtain a second video.
Specifically, in step 203, the first video is compressed according to the video compression parameters based on the compression mode, so as to obtain the second video.
Alternatively, in this embodiment, the compression may be implemented by commonly used compression software, such as Windows video compression software, and FFmpeg multimedia processing tool. And during compression, configuring a compression mode on the compression software, and compressing the first video by using the video compression parameters based on the selected compression mode, so that the definition of the compressed video is ensured, and meanwhile, the volume of the compressed video is ensured to be smaller.
And 204, calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value.
Optionally, in this embodiment, in step 204 or between step 203 and step 204, key frame picture capturing processing is performed on the first video and the second video, respectively, to obtain at least one first video key frame picture and at least one second video key frame picture. As previously mentioned, key frame pictures are defined, for example, based on picture content.
Optionally, in this embodiment, the capturing manner may be to perform video playing picture capturing at equal time intervals or at unequal time intervals. The size of the equal time interval and the size of the unequal time interval are flexibly set according to the application scene. Compared with the prior art, the capturing modes with unequal time intervals can respectively reduce the frames which continuously contain the same frame content in the frames captured from the first video and the second video, so that the obtained first video key frame frames are different as much as possible, and the obtained second video key frame frames are different as much as possible, thereby avoiding the poor effectiveness of the calculation result caused by the redundancy of the key frame frames when the calculation of the frame similarity is carried out.
As described above, since the playing durations of the first video and the second video are the same, in order to facilitate comparison of the video image similarity, the video playing images at the same playing time points of the first video and the second video may be respectively captured, that is, the key frame image of the first video and the key frame image of the second video are obtained. Preferably, the first video play out picture and the second video play out picture are intercepted at unequal time intervals (…), so as to obtain a first video key frame picture and a second video key frame picture at intervals of 1s, 3s, 5s and 20s respectively.
Step 205, if yes, outputting a second video to play on the portable mobile terminal; and if the video similarity does not reach the preset threshold value, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value of the picture similarity.
In this embodiment, reference may be made to the description of the first embodiment in step 204 and step 205.
Optionally, in step 205, if the video compression parameter is not reached, the adjusting the video compression parameter specifically includes: if the video compression parameters at least comprise a constant quality factor, reducing the constant quality factor so as to control the video definition of the compressed video; or if the video compression parameters at least comprise picture resolution, increasing the picture resolution so as to control the volume of the compressed video; or if the video compression parameters at least comprise a frame rate, reducing the frame rate, thereby controlling the volume of the compressed video. When the constant quality factor, the picture resolution and the frame rate are included at the same time, the constant quality factor, the picture resolution and the frame rate can be adjusted at the same time to ensure the video definition of the compressed video and the volume of the compressed video.
For example, in a specific application scenario, the constant quality factor is decreased from 24 to 20, the resolution is increased from 960X 720 to 1280X720, and the frame rate is decreased from 60 to 24.
Referring to fig. 3, a flow chart of steps of a video compression method according to a third embodiment of the present disclosure is shown. Optionally, in this embodiment, different from the above embodiment, the set picture similarity threshold has a tolerance, so that the set picture similarity threshold has a lower limit value and an upper limit value; specifically, the video compression method of the present embodiment includes the following steps:
step 301, determining a video compression parameter used when compressing a first video according to video attribute information of the first video;
and 302, compressing the first video according to the video compression parameters to obtain a second video.
Step 303, calculating the picture similarity between the second video and the first video, and determining whether the picture similarity reaches a preset picture similarity threshold.
Optionally, in step 303, when determining whether the picture similarity reaches the set picture similarity threshold, it is determined whether the picture similarity exceeds a range defined by a lower limit and an upper limit of the set picture similarity threshold, and as long as the picture similarity exceeds the range defined by the lower limit and the upper limit of the set picture similarity threshold, the number of times of repeated compression is reduced, and the efficiency of video compression is improved.
Specifically, in a specific application scenario, the tolerance refers to an error allowed by an optimal value of the similarity between the first video key frame picture and the second video key frame picture, for example, 5%, and the tolerance ranges from (-5%, + 5%). The upper limit of the picture similarity threshold is the sum of the optimal value of the picture similarity and 5%, for example: if the picture similarity threshold is 90%, the upper limit of the picture similarity threshold is 95%; the lower limit of the picture similarity threshold is the difference between the optimal value of the picture similarity and 5%, for example: if the threshold of the picture similarity is 90%, the lower limit of the threshold of the picture similarity is 85%, and if the threshold of the picture similarity exceeds the range defined by 85% -95%, the picture similarity is judged.
Step 304, if yes, outputting a second video to play on the portable mobile terminal; and if the video similarity does not reach the preset threshold value, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the preset threshold value of the picture similarity.
Optionally, in the foregoing embodiment or other embodiments, the number of times of recompressing the first video by using the same video compression parameter does not exceed a preset number of times of compression, which may be 3 times, and if the picture similarity does not reach the set picture similarity threshold after the preset number of times of compression, the second video is discarded and the first video is output. Alternatively, in the above embodiment or other embodiments, if the number of times of recompressing the first video by using the same video compression parameter exceeds a preset number of times of compression, which may be 3 times, and the picture similarity does not reach the set picture similarity threshold, the video compression parameter is determined again to recompress the first video.
Optionally, determining a video compression parameter used when compressing the first video according to the video attribute information of the first video, where before, the determining includes: and compressing the source video by using preset video compression parameters to obtain a first video, wherein the picture similarity of the first video and the source video does not reach a set picture similarity threshold value.
When it needs to be described, the first video is obtained by compressing the source video, and in this process, the compression parameter does not need to be adjusted, but the source video is directly compressed by the historical compression parameter, in one case: when the source video is compressed through the historical compression parameters, and when the picture similarity of the first video and the source video reaches the similarity of a preset picture, namely the compression result reaches the required compression effect, the first video can be directly used as the output video.
The above embodiments can be applied to internet teaching scenarios, where the application scenario includes a teacher end that can provide a source video, a student end, and a server that executes the above compression method.
Referring to fig. 4, a schematic structural diagram of a video compression apparatus according to a fourth embodiment of the present disclosure is shown, and it should be noted that a video compression method that can be implemented by the video compression apparatus is consistent with the method shown in the first embodiment, and is not described again here.
The video compression apparatus 40 of the present embodiment includes:
a video compression parameter determining unit 401, configured to determine, according to video attribute information of a first video, a video compression parameter used when performing compression processing on the first video;
a video compression unit 402, configured to compress a first video according to a video compression parameter to obtain a second video;
a picture similarity calculation unit 403, configured to calculate picture similarities of the second video and the first video, and determine whether the picture similarities reach a set picture similarity threshold;
a video output unit 404, which outputs a second video to play on the portable mobile terminal if the picture similarity reaches a set picture similarity threshold;
the video compression parameter adjusting unit 405 is configured to adjust a video compression parameter to re-compress the first video until the picture similarity between the obtained second video and the first video reaches the set picture similarity threshold if the picture similarity does not reach the set picture similarity threshold.
Optionally, the video compression unit 402 is further configured to determine a video coding format of the first video, so as to determine a compression mode when performing compression processing on the first video; and based on the compression mode, compressing the first video according to the video compression parameters to obtain a second video.
Optionally, the picture similarity calculation unit 403 is further configured to perform key frame picture clipping processing on the first video and the second video, respectively, to obtain at least one first video key frame picture and at least one second video key frame picture; calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value, wherein the method comprises the following steps: calculating the picture similarity of a first video key frame picture and a second video key frame picture with the same video playing time point, and judging whether the picture similarity reaches a set picture similarity threshold value or not.
Optionally, the video compression parameter adjusting unit 405 is further configured to decrease the constant quality factor if the video compression parameter at least includes the constant quality factor; or if the video compression parameters at least comprise the picture resolution, increasing the picture resolution; or, if the video compression parameters include at least a frame rate, reducing the frame rate.
Optionally, the picture similarity calculating unit 403 is further configured to set a picture similarity threshold having a tolerance, where the set picture similarity threshold has a lower limit and an upper limit; judging whether the picture similarity reaches a set picture similarity threshold value or not, comprising the following steps: and judging whether the picture similarity exceeds the range defined by the lower limit value and the upper limit value of the set picture similarity threshold value.
Optionally, the video compression unit 402 is further configured to use the same video compression parameter to re-compress the first video for a number of times that does not exceed a preset number of compression times, and output the first video if the picture similarity reaches a set picture similarity threshold after the preset number of compression times.
Optionally, the video compression unit 402 is further configured to determine the video compression parameter again to re-compress the first video if the number of times of re-compressing the first video using the same video compression parameter exceeds a preset number of times of compression and the picture similarity does not reach the set picture similarity threshold.
Optionally, the video compression parameter determining unit 401 is further configured to determine, according to the video attribute information of the first video, a video compression parameter used when performing compression processing on the first video, where the determining includes: a plurality of sets of video compression parameters are stored in advance; determining video compression parameters used when the first video is compressed according to the video attribute information of the first video, wherein the video compression parameters comprise: and matching the sets of video compression parameters according to the video attribute information of the first video so as to determine the video compression parameters used when the first video is compressed.
Optionally, the video compression unit 402 is further configured to compress the source video by using a preset video compression parameter to obtain a first video, where the picture similarity between the first video and the source video does not reach a set picture similarity threshold.
There is also provided, in accordance with an embodiment of the present disclosure, a non-transitory computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of the above embodiments.
According to an embodiment of the disclosure, there is also provided a computer program, comprising the method of any of the above embodiments, when executed by a processor.
It should be noted that, according to the implementation requirement, each component/step described in the embodiments of the present disclosure may be split into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiments of the present disclosure.
An exemplary embodiment of the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
Referring to fig. 5, a block diagram of a structure of an electronic device, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 506 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the electronic device 500 are connected to the I/O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 may be any type of device capable of inputting information to the electronic device 500, and the input unit 506 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. Output unit 507 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 504 may include, but is not limited to, magnetic or optical disks. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 performs the respective methods and processes described above. For example, in some embodiments, the steps 101-.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (12)

1. A method of video compression, comprising:
determining video compression parameters used when the first video is compressed according to video attribute information of the first video;
compressing the first video according to the video compression parameters to obtain a second video; calculating the picture similarity of the second video and the first video, and judging whether the picture similarity reaches a set picture similarity threshold value; respectively carrying out key frame picture interception processing on the first video and the second video to obtain at least one first video key frame picture and at least one second video key frame picture;
the calculating the picture similarity between the second video and the first video and judging whether the picture similarity reaches a set picture similarity threshold value comprises the following steps: calculating the picture similarity of a first video key frame picture and a second video key frame picture with the same video playing time point, and judging whether the picture similarity reaches a set picture similarity threshold value or not;
if yes, outputting the second video to play on the portable mobile terminal; if not, adjusting the video compression parameters to compress the first video again until the picture similarity between the obtained second video and the first video reaches the set picture similarity threshold;
if not, adjusting the video compression parameters, including: if the video compression parameters include at least a constant quality factor, decreasing the constant quality factor; or if the video compression parameters at least comprise picture resolution, increasing the picture resolution; or if the video compression parameters at least comprise a frame rate, reducing the frame rate.
2. The video compression method of claim 1, wherein the video compression method further comprises: determining a video coding format of the first video to determine a compression mode when compressing the first video;
compressing the first video according to the video compression parameters to obtain a second video, including: and compressing the first video according to the video compression parameters based on the compression mode to obtain a second video.
3. The video compression method according to claim 1, wherein the set picture similarity threshold has a tolerance level, the set picture similarity threshold has a lower limit value and an upper limit value;
judging whether the picture similarity reaches a set picture similarity threshold value or not, comprising the following steps: and judging whether the picture similarity exceeds the range defined by the lower limit value and the upper limit value of the set picture similarity threshold value.
4. The video compression method of claim 1, wherein the number of times of compressing the first video using the same video compression parameter does not exceed a preset number of times of compression, and the first video is output if the picture similarity does not reach a set picture similarity threshold after the preset number of times of compression.
5. The video compression method of claim 1, wherein if the number of times of compressing the first video using the same video compression parameter exceeds a preset number of times of compression and the picture similarity does not reach a set picture similarity threshold, the video compression parameter is determined again to re-compress the first video.
6. The video compression method according to claim 1, wherein the determining, according to the video attribute information of the first video, the video compression parameters used for compressing the first video comprises: a plurality of sets of video compression parameters are stored in advance;
the determining, according to the video attribute information of the first video, a video compression parameter used when the first video is compressed includes: and matching the sets of video compression parameters according to the video attribute information of the first video so as to determine the video compression parameters used when the first video is compressed.
7. The video compression method according to any one of claims 1 to 6, wherein the determining, according to the video attribute information of the first video, the video compression parameters used for compressing the first video previously comprises: and compressing a source video by using preset video compression parameters to obtain the first video, wherein the picture similarity between the first video and the source video does not reach the set picture similarity threshold value.
8. The video compression method according to claim 7, wherein the preset video compression parameters are: video compression parameters used in historical compression of the source video.
9. The video compression method of claim 7, wherein the picture similarity comprises at least one of a picture brightness similarity, a picture contrast similarity, and a picture structure similarity.
10. The video compression method of claim 7, wherein the video attribute information comprises at least one of video size, video duration, bitrate, and frame rate.
11. A video compression apparatus, comprising:
the video compression parameter determining unit is used for determining video compression parameters used when the first video is compressed according to the video attribute information of the first video;
the video compression unit is used for compressing the first video according to the video compression parameters to obtain a second video;
the picture similarity calculation unit is used for calculating the picture similarity of the second video and the first video and judging whether the picture similarity reaches a set picture similarity threshold value;
the picture similarity calculation unit is further used for respectively carrying out key frame picture interception processing on the first video and the second video so as to obtain at least one first video key frame picture and at least one second video key frame picture;
the calculating the picture similarity between the second video and the first video and judging whether the picture similarity reaches a set picture similarity threshold value comprises the following steps: calculating the picture similarity of a first video key frame picture and a second video key frame picture with the same video playing time point, and judging whether the picture similarity reaches a set picture similarity threshold value or not;
the video output unit is used for outputting the second video to play on the portable mobile terminal if the picture similarity reaches a set picture similarity threshold;
the video compression parameter adjusting unit is used for adjusting the video compression parameters to re-compress the first video if the picture similarity does not reach a set picture similarity threshold value until the picture similarity between the obtained second video and the first video reaches the set picture similarity threshold value;
the compression adjusting unit is further configured to, if the video compression parameter is not reached, adjust the video compression parameter, including: if the video compression parameters include at least a constant quality factor, decreasing the constant quality factor; or if the video compression parameters at least comprise picture resolution, increasing the picture resolution; or if the video compression parameters at least comprise a frame rate, reducing the frame rate.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-10.
CN202110952206.4A 2021-08-19 2021-08-19 Video compression method, device and computer readable storage medium Active CN113411587B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110952206.4A CN113411587B (en) 2021-08-19 2021-08-19 Video compression method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110952206.4A CN113411587B (en) 2021-08-19 2021-08-19 Video compression method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113411587A CN113411587A (en) 2021-09-17
CN113411587B true CN113411587B (en) 2021-11-16

Family

ID=77688762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110952206.4A Active CN113411587B (en) 2021-08-19 2021-08-19 Video compression method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113411587B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115484494B (en) * 2022-09-15 2024-04-02 云控智行科技有限公司 Digital twin video stream processing method, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491320A (en) * 2014-09-16 2016-04-13 鸿富锦精密工业(深圳)有限公司 Video conference bandwidth management method and system
CN106789555A (en) * 2016-11-25 2017-05-31 努比亚技术有限公司 Method of transmitting video data and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9307225B2 (en) * 2012-10-25 2016-04-05 Citrix Systems, Inc. Adaptive stereoscopic 3D streaming

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491320A (en) * 2014-09-16 2016-04-13 鸿富锦精密工业(深圳)有限公司 Video conference bandwidth management method and system
CN106789555A (en) * 2016-11-25 2017-05-31 努比亚技术有限公司 Method of transmitting video data and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
H.264视频压缩参数设置的应用研究;赵建保等;《影视制作》;20121231(第12期);全文 *

Also Published As

Publication number Publication date
CN113411587A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
US9872021B2 (en) Video conversion method and apparatus
CN110430441B (en) Cloud mobile phone video acquisition method, system, device and storage medium
JP2020096342A (en) Video processing method and apparatus
WO2020042350A1 (en) Desktop screen projection method and device, apparatus, and storage medium
US10645391B2 (en) Graphical instruction data processing method and apparatus, and system
US10834405B2 (en) Bit rate allocation method and device, and storage medium
CN111263243B (en) Video coding method and device, computer readable medium and electronic equipment
CN112653898B (en) User image generation method, related device and computer program product
CN113411587B (en) Video compression method, device and computer readable storage medium
EP4135325A1 (en) Method and apparatus for encoding video, electronic device, and storage medium
CN111970565A (en) Video data processing method and device, electronic equipment and storage medium
EP3070951A1 (en) Video code stream obtaining method and apparatus
CN112437301B (en) Code rate control method and device for visual analysis, storage medium and terminal
CN112261408B (en) Image processing method and device for head-mounted display equipment and electronic equipment
CN110740316A (en) Data coding method and device
CN115767146A (en) Data flow control method, system, device, electronic equipment and storage medium
CN107872683A (en) A kind of video data handling procedure, device, equipment and storage medium
CN113965779A (en) Cloud game data transmission method, device and system and electronic equipment
EP3806026A1 (en) Method and apparatus for enhancing video image quality
US11748915B2 (en) VR image compression transmission method and system
CN116033235B (en) Data transmission method, digital person production equipment and digital person display equipment
WO2024045026A1 (en) Display method, electronic device, display device, screen mirroring device and medium
CN115767116A (en) Data processing method and device based on cloud application, electronic equipment and storage medium
EP3806455A1 (en) Video control method, video conference terminal and multi-point control unit (mcu)
CN117692680A (en) Conference video stream control method and device and electronic equipment

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