CN113965748A - High-fidelity video stream compression control method - Google Patents

High-fidelity video stream compression control method Download PDF

Info

Publication number
CN113965748A
CN113965748A CN202111244974.0A CN202111244974A CN113965748A CN 113965748 A CN113965748 A CN 113965748A CN 202111244974 A CN202111244974 A CN 202111244974A CN 113965748 A CN113965748 A CN 113965748A
Authority
CN
China
Prior art keywords
video
bit rate
resolution
output
input video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111244974.0A
Other languages
Chinese (zh)
Inventor
杨敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Focus Technology Co Ltd
Original Assignee
Focus 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 Focus Technology Co Ltd filed Critical Focus Technology Co Ltd
Priority to CN202111244974.0A priority Critical patent/CN113965748A/en
Publication of CN113965748A publication Critical patent/CN113965748A/en
Pending legal-status Critical Current

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/115Selection of the code volume for a coding unit prior to coding
    • 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

Landscapes

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

Abstract

A high fidelity video stream compression control method, 1) obtaining the resolution of input video and the target resolution 960 x 540, if the long edge and the short edge are both larger than the target resolution 960 and 540, scaling the long edge and the short edge in equal proportion to be larger than or equal to the resolution 960 or 540; if any long side or short side of the input resolution is smaller than 960 or 540, the output resolution is the existing input video resolution; 2) acquiring the bit rate of an input video and the output bit rate; wherein the bit rate of the input video is obtained by directly reading the input video; the output bit rate is the multiple of the number of output pixels x bits; 3) comparing the input video bit rate with the calculated bit rate, and if the bit rate is greater than the original video bit rate, using the original video bit rate; 4) and compressing the original input video into an output video according to the set output video size and the output bit rate parameter through a graphic processor of the mobile equipment.

Description

High-fidelity video stream compression control method
Technical Field
The invention relates to a design scheme, belongs to the technical field of video processing, and particularly relates to a video stream compression control method.
Background
The MPEG-1 standard video coding part adopts the measures of inter-frame prediction of motion compensation, two-dimensional DCT, VLC run length coding and the like. In addition, concepts such as an intra-frame (I), a prediction frame (P), a bidirectional prediction frame (B), a direct current frame (D) and the like are introduced, and the coding efficiency is further improved. On the basis of MPEG-1, the MPEG-2 standard makes some improvements in the aspects of improving the image resolution, being compatible with digital television and the like, for example, the precision of a proper amount of motion is half pixel; distinguishing between "frames" and "fields" in coding operations (such as motion estimation and DCT); coding scalability techniques such as spatial scalability, temporal scalability, and signal-to-noise scalability are introduced. The MPEG-4 standard introduced in recent years introduces Audio-Visual Object (AVO) based coding, which greatly improves the interactive capability and coding efficiency of video communication. Some new techniques such as shape coding, adaptive DCT, arbitrary starting video object coding, etc. are also used in MPEG-4. The basic video encoder of MPEG-4 also belongs to a class of hybrid encoders similar to MPEG-3. H.264 is established on the basis of MPEG-4 technology, and the encoding and decoding process mainly comprises 5 parts: inter and intra prediction (Estimation), Transform (Transform) and inverse Transform, Quantization (Quantization) and inverse Quantization, Loop Filter (Loop Filter), Entropy Coding (Entropy Coding).
In terms of video quality, frame rate: FPS (how many frames per second of picture); and Gop (indicating how many seconds an I frame); code rate (bit rate): the encoder compiles a data size per second in kbps, e.g., 800kbps represents the encoder generating 800KB (or 100KB) of data per second. Resolution ratio: the number of pixel points included in a unit inch; VGA: video Graphics Array (Video image resolution); wherein the frame rate is: influence the fluency of the picture, which is proportional to the fluency of the picture: the larger the frame rate is, the smoother the picture is; the smaller the frame rate, the more jerky the picture. If the code rate is variable, the frame rate also affects the volume, and the higher the frame rate is, the more pictures pass by per second, the higher the required code rate is, and the larger the volume is. Frame rate is the number of frames of a picture transmitted in 1 second time, and can also be understood as the number of times a graphics processor can refresh every second. Resolution ratio: affect the image size, proportional to the image size: the higher the resolution, the larger the image; the lower the resolution, the smaller the image. Definition: under the condition of a certain code rate, the resolution and the definition are in inverse proportion: the higher the resolution, the less sharp the image, and the lower the resolution, the sharper the image. Under the condition of a certain resolution, the code rate and the definition are in a direct proportion relation, and the higher the code rate is, the clearer the image is; the lower the code rate, the less clear the image. Data amount for one video stream: if the code rate is 10Mb/s, the video data with 10Mbit is represented in 1 second, and for 1080P video with YUV422 format, one frame of image is 1920x1080x2x8/1024/1024 being 31.64Mbit, and if 30 frames of image are 1 second, 949.2Mb/s exists, the data volume is large, the video cannot be spread on the network at all without compression, so the video compression processing is required; the video which is not 1080P is high definition, the definition is closely related to the video code rate, for the video of 1080P, the code rate of the blue-ray video is 20Mb/s, the code rate of the video which is generally downloaded is mostly 10Mb/s, the code rate of some IPCamera/unmanned aerial vehicles is 2-8 Mb/s, the code rate of many video websites is even lower than 5M/s, and the video is sometimes not as clear as 720P with high code rate. Good picture quality is a balance between resolution, frame rate and code rate: if the code rate is not larger, the better, and if the limitation on the code rate is not made, the higher the resolution is, the finer the image quality is; the higher the frame rate, the smoother the video, but the corresponding bitrate can be large because more data per second is needed to carry higher definition and smoothness. This is good for cloud service vendors (revenue is proportional to traffic), but may mean more expense for you. The frame rate is not more than 24, for example, if a code rate is limited, for example, 800kbps, the higher the frame rate is, the higher the compression ratio of the single frame picture is, i.e., the encoder has to increase the compression ratio of the single frame picture, i.e., the encoder has to reduce the picture quality to carry a sufficient number of frames. If the video source is from a camera, 24FPS is the visual limit, so that 20 frames of FPS can achieve good user experience. Although the game is smoother and higher in frame rate, the purpose of the game is to make the motion effect rendered by the 3D model closer to the real motion trajectory as much as possible, so the higher the frame rate is, the better the game is. However, for the camera, the target to be collected is the real world object, and the real world has no refresh rate, so the theory is not applicable. The resolution does not need to be increased blindly, for example, if a code rate is limited, such as 800kbps, the higher the resolution is, the more difficult the encoder is, conceivably, the east wall and west wall must be dismantled, and enough pixels can be borne by means of reducing color information or introducing mosaic, namely 'fish-eye mixing beads'. Therefore, also with a movie file of 2G, a 1080p quality version may not look as clear as a 720p quality version.
The wide adoption of audio, video and photographic images of mobile communication devices, unmanned aerial vehicles and monitoring devices and the sharp increase of the amount of transmitted information also cause the network transmission of the information to consume a large amount of bandwidth resources, for example, when a user needs to share the video shot by the user with others. Current smartphone cameras have tended to be specialized. Although the captured video is only tens of seconds or minutes. But the size of the video is still huge under the hold of the current mobile phone camera. This results in the photographer needing to upload video using more bandwidth data traffic and time. While the video receiver also has more bandwidth and data traffic to receive and takes longer video loading time.
Take a common Android smartphone in the market as an example. The shooting video size is 1080 × 1920, the video duration is 1 minute, the frame rate is 60 frames, and the video size is 304M. Without a corresponding optimization process on the video, the video uploader and the browsing user will consume a lot of time and bandwidth data traffic. While creating storage and downstream bandwidth burdens on the network and servers.
The main parameters of a video file are the resolution of the video, the video bit rate, and the key frame interval of the video. Where bit rate refers to the number of bits transmitted per second (bits). In bps (bit Per second), the higher the bit rate, the larger the data transmitted. A larger video bit rate for the same content represents a better overall video quality. Meanwhile, the size of the video is related to the duration of the video, and the size of one video is only related to the bit rate of the video and the duration of the video and is positively correlated.
The duration of the video cannot be controlled according to different use of the uploader. Then reasonably controlling the bit rate allows for as small a size of the compressed video as possible without affecting the video viewing quality. Perceptually, the larger the resolution of the video at the same time, the larger the corresponding video size. There is a positive correlation between the resolution of the video and the bit rate of the video. Then it is reasonable to control the video resolution and bit rate to a size that does not affect the video look and feel while compressing the video as much as possible. The prior art has not taken this into account.
The current mainstream resolution has 2k (2048 × 2080), 1080p (1920 × 1080), 720p (1280 × 720) compared by multiple video effects, if it is determined that 960 × 540 is a good resolution on the moving end.
Disclosure of Invention
The invention aims to provide a high-fidelity video stream compression control method (mobile terminals such as mobile phones and the like), which determines that 960 x 540 is a good resolution size on a mobile terminal through comparison of a plurality of groups of videos with different resolutions. The appropriate and more economical code rate can be determined by the program; and is based on the following principles: video bit rate, i.e., bitrate, is proportional to quality, but file size is also proportional to bitrate. And the code rate exceeds a certain value, so that the quality of the image is not greatly influenced.
The technical scheme of the invention is that a high-fidelity video stream compression control method comprises the following implementation steps:
step 1: the resolution of the input video is compared to the target resolution (960 x 540) and scaled to be equal to or greater than either resolution 960 or 540 if both long and short sides are greater than the target resolutions 960 and 540 (e.g., 2340 x1080 with the target resolution scaled to output resolution 1170 x 540). The output resolution is the existing input video resolution if the input resolution is either smaller than 960 or 540 on either the long or short side.
Step 2: the bit rate of the input video and the output bit rate are obtained. Where the input video bit rate is directly readable for input video acquisition. The output bit rate is the multiple of the number of output pixels (the video size and the video image quality can be considered by comparing the multiple of the video with the multiple of 3). For example, a bit rate of 1895400 bits is obtained based on the output resolution 1170 x 540.
And step 3: in contrast to the input video bit rate and the calculated bit rate, the original video bit rate is used if the calculated bit rate is greater than the original video bit rate (the sharpness of the video cannot be made clearer by changing the bit rate). The calculated bit rate is used if the calculated bit rate is less than the original video bit rate.
And 4, step 4: and the original input video is coded and decoded into an output video according to parameters such as the set size of the output video, the set output bit rate and the like through an image processing function of the mobile equipment.
Has the advantages that: the invention adopts an equal ratio scaling tool to compress the video into the video with the resolution of 960 or 540 being more than or equal to the resolution of the long side and the short side, the characters are elongated when some left and right format videos are played, and the proportion of the pictures of the player is adjusted to be only preset: default, 4: 3. 16: the image quality of 9 is not affected. The original video 2340 x1080 of 1 minute shot by the test handset with the size of 304M compressed and the size of 15M compressed can reach 20 times of the efficiency. The API program operation amount for setting the output video parameters by using the MediaFormat is extremely small and almost has no time lag; the rated optimal resolution function is achieved. Mobile terminals such as cell phones can also obtain video with as high fidelity as possible under video stream compression.
Drawings
Fig. 1 illustrates a method for calculating a resolution size of an acquired compressed video and a bit rate size of the video according to parameters of an input video. And compressing the video according to the obtained video parameters to obtain a compressed video flow.
Detailed Description
Fig. 1 is a specific flowchart of video compression implementation in the present invention, which includes the following specific steps:
step 1: the resolution of the output video is obtained by comparing the resolution of the input video with the resolution of the target video (the set long side and short side are both larger than the target resolutions 960 and 540).
Step 2: and obtaining the number of the pixels of the video according to the resolution of the output video. The bit rate of the output video is obtained by the bit rate multiple.
And step 3: and coding \ decoding the video according to the output resolution, resolution and default other parameters of the video obtained by calculation to obtain the compressed video.
1. The compression rate of the original video of 1 minute shot by the test mobile phone is 20 times (1/20) when the original video is 304M and the original video is 15M after compression;
2. the test video compression time 304M is 38 seconds, and the upload time calculated by the uplink bandwidth 1M is 15 seconds which is much shorter than 304 seconds of the upload time of the original video 304M.
3. The compression can be customized, and different compression effects can be realized according to different minimum target resolutions and bit rate multiples. For example, a minimum resolution of 720p (1280 × 720) and a bit rate multiple of 4 may also be set to achieve different compression effects. In this case, when a video having the same video size of 2340 × 1080 is compressed at the target resolution in an equal ratio to have the size of 1560 × 720, the output bit rate is 1280 × 720 × 4 — 3369600bit according to the bit rate multiple. Under the Android platform, encoding \ decoding processing of corresponding parameters can be carried out on the video by calling a GPU (graphics processing Unit). And setting output video parameters by calling APIMediaCODec (Android graphics processor bottom layer) and using MediaFormat. The size 1560 x 720 of the output video and the output bit rate 3369600bit are set. The Mediacodec then takes each frame of video in the decoding and encodes each frame to 1560 x 720 size according to the settings of the output parameters. Thereby obtaining the desired compression effect.

Claims (2)

1. A high-fidelity video stream compression control method is characterized by comprising the following steps:
step 1: acquiring the resolution of the input video and the target resolution 960 x 540, and scaling the resolution to be equal to or larger than the resolution 960 or 540 in a manner that the long edge and the short edge are both larger than the target resolutions 960 and 540; if any long side or short side of the input resolution is smaller than 960 or 540, the output resolution is the existing input video resolution;
step 2: acquiring the bit rate of an input video and the output bit rate; wherein the bit rate of the input video is obtained by directly reading the input video; the output bit rate is the multiple of the number of output pixels x bits;
and step 3: comparing the input video bit rate with the calculated bit rate, and if the bit rate is greater than the original video bit rate, using the original video bit rate; calculating the bit rate if the calculated bit rate is less than the original video bit rate;
and 4, step 4: and compressing the original input video into an output video according to the set output video size and the output bit rate parameter through a graphic processor of the mobile equipment.
2. The method for controlling the compression of the high-fidelity video stream according to claim 1, wherein the bit multiple of 3 in the step 2 can take into account the video size and the video picture quality.
CN202111244974.0A 2021-10-26 2021-10-26 High-fidelity video stream compression control method Pending CN113965748A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111244974.0A CN113965748A (en) 2021-10-26 2021-10-26 High-fidelity video stream compression control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111244974.0A CN113965748A (en) 2021-10-26 2021-10-26 High-fidelity video stream compression control method

Publications (1)

Publication Number Publication Date
CN113965748A true CN113965748A (en) 2022-01-21

Family

ID=79466913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111244974.0A Pending CN113965748A (en) 2021-10-26 2021-10-26 High-fidelity video stream compression control method

Country Status (1)

Country Link
CN (1) CN113965748A (en)

Similar Documents

Publication Publication Date Title
WO2021244341A1 (en) Picture coding method and apparatus, electronic device and computer readable storage medium
CN114071165B (en) Video encoder, video decoder and corresponding methods
US9143776B2 (en) No-reference video/image quality measurement with compressed domain features
CN111801943B (en) Chroma block prediction method, apparatus for encoding and decoding video data, and encoding and decoding apparatus
US20180077385A1 (en) Data, multimedia & video transmission updating system
Uhrina et al. Impact of H. 264/AVC and H. 265/HEVC compression standards on the video quality for 4K resolution
CN110546960B (en) Multi-layer video streaming system and method
US9871967B2 (en) Video transmission based on independently encoded background updates
CN113497937A (en) Image encoding method, image decoding method and related device
US20240080487A1 (en) Method, apparatus for processing media data, computer device and storage medium
Bienik et al. Impact of constant rate factor on objective video quality assessment
WO2024078066A1 (en) Video decoding method and apparatus, video encoding method and apparatus, storage medium, and device
WO2023051156A1 (en) Video image processing method and apparatus
WO2023071469A1 (en) Video processing method, electronic device and storage medium
CN113287301A (en) Inter-component linear modeling method and device for intra-frame prediction
CN113965748A (en) High-fidelity video stream compression control method
CN116962613A (en) Data transmission method and device, computer equipment and storage medium
Li et al. Performance comparison of H. 264 and H. 265 encoders for 4K video sequences
CN111050175A (en) Method and apparatus for video encoding
Rizal et al. Objective Quality Assessment of Multi-Resolution Video based on H. 264/AVC and H. 265/HEVC Encoding
RU2787713C2 (en) Method and device for chromaticity block prediction
CN116248895B (en) Video cloud transcoding method and system for virtual reality panorama roaming
CN113615191B (en) Method and device for determining image display sequence and video encoding and decoding equipment
CN117812268A (en) Video transcoding method, device, equipment and medium
CN104702970A (en) Video data synchronization method, device and system

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