WO2023174216A1 - Video resolution adaptive adjustment method, apparatus and device, and storage medium - Google Patents

Video resolution adaptive adjustment method, apparatus and device, and storage medium Download PDF

Info

Publication number
WO2023174216A1
WO2023174216A1 PCT/CN2023/081121 CN2023081121W WO2023174216A1 WO 2023174216 A1 WO2023174216 A1 WO 2023174216A1 CN 2023081121 W CN2023081121 W CN 2023081121W WO 2023174216 A1 WO2023174216 A1 WO 2023174216A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
image
processing
resolution
frame rate
Prior art date
Application number
PCT/CN2023/081121
Other languages
French (fr)
Chinese (zh)
Inventor
陈俊奎
谢澜
陈新泽
Original Assignee
百果园技术(新加坡)有限公司
陈俊奎
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 百果园技术(新加坡)有限公司, 陈俊奎 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2023174216A1 publication Critical patent/WO2023174216A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234363Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by altering the spatial resolution, e.g. for clients with a lower screen resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2405Monitoring of the internal components or processes of the server, e.g. server load
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/4424Monitoring of the internal components or processes of the client device, e.g. CPU or memory load, processing speed, timer, counter or percentage of the hard disk space used

Definitions

  • Embodiments of the present application relate to the field of video processing technology, and in particular, to a video resolution adaptive adjustment method, device, equipment and storage medium.
  • the anchor side collects video images through the camera, pre-processes the collected video images, and then renders and displays them on the screen of the anchor side.
  • the anchor side encodes the pre-processed video images and packages them into protocol packets, and forwards them to the audience side through the backend server.
  • the audience side decodes and renders them to the audience side's screen for display.
  • Embodiments of the present application provide a video resolution adaptive adjustment method, device, equipment and storage medium, which solves the problem of poor balance between clarity and fluency during video playback, realizes adaptive adjustment of video resolution, and provides Users are provided with a high-quality video experience.
  • embodiments of the present application provide a video resolution adaptive adjustment method, which method includes:
  • the maximum processing frame rate is calculated according to the processing time consumption, and the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
  • the resolution of the video image is increased.
  • embodiments of the present application also provide a video resolution adaptive adjustment device, including:
  • the data acquisition module is configured to obtain the number of dropped frames of the video image and the processing time of a single frame image
  • a frame rate calculation module configured to calculate the maximum processing frame rate based on the processing time
  • a status information determination module configured to determine status information of the video frame based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
  • a resolution adjustment module configured to lower the resolution of the video image if the status information indicates performance overload, and to increase the resolution of the video image if the status information indicates excess performance.
  • embodiments of the present application also provide a video resolution adaptive adjustment device, which includes:
  • processors one or more processors
  • a storage device for storing one or more programs
  • the one or more processors are caused to implement the video resolution adaptive adjustment method described in the embodiments of this application.
  • embodiments of the present application also provide a storage medium that stores computer-executable instructions, which when executed by a computer processor are used to perform the video resolution adaptation described in the embodiments of the present application. Adjustment method.
  • embodiments of the present application also provide a computer program product.
  • the computer program product includes a computer program.
  • the computer program is stored in a computer-readable storage medium.
  • At least one processor of the device reads the computer program from the computer-readable storage medium.
  • Obtain and execute the computer program causing the device to execute the video resolution adaptive adjustment method described in the embodiments of this application.
  • the number of dropped frames of the video image and the processing time of a single frame image are obtained.
  • the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate.
  • the status information includes performance overload and excess performance. If the status information is performance overload, the resolution of the video image is adjusted downward. If the status information is excess performance, the resolution is adjusted upward. Adjusting the resolution of the video image achieves adaptive adjustment of the video resolution, weighs and optimizes the balance between clarity and smoothness during video playback, and provides users with a high-quality video experience.
  • Figure 1 is a flow chart of a video resolution adaptive adjustment method provided by an embodiment of the present application
  • Figure 2 is a flow chart of a method for determining status information of a video frame provided by an embodiment of the present application
  • Figure 3 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application.
  • Figure 4 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application.
  • Figure 5 is a structural block diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application.
  • Figure 6 is a schematic structural diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • Figure 1 is a flow chart of a video resolution adaptive adjustment method provided by an embodiment of the present application, which can be used to adaptively adjust the resolution of video images.
  • This method can be performed by computing devices such as servers, smart terminals, and laptops. , tablet computers, etc. to execute, including the following steps:
  • Step S101 Obtain the number of dropped frames of the video image and the processing time of a single frame image.
  • the number of lost frames is the number of lost frames during the encoding process of the video image.
  • the video image passes through After processing, it is sent to the encoding queue to be compressed and encoded by the encoder.
  • the pre-processing process includes a series of processing processes such as data cleaning, skin color processing, skin grinding, noise reduction and face positioning for each frame of image collected by the camera.
  • the size of the encoding queue is a fixed length, that is, when the speed of encoding each frame of video image is less than the speed of the image input to the encoding queue, the excess image frames will overflow, causing frame loss and freezing.
  • the number of lost frames can be obtained by counting the number of frames input to the encoding queue and the number of encoding processing frames. For example, the number of frames input to the encoding queue within a set fixed time minus the number of encoding processing frames can be obtained. The number of dropped frames.
  • the processing time of the single frame image may be the processing time of each frame of the video image during the encoding process. It is calculated by the processing time of the acquired single frame image.
  • the calculation process includes: obtaining the processing time of a single frame image, and calculating the processing time of the single frame image based on the processing time and the set motion weighted exponential filtering formula. Specifically, the calculation formula is as follows:
  • t i is the processing time consumed by the actual encoding process of the acquired i-th frame
  • is the motion weighting factor
  • the exemplary value is 0.996.
  • Step S102 Calculate the maximum processing frame rate according to the processing time, and determine the status information of the video frame based on the number of lost frames and the maximum processing frame rate.
  • the status information includes performance overload and excess performance.
  • the processing time is the processing time of each frame of image during the video image encoding process
  • the maximum processing frame rate corresponds to the calculated maximum processing frame rate during the encoding process. Specifically, it can be: calculating the number of image frames processed per unit time according to the processing time to obtain the maximum processing frame rate.
  • the maximum processing frame rate is recorded as fps enc_capacity
  • the calculated processing time of a single frame image is:
  • the maximum processing frame rate is 20 frames per second.
  • the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate obtained previously.
  • the status information includes performance overload and excess performance during the encoding process.
  • performance overload means that the current processing speed of video images cannot meet the speed of the input video images, that is, the image resolution needs to be reduced to ensure smooth playback of the video
  • overperformance means that the current processing speed of video images is higher than the input speed.
  • the speed of the video image can increase the image resolution to improve the clarity of the displayed video image.
  • Figure 2 is a flow chart of a method for determining status information of a video frame provided by an embodiment of the present application, which specifically includes:
  • Step S1021 Determine whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold.
  • the frame loss threshold is a dynamically determined threshold for comparison with the number of frames lost;
  • the standard frame rate threshold is a set value.
  • the standard frame rate threshold can be 11, 15, or 20, etc., and can be flexibly set according to different video application scenarios.
  • the step of calculating the frame loss threshold is also included.
  • the frame loss threshold is calculated based on different image resolutions. Specifically: the frame loss threshold is calculated based on the image resolution corresponding to the current gear and the lowered gear and the maximum processing frame rate, where the image resolution corresponding to the lowered gear is smaller than the image resolution corresponding to the current gear.
  • multiple different image resolution gears are preset. Each image resolution gear corresponds to a fixed image resolution value. If there are six gears, the corresponding Exemplary image resolutions are 240P, 360P, 480P, 540P, 720P and 1080P respectively.
  • the frame drop threshold is exemplarily recorded as Th enc_drop , and the frame drop threshold is calculated as follows:
  • fps enc_capacity is the maximum processing frame rate
  • i the image resolution level, the larger the value of i, the higher the corresponding image resolution.
  • the specific process of determining whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold may be: If the number of lost frames is greater than the calculated frame loss threshold, and the maximum processing frame rate is less than the set standard frame rate threshold, it is determined that the processing of video frames is performance overload.
  • Code coveruse represents performance overload
  • fps enc_capacity is the maximum processing frame rate
  • Th enc_fps is the set standard frame rate threshold
  • frames enc_drop is the number of dropped frames
  • Th enc_drop is the calculated ’s frame loss threshold
  • Step S1022 Determine whether the processing of the video frame has excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold.
  • the maximum processing frame rate is compared with the calculated maximum frame rate threshold.
  • the process of determining the maximum frame rate threshold before comparison includes: calculating the maximum frame rate threshold based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate, where the upper gear The image resolution corresponding to the gear position is greater than the image resolution corresponding to the current gear position.
  • multiple different image resolution gears are preset. Each image resolution gear corresponds to a fixed image resolution value. For example, if there are six gears, the gears are The corresponding image resolutions from low to high are, for example, 240P, 360P, 480P, 540P, 720P and 1080P respectively.
  • the set maximum frame rate is recorded as fps max , and the exemplary value may be 24, where the maximum frame rate threshold is calculated based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate.
  • the process can be:
  • the corresponding conditions for satisfying excess performance include: if the maximum processing frame rate is greater than the calculated maximum frame rate threshold, then the processing of the video frame is determined to be excess performance, and Codec underuse represents excess performance.
  • the corresponding judgment conditions can be expressed as follows:
  • Step S103 If the status information indicates performance overload, adjust the resolution of the video image downward; if the status information indicates excessive performance, adjust the resolution of the video image upward.
  • the status information if the status information is performance overload, then Adjust the resolution of the video image. If the status information indicates excess performance, increase the resolution of the video image. Regarding the encoding processing stage of the video image, if it is determined that the performance is overloaded, the current encoding resolution is lowered, and if it is determined that the performance is excessive, the current encoding resolution is increased.
  • multiple different image resolution gears are set for upward and downward adjustment of the image resolution, where each gear corresponds to a fixed resolution value.
  • each gear corresponds to a fixed resolution value.
  • adjust one gear at a time when adjusting the resolution of the video image, adjust one gear at a time.
  • the corresponding determined status information is a normal status if the determined status information is neither excessive performance nor performance overload.
  • the status information is judged every fixed period T. If the same status information is triggered cumulatively N times in the period T, for example, the judgment of performance overload is triggered 6 times within a period of 10 seconds. If so, adjust the image resolution accordingly. If the above conditions are not met, the resolution will not be adjusted. Specifically, when the video image resolution in the encoding stage is increased, in principle it should not exceed the highest image resolution captured by the camera device. Of course, the downward adjustment process is also limited by the image resolution corresponding to the lowest gear set.
  • the video image resolution especially the resolution of the camera image acquisition is limited by the model, it may only provide image acquisition at certain resolutions, and the pre-processing or encoding process is set as needed.
  • it also includes: cropping the video image collected by the camera device through the image cropping algorithm to obtain different gears video images at lower resolutions. That is, the image is cropped through the image cropping algorithm to obtain multiple images with different resolutions for adjusting the image resolution.
  • the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate.
  • the status information includes performance overload and excess performance. If the status information indicates performance overload, the resolution of the video image is lowered. If the status information indicates excess performance, the resolution of the video image is raised. This is achieved.
  • the adaptive adjustment of video resolution balances and optimizes the balance between clarity and smoothness during video playback, providing users with a high-quality video experience.
  • the processing time of a single frame image is calculated through the moving weighted exponential filtering formula, making the calculation of the processing time more accurate.
  • the processing time of a single frame image The processing time and the calculated maximum processing frame rate are used as the basis for judging the status information.
  • the image resolution can be effectively adjusted based on this.
  • dynamic calculation is used for the frame loss threshold and the maximum frame rate threshold. Obtained, the effect of resolution adaptive adjustment is greatly optimized.
  • Figure 3 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application. It provides a process of video resolution adjustment in the encoding stage, as shown in Figure 3, which specifically includes:
  • Step S201 Obtain the processing time of a single frame image in the video image encoding processing stage, and calculate the processing time of the single frame image according to the processing time and the set motion weighted exponential filter formula.
  • Step S202 Obtain the number of lost frames in the video image encoding processing stage and the processing time of the single frame image, and calculate the number of image frames processed per unit time according to the processing time to obtain the maximum encoding processing frame rate.
  • Step S203 Calculate the frame loss threshold based on the image resolution corresponding to the current gear and the lowered gear and the maximum encoding frame rate, calculate the frame loss threshold based on the number of frames lost, the maximum encoding frame rate and the set standard The frame rate threshold determines whether the encoding process of video frames is a performance overload.
  • Step S204 Calculate the maximum frame rate threshold based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate, and determine whether the video frame is encoded based on the maximum encoding processing frame rate and the calculated maximum frame rate threshold. For excess performance.
  • Step S205 If the number of lost frames is greater than the calculated frame loss threshold and the maximum encoding processing frame rate is less than the set standard frame rate threshold, it is determined that the encoding processing of the video frame is performance overload. If the maximum encoding processing frame rate is greater than the calculated frame rate If the maximum frame rate threshold is reached, it is determined that the encoding process of the video frame has excessive performance.
  • FIG 4 is a flow chart of another video resolution adaptive adjustment method provided by the embodiment of the present application, which provides the process of video resolution adjustment in the previous processing stage, as shown in Figure 4, which specifically includes:
  • Step S301 Obtain the number of dropped frames in the video image pre-processing stage and the processing time of a single frame image.
  • a pre-processing queue is also maintained when pre-processing video images.
  • Each frame of video image collected by the camera is input into the pre-processing queue in turn.
  • each frame of image in the pre-processing queue is processed in sequence. Taking the live broadcast scene as an example, it includes a series of processing processes such as data cleaning, skin color processing, skin resurfacing, noise reduction, and face positioning. If the speed of image pre-processing is lower than the speed of the input image, frame loss will occur.
  • the number of lost frames in the pre-processing stage can be obtained by counting the number of frames input into the pre-processing queue and the number of frames processed in the pre-processing, such as subtracting the number of frames input into the pre-processing queue within a set fixed time.
  • the specific number of frames lost can be obtained by removing the number of frames processed in pre-processing.
  • the processing time of a single frame image in the pre-processing stage of the video image is the determined time-consuming of the single acquisition frame in the entire pre-processing stage.
  • the calculation method can refer to the processing time of a single frame image in the encoding stage, which is also calculated based on the motion weighted exponential filtering formula and will not be described again here.
  • Step S302 Calculate the maximum pre-processing frame rate based on the processing time, and determine the status information of the video frame based on the number of lost frames and the maximum pre-processing frame rate.
  • the calculation method of obtaining the maximum pre-processing frame rate based on the processing time consumption is referred to the calculation method of obtaining the maximum encoding processing frame rate based on the processing time consumption.
  • the status information of the video frame is determined based on the number of dropped frames and the maximum pre-processing frame rate.
  • the process can also refer to the process of determining the status information of the video frame based on the number of dropped frames and the maximum encoding processing frame rate at the same time, that is, the explanation part of step S102, which will not be described again here.
  • Step S303 If the status information indicates performance overload, lower the pre-processing resolution of the video image. If the status information indicates excessive performance, increase the pre-processing resolution of the video image.
  • step S103 For the specific resolution adjustment method, please refer to the explanation part of step S103 and will not be described again here.
  • the processes of adaptive adjustment of image resolution for the pre-processing stage and encoding processing stage are respectively given.
  • the two stages can adjust the image resolution independently, or use linked Adjust the image resolution in the form.
  • the encoding processing stage when the image resolution is lowered to reduce the image resolution in the pre-processing stage, the encoding processing stage also triggers a downward adjustment of the resolution to be consistent with the resolution lowered in the pre-processing; the current processing stage performs an upward adjustment of the image resolution.
  • the encoding processing stage also triggers a resolution increase to be consistent with the resolution increase in pre-processing. It should be noted that the calculation formula of the above encoding processing and the description of the specific resolution adjustment method are also applicable to the pre-processing stage, and will not be described again here.
  • FIG. 5 is a structural block diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application.
  • the device is used to execute the video resolution adaptive adjustment method provided by the above embodiment, and has functional modules and beneficial effects corresponding to the execution method.
  • the device specifically includes: data acquisition module 101, frame rate calculation module 102, status information determination module 103 and resolution adjustment module 104, wherein,
  • the data acquisition module 101 is configured to obtain the number of dropped frames of the video image and the processing time of the single frame image;
  • the frame rate calculation module 102 is configured to calculate the maximum processing frame rate based on the processing time
  • the status information determination module 103 is configured to determine the status information of the video frame based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
  • the resolution adjustment module 104 is configured to lower the resolution of the video image if the status information indicates performance overload, and to increase the resolution of the video image if the status information indicates excessive performance.
  • the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate.
  • the status information includes performance overload and excess performance. If the status information indicates performance overload, the resolution of the video image is lowered. If the status information indicates excess performance, the resolution of the video image is raised. This is achieved.
  • the adaptive adjustment of video resolution balances and optimizes the balance between clarity and smoothness during video playback, providing users with a high-quality video experience.
  • the data acquisition module 101 is configured as:
  • the device also includes a module for processing time-consuming calculations, configured to:
  • the processing time of a single frame image is calculated based on the processing time and the set motion weighted exponential filtering formula.
  • the frame rate calculation module 102 is configured as:
  • the status information determination module 103 is configured as:
  • the status information determination module 103 is further configured to:
  • the frame loss threshold is calculated based on the image resolution and the maximum processing frame rate, where, the The image resolution corresponding to the lowered gear is smaller than the image resolution corresponding to the current gear.
  • the status information determination module 103 is configured as:
  • the status information determination module 103 is further configured to:
  • the maximum frame is calculated based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate. rate threshold, wherein the image resolution corresponding to the upward gear is greater than the image resolution corresponding to the current gear.
  • the status information determination module 103 is configured as:
  • the data acquisition module 101 is configured as:
  • the resolution adjustment module 104 is configured as:
  • the resolution of the video image in the pre-processing stage and/or the encoding process stage is reduced, and the resolution of the video image in the pre-processing stage and/or the encoding process stage is increased.
  • the resolution adjustment module 104 is configured as:
  • the video image collected by the camera device is cropped through an image cropping algorithm to obtain video images with resolutions in different gears.
  • Figure 6 is a schematic structural diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application.
  • the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the processor in the device
  • the number of 201 may be one or more.
  • one processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device may be connected through a bus or other means.
  • the memory 202 can be used to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the video resolution adaptive adjustment method in the embodiment of the present application.
  • the processor 201 executes software programs, instructions and modules stored in the memory 202 to perform various functions of the device. Application and data processing, that is, to implement the above-mentioned video resolution adaptive adjustment method.
  • the input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and functional control of the device.
  • the output device 204 may include a display device such as a display screen.
  • Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor are used to perform a video resolution adaptive adjustment method described in the above embodiments, wherein, include:
  • the maximum processing frame rate is calculated according to the processing time consumption, and the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
  • the resolution of the video image is increased.
  • various aspects of the method provided by this application can also be implemented in the form of a program product, which includes program code.
  • the program product When the program product is run on a computer device, the program code is used to The computer device is caused to execute the steps in the method according to the various exemplary embodiments of the present application described above.
  • the computer device may execute the video resolution adaptive adjustment method described in the embodiment of the present application.
  • the program product may be implemented in any combination of one or more readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Provided in the embodiments of the present application are a video resolution adaptive adjustment method, apparatus and device, and a storage medium. The method comprises: acquiring the number of lost frames of a video image and consumed processing time for a single image frame; calculating a maximum processing frame rate according to the consumed processing time, and on the basis of the number of lost frames and the maximum processing frame rate, determining state information of a video frame, the state information comprising performance overload and performance excess; and if the state information is performance overload, reducing the resolution of the video image, and if the state information is performance excess, increasing the resolution of the video image. The present solution achieves adaptive adjustment of video resolution and weighs and optimizes a balance between the definition and smoothness during playing a video, so that high-quality video experience is provided for a user.

Description

视频分辨率自适应调节方法、装置、设备和存储介质Video resolution adaptive adjustment method, device, equipment and storage medium
本申请要求在2022年03月18日提交中国专利局,申请号为202210272513.2的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application with application number 202210272513.2, which was submitted to the China Patent Office on March 18, 2022. The entire content of this application is incorporated into this application by reference.
技术领域Technical field
本申请实施例涉及视频处理技术领域,尤其涉及一种视频分辨率自适应调节方法、装置、设备和存储介质。Embodiments of the present application relate to the field of video processing technology, and in particular, to a video resolution adaptive adjustment method, device, equipment and storage medium.
背景技术Background technique
随着计算机和网络技术的发展,基于视频图像的各类应用也越来越多。如在实时直播场景中,主播端通过摄像头进行视频图像的采集,对采集的视频图像进行前处理后再渲染并显示在主播端的屏幕中。对于观众端而言,主播端将前处理后的视频图像经过视频编码后分装成协议包的形式,通过后台服务器转发至观众端,观众端经过解码处理后渲染至观众端的屏幕中进行显示。With the development of computer and network technology, there are more and more various applications based on video images. For example, in a real-time live broadcast scenario, the anchor side collects video images through the camera, pre-processes the collected video images, and then renders and displays them on the screen of the anchor side. For the audience side, the anchor side encodes the pre-processed video images and packages them into protocol packets, and forwards them to the audience side through the backend server. The audience side decodes and renders them to the audience side's screen for display.
在进行视频图像的前处理和编码处理过程中,需要经过大量的处理器运算以及I/O操作,而随着用户场景的变化如调整视频特效、美颜处理等,会导致设备进行图像的单帧处理能力产生变化。如增加特效、美颜或随着直播时长的增加设备发热降频,处理器进行图像的单帧处理耗时会增加,由此导致丢帧、卡顿现象。而降低特效、美颜时,处理器进行图像的单帧处理耗时又会下降,丢帧则会得到缓解,视频播放的流畅度得到提升。因此,如何高效的实现视频清晰度和流畅度的平衡,是急需解决的问题。During the pre-processing and encoding of video images, a large number of processor operations and I/O operations are required. As user scenarios change, such as adjusting video special effects, beautification processing, etc., the device will perform single image processing. Frame processing capabilities change. For example, if special effects, beautification, or equipment heats up and frequency decreases as the duration of the live broadcast increases, the processor will take longer to process a single frame of the image, resulting in frame drops and freezes. When the special effects and beautification are reduced, the time taken by the processor to process a single frame of the image will be reduced, frame loss will be alleviated, and the smoothness of video playback will be improved. Therefore, how to effectively achieve the balance between video clarity and smoothness is an urgent problem that needs to be solved.
发明内容Contents of the invention
本申请实施例提供了一种视频分辨率自适应调节方法、装置、设备和存储介质,解决了视频播放时清晰度和流畅度的平衡性差的问题,实现了视频分辨率的自适应调节,为用户提供了高质量的视频体验。Embodiments of the present application provide a video resolution adaptive adjustment method, device, equipment and storage medium, which solves the problem of poor balance between clarity and fluency during video playback, realizes adaptive adjustment of video resolution, and provides Users are provided with a high-quality video experience.
第一方面,本申请实施例提供了一种视频分辨率自适应调节方法,该方法包括: In a first aspect, embodiments of the present application provide a video resolution adaptive adjustment method, which method includes:
获取视频图像的丢帧数以及单帧图像的处理耗时;Obtain the number of dropped frames of video images and the processing time of single frame images;
根据所述处理耗时计算得到最大处理帧率,基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩;The maximum processing frame rate is calculated according to the processing time consumption, and the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
如果所述状态信息为性能过载,则下调所述视频图像的分辨率;If the status information indicates performance overload, then lower the resolution of the video image;
如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。If the status information indicates excess performance, the resolution of the video image is increased.
第二方面,本申请实施例还提供了一种视频分辨率自适应调节装置,包括:In a second aspect, embodiments of the present application also provide a video resolution adaptive adjustment device, including:
数据获取模块,配置为获取视频图像的丢帧数以及单帧图像的处理耗时;The data acquisition module is configured to obtain the number of dropped frames of the video image and the processing time of a single frame image;
帧率计算模块,配置为根据所述处理耗时计算得到最大处理帧率;A frame rate calculation module configured to calculate the maximum processing frame rate based on the processing time;
状态信息确定模块,配置为基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩;A status information determination module configured to determine status information of the video frame based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
分辨率调节模块,配置为如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。A resolution adjustment module configured to lower the resolution of the video image if the status information indicates performance overload, and to increase the resolution of the video image if the status information indicates excess performance.
第三方面,本申请实施例还提供了一种视频分辨率自适应调节设备,该设备包括:In a third aspect, embodiments of the present application also provide a video resolution adaptive adjustment device, which includes:
一个或多个处理器;one or more processors;
存储装置,用于存储一个或多个程序,a storage device for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本申请实施例所述的视频分辨率自适应调节方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the video resolution adaptive adjustment method described in the embodiments of this application.
第四方面,本申请实施例还提供了一种存储计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行本申请实施例所述的视频分辨率自适应调节方法。In a fourth aspect, embodiments of the present application also provide a storage medium that stores computer-executable instructions, which when executed by a computer processor are used to perform the video resolution adaptation described in the embodiments of the present application. Adjustment method.
第五方面,本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行本申请实施例所述的视频分辨率自适应调节方法。In a fifth aspect, embodiments of the present application also provide a computer program product. The computer program product includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor of the device reads the computer program from the computer-readable storage medium. Obtain and execute the computer program, causing the device to execute the video resolution adaptive adjustment method described in the embodiments of this application.
本申请实施例中,通过获取视频图像的丢帧数以及单帧图像的处理耗时,根据处理耗时计算得到最大处理帧率后,基于丢帧数和最大处理帧率确定视频帧的状态信息,该状态信息包括性能过载和性能过剩,如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上 调所述视频图像的分辨率,实现了视频分辨率的自适应调节,对视频播放时清晰度和流畅度的平衡性进行了权衡优化,为用户提供了高质量的视频体验。In the embodiment of the present application, the number of dropped frames of the video image and the processing time of a single frame image are obtained. After calculating the maximum processing frame rate based on the processing time, the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate. , the status information includes performance overload and excess performance. If the status information is performance overload, the resolution of the video image is adjusted downward. If the status information is excess performance, the resolution is adjusted upward. Adjusting the resolution of the video image achieves adaptive adjustment of the video resolution, weighs and optimizes the balance between clarity and smoothness during video playback, and provides users with a high-quality video experience.
附图说明Description of the drawings
图1为本申请实施例提供的一种视频分辨率自适应调节方法的流程图;Figure 1 is a flow chart of a video resolution adaptive adjustment method provided by an embodiment of the present application;
图2为本申请实施例提供的一种确定视频帧的状态信息的方法的流程图;Figure 2 is a flow chart of a method for determining status information of a video frame provided by an embodiment of the present application;
图3为本申请实施例提供的另一种视频分辨率自适应调节方法的流程图;Figure 3 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application;
图4为本申请实施例提供的另一种视频分辨率自适应调节方法的流程图;Figure 4 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application;
图5为本申请实施例提供的一种视频分辨率自适应调节装置的结构框图;Figure 5 is a structural block diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application;
图6为本申请实施例提供的一种视频分辨率自适应调节设备的结构示意图。Figure 6 is a schematic structural diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请实施例作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请实施例,而非对本申请实施例的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请实施例相关的部分而非全部结构。The embodiments of the present application will be further described in detail below with reference to the accompanying drawings and examples. It can be understood that the specific embodiments described here are only used to explain the embodiments of the present application, but are not intended to limit the embodiments of the present application. In addition, it should be noted that, for convenience of description, only some but not all structures related to the embodiments of the present application are shown in the drawings.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
图1为本申请实施例提供的一种视频分辨率自适应调节方法的流程图,可用于对视频图像的分辨率进行自适应性的调整,该方法可以由计算设备如服务器、智能终端、笔记本、平板电脑等来执行,具体包括如下步骤:Figure 1 is a flow chart of a video resolution adaptive adjustment method provided by an embodiment of the present application, which can be used to adaptively adjust the resolution of video images. This method can be performed by computing devices such as servers, smart terminals, and laptops. , tablet computers, etc. to execute, including the following steps:
步骤S101、获取视频图像的丢帧数以及单帧图像的处理耗时。Step S101: Obtain the number of dropped frames of the video image and the processing time of a single frame image.
在一个实施例中,该丢帧数为视频图像在进行编码处理过程中的丢帧数。具体的,在对视频图像的每帧图像进行编码处理的过程中,视频图像在经过前 处理后被送入编码队列待编码器进行压缩编码,其中该前处理过程包括对摄像机采集的每一帧图像进行数据清洗、肤色处理、磨皮、降噪和人脸定位等一系列处理过程。通常编码队列的大小为固定长度,也即对每一帧视频图像进行编码的速度小于输入至编码队列的图像的速度时,多余的图像帧会溢出导致丢帧、卡顿现象的发生。In one embodiment, the number of lost frames is the number of lost frames during the encoding process of the video image. Specifically, in the process of encoding each frame of the video image, the video image passes through After processing, it is sent to the encoding queue to be compressed and encoded by the encoder. The pre-processing process includes a series of processing processes such as data cleaning, skin color processing, skin grinding, noise reduction and face positioning for each frame of image collected by the camera. Usually the size of the encoding queue is a fixed length, that is, when the speed of encoding each frame of video image is less than the speed of the image input to the encoding queue, the excess image frames will overflow, causing frame loss and freezing.
在一个实施例中,该丢帧数可通过统计输入编码队列的帧数以及编码处理帧数得出,如针对设置的固定时间中输入编码队列的帧数减去编码处理帧数可得出具体的丢帧数。In one embodiment, the number of lost frames can be obtained by counting the number of frames input to the encoding queue and the number of encoding processing frames. For example, the number of frames input to the encoding queue within a set fixed time minus the number of encoding processing frames can be obtained. The number of dropped frames.
在一个实施例中,该单帧图像的处理耗时可以是视频图像在进行编码处理过程中的每帧图像的处理耗时。其通过获取的单帧图像的处理时间进行计算得到。可选的,计算过程包括:获取单帧图像的处理时间,根据处理时间以及设置的移动加权指数滤波公式计算得到单帧图像的处理耗时。具体的,计算公式如下:In one embodiment, the processing time of the single frame image may be the processing time of each frame of the video image during the encoding process. It is calculated by the processing time of the acquired single frame image. Optionally, the calculation process includes: obtaining the processing time of a single frame image, and calculating the processing time of the single frame image based on the processing time and the set motion weighted exponential filtering formula. Specifically, the calculation formula is as follows:
其中,ti为获取的第i帧实际编码过程消耗的处理时间,为上一次估算得到的单帧图像的处理耗时,为计算得到的单帧图像的处理耗时,α为移动加权因子,示例性的取值为0.996。通过该种方式计算得出的单帧图像的处理耗时估算更加准确,其满足快上升,慢下降的特性,避免了由于抖动导致的处理耗时的计算结果不准确的问题。Among them, t i is the processing time consumed by the actual encoding process of the acquired i-th frame, is the processing time of a single frame image estimated last time, It is the calculated processing time of a single frame image, α is the motion weighting factor, and the exemplary value is 0.996. The estimation of the processing time of a single frame image calculated in this way is more accurate, which satisfies the characteristics of fast rise and slow decline, and avoids the problem of inaccurate calculation results of processing time due to jitter.
步骤S102、根据所述处理耗时计算得到最大处理帧率,基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩。Step S102: Calculate the maximum processing frame rate according to the processing time, and determine the status information of the video frame based on the number of lost frames and the maximum processing frame rate. The status information includes performance overload and excess performance.
在一个实施例中,处理耗时为视频图像编码处理过程中每帧图像的处理耗时,该最大处理帧率为对应计算得到的编码处理过程中的最大处理帧率。具体的,可以是:根据处理耗时计算单位时间处理的图像帧数以得到最大处理帧率。示例性的,该最大处理帧率记为fpsenc_capacity为计算得到的单帧图像的处理耗时,则:In one embodiment, the processing time is the processing time of each frame of image during the video image encoding process, and the maximum processing frame rate corresponds to the calculated maximum processing frame rate during the encoding process. Specifically, it can be: calculating the number of image frames processed per unit time according to the processing time to obtain the maximum processing frame rate. For example, the maximum processing frame rate is recorded as fps enc_capacity , The calculated processing time of a single frame image is:
即最大处理帧率为每秒钟20帧。 That is, the maximum processing frame rate is 20 frames per second.
在一个实施例中,根据前述得到的丢帧数和最大处理帧率确定视频帧的状态信息,该状态信息包括编码处理过程中的性能过载和性能过剩。其中,性能过载指当前的对视频图像的处理速度无法满足输入的视频图像的速度,即需要降低图像分辨率以保证视频的流畅播放,而性能过剩指当前对视频图像的处理速度高于输入的视频图像的速度,可以提升图像分辨率以提高显示的视频图像的清晰度。In one embodiment, the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate obtained previously. The status information includes performance overload and excess performance during the encoding process. Among them, performance overload means that the current processing speed of video images cannot meet the speed of the input video images, that is, the image resolution needs to be reduced to ensure smooth playback of the video, while overperformance means that the current processing speed of video images is higher than the input speed. The speed of the video image can increase the image resolution to improve the clarity of the displayed video image.
在一个实施例中,如图2所示,图2为本申请实施例提供的一种确定视频帧的状态信息的方法的流程图,具体包括:In one embodiment, as shown in Figure 2, Figure 2 is a flow chart of a method for determining status information of a video frame provided by an embodiment of the present application, which specifically includes:
步骤S1021、根据丢帧数和计算得到的丢帧阈值,以及最大处理帧率和设置的标准帧率阈值确定视频帧的处理是否为性能过载。Step S1021: Determine whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold.
在一个实施例中,该丢帧阈值为动态确定的用于和丢帧数进行比对的阈值;该标准帧率阈值为设置的数值。示例性的,该标准帧率阈值可以是11、15或20等,可根据不同的视频应用场景进行灵活的设置。In one embodiment, the frame loss threshold is a dynamically determined threshold for comparison with the number of frames lost; the standard frame rate threshold is a set value. For example, the standard frame rate threshold can be 11, 15, or 20, etc., and can be flexibly set according to different video application scenarios.
在一个实施例中,还包括计算该丢帧阈值的步骤,可选的,该丢帧阈值基于不同图像分辨率情况计算得到。具体为:根据当前挡位和下调挡位对应的图像分辨率以及最大处理帧率计算得到丢帧阈值,其中,下调挡位对应的图像分辨率小于当前挡位对应的图像分辨率。可选的,在进行图像分辨率调整时,预先设置有多个不同的图像分辨率挡位,每个图像分辨率挡位对应固定的图像分辨率数值,如设置有六个挡位,对应的图像分辨率示例性的分别为240P、360P、480P、540P、720P和1080P。该丢帧阈值示例性的记为Thenc_drop,该丢帧阈值的计算方式如下:
In one embodiment, the step of calculating the frame loss threshold is also included. Optionally, the frame loss threshold is calculated based on different image resolutions. Specifically: the frame loss threshold is calculated based on the image resolution corresponding to the current gear and the lowered gear and the maximum processing frame rate, where the image resolution corresponding to the lowered gear is smaller than the image resolution corresponding to the current gear. Optionally, when adjusting the image resolution, multiple different image resolution gears are preset. Each image resolution gear corresponds to a fixed image resolution value. If there are six gears, the corresponding Exemplary image resolutions are 240P, 360P, 480P, 540P, 720P and 1080P respectively. The frame drop threshold is exemplarily recorded as Th enc_drop , and the frame drop threshold is calculated as follows:
其中,fpsenc_capacity为最大处理帧率,i表示图像分辨率档位,i的取值越大,对应的图像分辨率越高。其中,pixeli表示在i挡位对应的图像分辨率下的像素点数,其中,pixeli=wi*hi,wi和hi分别为图像的宽和高。Among them, fps enc_capacity is the maximum processing frame rate, i represents the image resolution level, the larger the value of i, the higher the corresponding image resolution. Among them, pixel i represents the number of pixels under the image resolution corresponding to the i gear, where pixel i = wi * hi , w i and h i are the width and height of the image respectively.
在一个实施例中,具体的根据丢帧数和计算得到的丢帧阈值,以及最大处理帧率和设置的标准帧率阈值确定视频帧的处理是否为性能过载的过程可以是:如果丢帧数大于计算得到的丢帧阈值,且最大处理帧率小于设置的标准帧 率阈值,则确定视频帧的处理为性能过载,以Codecoveruse表示性能过载,fpsenc_capacity为最大处理帧率,Thenc_fps为设置的标准帧率阈值,framesenc_drop为丢帧数,Thenc_drop为计算得到的丢帧阈值,则具体的判断条件可表示为:
In one embodiment, the specific process of determining whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold may be: If the number of lost frames is greater than the calculated frame loss threshold, and the maximum processing frame rate is less than the set standard frame rate threshold, it is determined that the processing of video frames is performance overload. Code coveruse represents performance overload, fps enc_capacity is the maximum processing frame rate, Th enc_fps is the set standard frame rate threshold, frames enc_drop is the number of dropped frames, and Th enc_drop is the calculated ’s frame loss threshold, the specific judgment conditions can be expressed as:
步骤S1022、根据最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩。Step S1022: Determine whether the processing of the video frame has excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold.
在一个实施例中,在进行性能过剩的判断时,将最大处理帧率和计算得到的最大帧率阈值进行比对。具体的,在进行比对前还包括确定最大帧率阈值的过程,包括:根据当前挡位和上调挡位对应的图像分辨率以及设置的最大帧率计算得到最大帧率阈值,其中,上调挡位对应的图像分辨率大于当前挡位对应的图像分辨率。可选的,在进行图像分辨率调整时,预先设置有多个不同的图像分辨率挡位,每个图像分辨率挡位对应固定的图像分辨率数值,如设置有六个挡位,挡位由低到高依次对应的图像分辨率示例性的分别为240P、360P、480P、540P、720P和1080P。示例性的,设置的最大帧率记为fpsmax,示例性的数值可以是24,其中,根据当前挡位和上调挡位对应的图像分辨率以及设置的最大帧率计算得到最大帧率阈值的过程可以是:
In one embodiment, when determining excess performance, the maximum processing frame rate is compared with the calculated maximum frame rate threshold. Specifically, the process of determining the maximum frame rate threshold before comparison includes: calculating the maximum frame rate threshold based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate, where the upper gear The image resolution corresponding to the gear position is greater than the image resolution corresponding to the current gear position. Optionally, when adjusting the image resolution, multiple different image resolution gears are preset. Each image resolution gear corresponds to a fixed image resolution value. For example, if there are six gears, the gears are The corresponding image resolutions from low to high are, for example, 240P, 360P, 480P, 540P, 720P and 1080P respectively. For example, the set maximum frame rate is recorded as fps max , and the exemplary value may be 24, where the maximum frame rate threshold is calculated based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate. The process can be:
其中,pixeli表示在第i挡位对应的图像分辨率下的像素点数,其中,pixeli=wi*hi,wi和hi分别为图像的宽和高。相应的满足性能过剩的条件包括:如果最大处理帧率大于计算得到的最大帧率阈值,则确定视频帧的处理为性能过剩,以Codecunderuse表示性能过剩,则相应的判断条件可表示如下:
Among them, pixel i represents the number of pixels at the image resolution corresponding to the i-th gear, where pixel i = wi * hi , w i and h i are the width and height of the image respectively. The corresponding conditions for satisfying excess performance include: if the maximum processing frame rate is greater than the calculated maximum frame rate threshold, then the processing of the video frame is determined to be excess performance, and Codec underuse represents excess performance. The corresponding judgment conditions can be expressed as follows:
步骤S103、如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。Step S103: If the status information indicates performance overload, adjust the resolution of the video image downward; if the status information indicates excessive performance, adjust the resolution of the video image upward.
在一个实施例中,在确定状态信息后,如果该状态信息为性能过载,则下 调视频图像的分辨率,如果状态信息为性能过剩,则上调视频图像的分辨率。针对视频图像的编码处理阶段而言,如果确定出性能过载则对当前的编码分辨率进行下调,如果确定出性能过剩则对当前的编码分辨率进行上调。In one embodiment, after determining the status information, if the status information is performance overload, then Adjust the resolution of the video image. If the status information indicates excess performance, increase the resolution of the video image. Regarding the encoding processing stage of the video image, if it is determined that the performance is overloaded, the current encoding resolution is lowered, and if it is determined that the performance is excessive, the current encoding resolution is increased.
在一个实施例中,通过设置多个不同的图像分辨率的挡位以用于图像分辨率的上调和下调,其中,每个挡位对应固定的分辨率数值。可选的,在进行视频图像的分辨率的调整时,每次进行一个挡位的调节。In one embodiment, multiple different image resolution gears are set for upward and downward adjustment of the image resolution, where each gear corresponds to a fixed resolution value. Optionally, when adjusting the resolution of the video image, adjust one gear at a time.
在一个实施例中,如果确定出的状态信息既不为性能过剩也不为性能过载,则相应的确定状态信息为正常状态。In one embodiment, if the determined status information is neither excessive performance nor performance overload, the corresponding determined status information is a normal status.
可选的,通过对状态信息的收集每隔固定周期T进行依次状态信息的判断,如果在该周期T内累计N次触发同一状态信息,如在周期10秒内触发了6次性能过载的判断情况,则进行相应的图像分辨率的调整。如果不满足上述条件,则不进行分辨率的调整。具体的,在进行编码阶段的视频图像分辨率的上调时,原则上不超过摄像装置采集的最高的图像分辨率。当然下调过程也受到设置的最低挡位对应的图像分辨率的限制。Optionally, by collecting status information, the status information is judged every fixed period T. If the same status information is triggered cumulatively N times in the period T, for example, the judgment of performance overload is triggered 6 times within a period of 10 seconds. If so, adjust the image resolution accordingly. If the above conditions are not met, the resolution will not be adjusted. Specifically, when the video image resolution in the encoding stage is increased, in principle it should not exceed the highest image resolution captured by the camera device. Of course, the downward adjustment process is also limited by the image resolution corresponding to the lowest gear set.
在一个实施例中,在进行视频图像分辨率的调整之前,尤其是相机采集图像的分辨率受机型限制可能只提供特定几个分辨率的图像采集,而前处理或编码处理根据需要设置成固定宽高的几个分辨率类型时,在获取视频图像的丢帧数以及单帧图像的处理耗时之前,还包括:通过图像裁剪算法对摄像装置采集的视频图像进行裁剪,得到不同挡位下的分辨率的视频图像。即通过图像裁剪算法对图像进行裁剪得到多个不同挡位分辨率的图像以用于图像分辨率的调节。In one embodiment, before adjusting the video image resolution, especially the resolution of the camera image acquisition is limited by the model, it may only provide image acquisition at certain resolutions, and the pre-processing or encoding process is set as needed. When fixing several resolution types of width and height, before obtaining the number of dropped frames of the video image and the processing time of a single frame image, it also includes: cropping the video image collected by the camera device through the image cropping algorithm to obtain different gears video images at lower resolutions. That is, the image is cropped through the image cropping algorithm to obtain multiple images with different resolutions for adjusting the image resolution.
由上述方案可知,通过获取视频图像的丢帧数以及单帧图像的处理耗时,根据处理耗时计算得到最大处理帧率后,基于丢帧数和最大处理帧率确定视频帧的状态信息,该状态信息包括性能过载和性能过剩,如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率,实现了视频分辨率的自适应调节,对视频播放时清晰度和流畅度的平衡性进行了权衡优化,为用户提供了高质量的视频体验。It can be seen from the above solution that by obtaining the number of dropped frames of the video image and the processing time of a single frame image, and calculating the maximum processing frame rate based on the processing time, the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate. The status information includes performance overload and excess performance. If the status information indicates performance overload, the resolution of the video image is lowered. If the status information indicates excess performance, the resolution of the video image is raised. This is achieved The adaptive adjustment of video resolution balances and optimizes the balance between clarity and smoothness during video playback, providing users with a high-quality video experience.
在具体的实施过程中,通过移动加权指数滤波公式进行计算得到单帧图像的处理耗时,使得处理耗时的计算更加精确,通过利用丢帧数、单帧图像的处 理耗时以及计算得到的最大处理帧率作为状态信息的判断依据,可基于此有效的进行图像分辨率的调节,在具体调节过程中,针对丢帧阈值和最大帧率阈值采用动态计算的方式得到,极大的优化了分辨率自适应调整的效果。In the specific implementation process, the processing time of a single frame image is calculated through the moving weighted exponential filtering formula, making the calculation of the processing time more accurate. By using the number of dropped frames, the processing time of a single frame image The processing time and the calculated maximum processing frame rate are used as the basis for judging the status information. The image resolution can be effectively adjusted based on this. During the specific adjustment process, dynamic calculation is used for the frame loss threshold and the maximum frame rate threshold. Obtained, the effect of resolution adaptive adjustment is greatly optimized.
图3为本申请实施例提供的另一种视频分辨率自适应调节方法的流程图,给出了以编码阶段进行视频分辨率调节的过程,如图3所示,具体包括:Figure 3 is a flow chart of another video resolution adaptive adjustment method provided by an embodiment of the present application. It provides a process of video resolution adjustment in the encoding stage, as shown in Figure 3, which specifically includes:
步骤S201、获取视频图像编码处理阶段的单帧图像的处理时间,根据所述处理时间以及设置的移动加权指数滤波公式计算得到单帧图像的处理耗时。Step S201: Obtain the processing time of a single frame image in the video image encoding processing stage, and calculate the processing time of the single frame image according to the processing time and the set motion weighted exponential filter formula.
步骤S202、获取视频图像编码处理阶段的丢帧数以及所述单帧图像的处理耗时,根据处理耗时计算单位时间处理的图像帧数以得到最大编码处理帧率。Step S202: Obtain the number of lost frames in the video image encoding processing stage and the processing time of the single frame image, and calculate the number of image frames processed per unit time according to the processing time to obtain the maximum encoding processing frame rate.
步骤S203、根据当前挡位和下调挡位对应的图像分辨率以及最大编码处理帧率计算得到丢帧阈值,根据丢帧数和计算得到的丢帧阈值,以及最大编码处理帧率和设置的标准帧率阈值确定视频帧的编码处理是否为性能过载。Step S203: Calculate the frame loss threshold based on the image resolution corresponding to the current gear and the lowered gear and the maximum encoding frame rate, calculate the frame loss threshold based on the number of frames lost, the maximum encoding frame rate and the set standard The frame rate threshold determines whether the encoding process of video frames is a performance overload.
步骤S204、根据当前挡位和上调挡位对应的图像分辨率以及设置的最大帧率计算得到最大帧率阈值,根据最大编码处理帧率和计算得到的最大帧率阈值确定视频帧的编码处理是否为性能过剩。Step S204: Calculate the maximum frame rate threshold based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate, and determine whether the video frame is encoded based on the maximum encoding processing frame rate and the calculated maximum frame rate threshold. For excess performance.
步骤S205、如果丢帧数大于计算得到的丢帧阈值,且最大编码处理帧率小于设置的标准帧率阈值,则确定视频帧的编码处理为性能过载,如果最大编码处理帧率大于计算得到的最大帧率阈值,则确定视频帧的编码处理为性能过剩。Step S205: If the number of lost frames is greater than the calculated frame loss threshold and the maximum encoding processing frame rate is less than the set standard frame rate threshold, it is determined that the encoding processing of the video frame is performance overload. If the maximum encoding processing frame rate is greater than the calculated frame rate If the maximum frame rate threshold is reached, it is determined that the encoding process of the video frame has excessive performance.
图4为本申请实施例提供的另一种视频分辨率自适应调节方法的流程图,给出了以前处理阶段进行视频分辨率调节的过程,如图4所示,具体包括:Figure 4 is a flow chart of another video resolution adaptive adjustment method provided by the embodiment of the present application, which provides the process of video resolution adjustment in the previous processing stage, as shown in Figure 4, which specifically includes:
步骤S301、获取视频图像前处理阶段的丢帧数以及单帧图像的处理耗时。Step S301: Obtain the number of dropped frames in the video image pre-processing stage and the processing time of a single frame image.
在一个实施例中,视频图像进行前处理时同样维护有前处理队列,相机采集的每帧视频图像依次输入至前处理队列中,前处理时依次对前处理队列中的每帧图像进行处理。以直播场景为例,包括数据清洗、肤色处理、磨皮、降噪和人脸定位等一系列处理过程,如果图像的前处理的速度低于输入的图像的速度则会造成丢帧。In one embodiment, a pre-processing queue is also maintained when pre-processing video images. Each frame of video image collected by the camera is input into the pre-processing queue in turn. During pre-processing, each frame of image in the pre-processing queue is processed in sequence. Taking the live broadcast scene as an example, it includes a series of processing processes such as data cleaning, skin color processing, skin resurfacing, noise reduction, and face positioning. If the speed of image pre-processing is lower than the speed of the input image, frame loss will occur.
在一个实施例中,该前处理阶段的丢帧数可通过统计输入前处理队列的帧数以及前处理中处理的帧数得出,如针对设置的固定时间中输入前处理队列的帧数减去前处理中处理的帧数可得出具体的丢帧数。 In one embodiment, the number of lost frames in the pre-processing stage can be obtained by counting the number of frames input into the pre-processing queue and the number of frames processed in the pre-processing, such as subtracting the number of frames input into the pre-processing queue within a set fixed time. The specific number of frames lost can be obtained by removing the number of frames processed in pre-processing.
在一个实施例中,在视频图像的前处理阶段单帧图像的处理耗时为确定出的单个采集帧在整个前处理阶段的耗时。其计算方式可参考编码阶段的单帧图像的处理耗时,同样采用基于移动加权指数滤波公式计算得到,此处不再赘述。In one embodiment, the processing time of a single frame image in the pre-processing stage of the video image is the determined time-consuming of the single acquisition frame in the entire pre-processing stage. The calculation method can refer to the processing time of a single frame image in the encoding stage, which is also calculated based on the motion weighted exponential filtering formula and will not be described again here.
步骤S302、根据处理耗时计算得到最大前处理帧率,基于丢帧数和最大前处理帧率确定视频帧的状态信息。Step S302: Calculate the maximum pre-processing frame rate based on the processing time, and determine the status information of the video frame based on the number of lost frames and the maximum pre-processing frame rate.
其中,根据处理耗时计算得到最大前处理帧率的计算方式,参考根据处理耗时计算得到最大编码处理帧率的计算方式,同时基于丢帧数和最大前处理帧率确定视频帧的状态信息的过程同样可参考同时基于丢帧数和最大编码处理帧率确定视频帧的状态信息的过程,即步骤S102的解释部分,此处不再赘述。Among them, the calculation method of obtaining the maximum pre-processing frame rate based on the processing time consumption is referred to the calculation method of obtaining the maximum encoding processing frame rate based on the processing time consumption. At the same time, the status information of the video frame is determined based on the number of dropped frames and the maximum pre-processing frame rate. The process can also refer to the process of determining the status information of the video frame based on the number of dropped frames and the maximum encoding processing frame rate at the same time, that is, the explanation part of step S102, which will not be described again here.
步骤S303、如果状态信息为性能过载,则下调视频图像的前处理分辨率,如果所述状态信息为性能过剩,则上调视频图像的前处理分辨率。Step S303: If the status information indicates performance overload, lower the pre-processing resolution of the video image. If the status information indicates excessive performance, increase the pre-processing resolution of the video image.
具体分辨率的调整方式可参考步骤S103的解释部分,此处不再赘述。For the specific resolution adjustment method, please refer to the explanation part of step S103 and will not be described again here.
在上述技术方案的基础上,分别给出了针对前处理阶段和编码处理阶段对图像分辨率进行自适应调整的过程,该两个阶段可分别单独的进行图像分辨率的调整,或者采用联动的形式进行图像分辨率的调整。可选的,在前处理阶段进行图像分辨率的下调以降低图像分辨率时,编码处理阶段同样触发一次分辨率的下调以和前处理下调的分辨率一致;当前处理阶段进行图像分辨率的上调以提高图像分辨率时,编码处理阶段同样触发一次分辨率的上调以和前处理上调的分辨率一致。需要说明的是,上述编码处理的计算公式和具体分辨率调整方式的说明同样适用于前处理阶段,此处不再赘述。On the basis of the above technical solutions, the processes of adaptive adjustment of image resolution for the pre-processing stage and encoding processing stage are respectively given. The two stages can adjust the image resolution independently, or use linked Adjust the image resolution in the form. Optionally, when the image resolution is lowered to reduce the image resolution in the pre-processing stage, the encoding processing stage also triggers a downward adjustment of the resolution to be consistent with the resolution lowered in the pre-processing; the current processing stage performs an upward adjustment of the image resolution. When increasing the image resolution, the encoding processing stage also triggers a resolution increase to be consistent with the resolution increase in pre-processing. It should be noted that the calculation formula of the above encoding processing and the description of the specific resolution adjustment method are also applicable to the pre-processing stage, and will not be described again here.
由上述方案可知,通过对视频图像的前处理阶段和编码处理阶段的图像分辨率进行自适应性的调整,实现了视频分辨率的自适应调节,对视频播放时清晰度和流畅度的平衡性进行了权衡优化,为用户提供了高质量的视频体验。It can be seen from the above solution that by adaptively adjusting the image resolution in the pre-processing stage and encoding processing stage of the video image, the adaptive adjustment of the video resolution is achieved, and the balance of clarity and smoothness during video playback is achieved. Trade-off optimizations have been made to provide users with a high-quality video experience.
图5为本申请实施例提供的一种视频分辨率自适应调节装置的结构框图,该装置用于执行上述实施例提供的视频分辨率自适应调节方法,具备执行方法相应的功能模块和有益效果。如图5所示,该装置具体包括:数据获取模块101、帧率计算模块102、状态信息确定模块103和分辨率调节模块104,其中,Figure 5 is a structural block diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application. The device is used to execute the video resolution adaptive adjustment method provided by the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. . As shown in Figure 5, the device specifically includes: data acquisition module 101, frame rate calculation module 102, status information determination module 103 and resolution adjustment module 104, wherein,
数据获取模块101,配置为获取视频图像的丢帧数以及单帧图像的处理耗时; The data acquisition module 101 is configured to obtain the number of dropped frames of the video image and the processing time of the single frame image;
帧率计算模块102,配置为根据所述处理耗时计算得到最大处理帧率;The frame rate calculation module 102 is configured to calculate the maximum processing frame rate based on the processing time;
状态信息确定模块103,配置为基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩;The status information determination module 103 is configured to determine the status information of the video frame based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
分辨率调节模块104,配置为如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。The resolution adjustment module 104 is configured to lower the resolution of the video image if the status information indicates performance overload, and to increase the resolution of the video image if the status information indicates excessive performance.
由上述方案可知,通过获取视频图像的丢帧数以及单帧图像的处理耗时,根据处理耗时计算得到最大处理帧率后,基于丢帧数和最大处理帧率确定视频帧的状态信息,该状态信息包括性能过载和性能过剩,如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率,实现了视频分辨率的自适应调节,对视频播放时清晰度和流畅度的平衡性进行了权衡优化,为用户提供了高质量的视频体验。It can be seen from the above solution that by obtaining the number of dropped frames of the video image and the processing time of a single frame image, and calculating the maximum processing frame rate based on the processing time, the status information of the video frame is determined based on the number of dropped frames and the maximum processing frame rate. The status information includes performance overload and excess performance. If the status information indicates performance overload, the resolution of the video image is lowered. If the status information indicates excess performance, the resolution of the video image is raised. This is achieved The adaptive adjustment of video resolution balances and optimizes the balance between clarity and smoothness during video playback, providing users with a high-quality video experience.
在一个可能的实施例中,所述数据获取模块101,配置为:In a possible embodiment, the data acquisition module 101 is configured as:
在获取视频图像的丢帧数以及单帧图像的处理耗时之前,获取单帧图像的处理时间;Before obtaining the number of dropped frames of the video image and the processing time of a single frame image, obtain the processing time of a single frame image;
该装置还包括处理耗时计算模块,配置为:The device also includes a module for processing time-consuming calculations, configured to:
根据所述处理时间以及设置的移动加权指数滤波公式计算得到单帧图像的处理耗时。The processing time of a single frame image is calculated based on the processing time and the set motion weighted exponential filtering formula.
在一个可能的实施例中,所述帧率计算模块102配置为:In a possible embodiment, the frame rate calculation module 102 is configured as:
根据所述处理耗时计算单位时间处理的图像帧数以得到最大处理帧率。Calculate the number of image frames processed per unit time based on the processing time to obtain the maximum processing frame rate.
在一个可能的实施例中,所述状态信息确定模块103配置为:In a possible embodiment, the status information determination module 103 is configured as:
根据所述丢帧数和计算得到的丢帧阈值,以及所述最大处理帧率和设置的标准帧率阈值确定视频帧的处理是否为性能过载;Determine whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold;
根据所述最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩。Determine whether the processing of the video frame has excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold.
在一个可能的实施例中,所述状态信息确定模块103还配置为:In a possible embodiment, the status information determination module 103 is further configured to:
在根据所述丢帧数和设置的丢帧阈值,以及所述最大处理帧率和计算得到的标准帧率阈值确定视频帧的处理是否为性能过载之前,根据当前挡位和下调挡位对应的图像分辨率以及所述最大处理帧率计算得到丢帧阈值,其中,所述 下调挡位对应的图像分辨率小于所述当前挡位对应的图像分辨率。Before determining whether the processing of video frames is performance overload based on the number of lost frames and the set frame loss threshold, as well as the maximum processing frame rate and the calculated standard frame rate threshold, based on the current gear and the lowered gear corresponding to The frame loss threshold is calculated based on the image resolution and the maximum processing frame rate, where, the The image resolution corresponding to the lowered gear is smaller than the image resolution corresponding to the current gear.
在一个可能的实施例中,所述状态信息确定模块103配置为:In a possible embodiment, the status information determination module 103 is configured as:
如果所述丢帧数大于计算得到的丢帧阈值,且所述最大处理帧率小于设置的标准帧率阈值,则确定视频帧的处理为性能过载。If the number of lost frames is greater than the calculated frame loss threshold and the maximum processing frame rate is less than the set standard frame rate threshold, it is determined that the processing of the video frame is performance overloaded.
在一个可能的实施例中,所述状态信息确定模块103还配置为:In a possible embodiment, the status information determination module 103 is further configured to:
在根据所述最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩之前,根据当前挡位和上调挡位对应的图像分辨率以及设置的最大帧率计算得到最大帧率阈值,其中,所述上调挡位对应的图像分辨率大于所述当前挡位对应的图像分辨率。Before determining whether the processing of video frames is excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold, the maximum frame is calculated based on the image resolution corresponding to the current gear and the upward gear and the set maximum frame rate. rate threshold, wherein the image resolution corresponding to the upward gear is greater than the image resolution corresponding to the current gear.
在一个可能的实施例中,所述状态信息确定模块103配置为:In a possible embodiment, the status information determination module 103 is configured as:
如果所述最大处理帧率大于计算得到的最大帧率阈值,则确定视频帧的处理为性能过剩。If the maximum processing frame rate is greater than the calculated maximum frame rate threshold, it is determined that the processing of the video frame has excessive performance.
在一个可能的实施例中,所述数据获取模块101配置为:In a possible embodiment, the data acquisition module 101 is configured as:
获取视频图像的前处理阶段和/或编码处理阶段的丢帧数以及单帧图像的处理耗时;Obtain the number of lost frames in the pre-processing stage and/or encoding processing stage of the video image and the processing time of a single frame image;
所述分辨率调节模块104配置为:The resolution adjustment module 104 is configured as:
下调前处理阶段和/或编码处理阶段的视频图像的分辨率,以及上调前处理阶段和/或编码处理阶段的视频图像的分辨率。The resolution of the video image in the pre-processing stage and/or the encoding process stage is reduced, and the resolution of the video image in the pre-processing stage and/or the encoding process stage is increased.
在一个可能的实施例中,所述分辨率调节模块104配置为:In a possible embodiment, the resolution adjustment module 104 is configured as:
在获取视频图像的丢帧数以及单帧图像的处理耗时之前,通过图像裁剪算法对摄像装置采集的视频图像进行裁剪,得到不同挡位下的分辨率的视频图像。Before obtaining the number of dropped frames of the video image and the processing time of a single frame image, the video image collected by the camera device is cropped through an image cropping algorithm to obtain video images with resolutions in different gears.
图6为本申请实施例提供的一种视频分辨率自适应调节设备的结构示意图,如图6所示,该设备包括处理器201、存储器202、输入装置203和输出装置204;设备中处理器201的数量可以是一个或多个,图6中以一个处理器201为例;设备中的处理器201、存储器202、输入装置203和输出装置204可以通过总线或其他方式连接,图6中以通过总线连接为例。存储器202作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请实施例中的视频分辨率自适应调节方法对应的程序指令/模块。处理器201通过运行存储在存储器202中的软件程序、指令以及模块,从而执行设备的各种功能 应用以及数据处理,即实现上述的视频分辨率自适应调节方法。输入装置203可用于接收输入的数字或字符信息,以及产生与设备的用户设置以及功能控制有关的键信号输入。输出装置204可包括显示屏等显示设备。Figure 6 is a schematic structural diagram of a video resolution adaptive adjustment device provided by an embodiment of the present application. As shown in Figure 6, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the processor in the device The number of 201 may be one or more. In Figure 6, one processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device may be connected through a bus or other means. In Figure 6, For example, connect via a bus. As a computer-readable storage medium, the memory 202 can be used to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the video resolution adaptive adjustment method in the embodiment of the present application. The processor 201 executes software programs, instructions and modules stored in the memory 202 to perform various functions of the device. Application and data processing, that is, to implement the above-mentioned video resolution adaptive adjustment method. The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and functional control of the device. The output device 204 may include a display device such as a display screen.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种上述实施例描述的视频分辨率自适应调节方法,其中,包括:Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor are used to perform a video resolution adaptive adjustment method described in the above embodiments, wherein, include:
获取视频图像的丢帧数以及单帧图像的处理耗时;Obtain the number of dropped frames of video images and the processing time of single frame images;
根据所述处理耗时计算得到最大处理帧率,基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩;The maximum processing frame rate is calculated according to the processing time consumption, and the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
如果所述状态信息为性能过载,则下调所述视频图像的分辨率;If the status information indicates performance overload, then lower the resolution of the video image;
如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。If the status information indicates excess performance, the resolution of the video image is increased.
值得注意的是,上述视频分辨率自适应调节装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。It is worth noting that in the above embodiments of the video resolution adaptive adjustment device, the various units and modules included are only divided according to functional logic, but are not limited to the above divisions, as long as they can realize the corresponding functions. ; In addition, the specific names of each functional unit are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.
在一些可能的实施方式中,本申请提供的方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在计算机设备上运行时,所述程序代码用于使所述计算机设备执行本说明书上述描述的根据本申请各种示例性实施方式的方法中的步骤,例如,所述计算机设备可以执行本申请实施例所记载的视频分辨率自适应调节方法。所述程序产品可以采用一个或多个可读介质的任意组合实现。 In some possible implementations, various aspects of the method provided by this application can also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to The computer device is caused to execute the steps in the method according to the various exemplary embodiments of the present application described above. For example, the computer device may execute the video resolution adaptive adjustment method described in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.

Claims (14)

  1. 视频分辨率自适应调节方法,其中,包括:Video resolution adaptive adjustment method, including:
    获取视频图像的丢帧数以及单帧图像的处理耗时;Obtain the number of dropped frames of video images and the processing time of single frame images;
    根据所述处理耗时计算得到最大处理帧率,基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩;The maximum processing frame rate is calculated according to the processing time consumption, and the status information of the video frame is determined based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
    如果所述状态信息为性能过载,则下调所述视频图像的分辨率;If the status information indicates performance overload, then lower the resolution of the video image;
    如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。If the status information indicates excess performance, the resolution of the video image is increased.
  2. 根据权利要求1所述的视频分辨率自适应调节方法,其中,在获取视频图像的丢帧数以及单帧图像的处理耗时之前,还包括:The video resolution adaptive adjustment method according to claim 1, wherein before obtaining the number of dropped frames of the video image and the processing time of the single frame image, it also includes:
    获取单帧图像的处理时间;The processing time to obtain a single frame image;
    根据所述处理时间以及设置的移动加权指数滤波公式计算得到单帧图像的处理耗时。The processing time of a single frame image is calculated based on the processing time and the set motion weighted exponential filtering formula.
  3. 根据权利要求1或2所述的视频分辨率自适应调节方法,其中,所述根据所述处理耗时计算得到最大处理帧率,包括:The video resolution adaptive adjustment method according to claim 1 or 2, wherein the maximum processing frame rate calculated according to the processing time consumption includes:
    根据所述处理耗时计算单位时间处理的图像帧数以得到最大处理帧率。Calculate the number of image frames processed per unit time based on the processing time to obtain the maximum processing frame rate.
  4. 根据权利要求1-3中任一项所述的视频分辨率自适应调节方法,其中,所述基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,包括:The video resolution adaptive adjustment method according to any one of claims 1-3, wherein the determining the status information of the video frame based on the number of dropped frames and the maximum processing frame rate includes:
    根据所述丢帧数和计算得到的丢帧阈值,以及所述最大处理帧率和设置的标准帧率阈值确定视频帧的处理是否为性能过载;Determine whether the processing of video frames is performance overload based on the number of lost frames and the calculated frame loss threshold, as well as the maximum processing frame rate and the set standard frame rate threshold;
    根据所述最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩。Determine whether the processing of the video frame has excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold.
  5. 根据权利要求4所述的视频分辨率自适应调节方法,其中,在根据所述丢帧数和设置的丢帧阈值,以及所述最大处理帧率和计算得到的标准帧率阈值确定视频帧的处理是否为性能过载之前,还包括:The video resolution adaptive adjustment method according to claim 4, wherein the video frame is determined according to the number of lost frames and the set frame loss threshold, and the maximum processing frame rate and the calculated standard frame rate threshold. Before handling whether it is a performance overload, also include:
    根据当前挡位和下调挡位对应的图像分辨率以及所述最大处理帧率计算得到丢帧阈值,其中,所述下调挡位对应的图像分辨率小于所述当前挡位对应的图像分辨率。The frame loss threshold is calculated based on the image resolution corresponding to the current gear and the lowered gear, and the maximum processing frame rate, wherein the image resolution corresponding to the lowered gear is smaller than the image resolution corresponding to the current gear.
  6. 根据权利要求4或5所述的视频分辨率自适应调节方法,其中,所述根据所述丢帧数和计算得到的丢帧阈值,以及所述最大处理帧率和设置的标准帧率阈值确定视频帧的处理是否为性能过载,包括: The video resolution adaptive adjustment method according to claim 4 or 5, wherein the determination is based on the number of lost frames and the calculated frame loss threshold, and the maximum processing frame rate and the set standard frame rate threshold. Whether the processing of video frames is performance overload, including:
    如果所述丢帧数大于计算得到的丢帧阈值,且所述最大处理帧率小于设置的标准帧率阈值,则确定视频帧的处理为性能过载。If the number of lost frames is greater than the calculated frame loss threshold and the maximum processing frame rate is less than the set standard frame rate threshold, it is determined that the processing of the video frame is performance overloaded.
  7. 根据权利要求4-6中任一项所述的视频分辨率自适应调节方法,其中,在根据所述最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩之前,还包括:The video resolution adaptive adjustment method according to any one of claims 4 to 6, wherein before determining whether the processing of the video frame is excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold, Also includes:
    根据当前挡位和上调挡位对应的图像分辨率以及设置的最大帧率计算得到最大帧率阈值,其中,所述上调挡位对应的图像分辨率大于所述当前挡位对应的图像分辨率。The maximum frame rate threshold is calculated based on the image resolution corresponding to the current gear and the upward gear, and the set maximum frame rate, wherein the image resolution corresponding to the upper gear is greater than the image resolution corresponding to the current gear.
  8. 根据权利要求4-7中任一项所述的视频分辨率自适应调节方法,其中,所述根据所述最大处理帧率和计算得到的最大帧率阈值确定视频帧的处理是否为性能过剩,包括:The video resolution adaptive adjustment method according to any one of claims 4 to 7, wherein said determining whether the processing of video frames is excessive performance based on the maximum processing frame rate and the calculated maximum frame rate threshold, include:
    如果所述最大处理帧率大于计算得到的最大帧率阈值,则确定视频帧的处理为性能过剩。If the maximum processing frame rate is greater than the calculated maximum frame rate threshold, it is determined that the processing of the video frame has excessive performance.
  9. 根据权利要求1-8中任一项所述的视频分辨率自适应调节方法,其中,所述获取视频图像的丢帧数以及单帧图像的处理耗时,包括:The video resolution adaptive adjustment method according to any one of claims 1 to 8, wherein the acquisition of the number of dropped frames of the video image and the processing time of a single frame image include:
    获取视频图像的前处理阶段和/或编码处理阶段的丢帧数以及单帧图像的处理耗时;Obtain the number of lost frames in the pre-processing stage and/or encoding processing stage of the video image and the processing time of a single frame image;
    所述下调所述视频图像的分辨率和所述上调所述视频图像的分辨率,包括:The downward adjustment of the resolution of the video image and the upward adjustment of the resolution of the video image include:
    下调前处理阶段和/或编码处理阶段的视频图像的分辨率,以及上调前处理阶段和/或编码处理阶段的视频图像的分辨率。The resolution of the video image in the pre-processing stage and/or the encoding process stage is reduced, and the resolution of the video image in the pre-processing stage and/or the encoding process stage is increased.
  10. 根据权利要求1-9中任一项所述的视频分辨率自适应调节方法,其中,在获取视频图像的丢帧数以及单帧图像的处理耗时之前,还包括:The video resolution adaptive adjustment method according to any one of claims 1 to 9, wherein before obtaining the number of dropped frames of the video image and the processing time of the single frame image, it also includes:
    通过图像裁剪算法对摄像装置采集的视频图像进行裁剪,得到不同挡位下的分辨率的视频图像。The video images collected by the camera device are cropped using an image cropping algorithm to obtain video images with resolutions in different gears.
  11. 视频分辨率自适应调节装置,其中,包括:Video resolution adaptive adjustment device, including:
    数据获取模块,配置为获取视频图像的丢帧数以及单帧图像的处理耗时;The data acquisition module is configured to obtain the number of dropped frames of the video image and the processing time of a single frame image;
    帧率计算模块,配置为根据所述处理耗时计算得到最大处理帧率;A frame rate calculation module configured to calculate the maximum processing frame rate based on the processing time;
    状态信息确定模块,配置为基于所述丢帧数和所述最大处理帧率确定视频帧的状态信息,所述状态信息包括性能过载和性能过剩; A status information determination module configured to determine status information of the video frame based on the number of lost frames and the maximum processing frame rate, where the status information includes performance overload and excess performance;
    分辨率调节模块,配置为如果所述状态信息为性能过载,则下调所述视频图像的分辨率,如果所述状态信息为性能过剩,则上调所述视频图像的分辨率。A resolution adjustment module configured to lower the resolution of the video image if the status information indicates performance overload, and to increase the resolution of the video image if the status information indicates excess performance.
  12. 一种视频分辨率自适应调节设备,所述设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现权利要求1至10中任一项所述的视频分辨率自适应调节方法。A video resolution adaptive adjustment device, the device includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are processed by the one or more The processor is executed, so that the one or more processors implement the video resolution adaptive adjustment method according to any one of claims 1 to 10.
  13. 一种存储计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行权利要求1至10中任一项所述的视频分辨率自适应调节方法。A storage medium that stores computer-executable instructions, which when executed by a computer processor are used to perform the video resolution adaptive adjustment method according to any one of claims 1 to 10.
  14. 一种计算机程序产品,包括计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至10中任一项所述的视频分辨率自适应调节方法。 A computer program product includes a computer program, wherein when the computer program is executed by a processor, the video resolution adaptive adjustment method according to any one of claims 1 to 10 is implemented.
PCT/CN2023/081121 2022-03-18 2023-03-13 Video resolution adaptive adjustment method, apparatus and device, and storage medium WO2023174216A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210272513.2 2022-03-18
CN202210272513.2A CN114827662A (en) 2022-03-18 2022-03-18 Video resolution self-adaptive adjusting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023174216A1 true WO2023174216A1 (en) 2023-09-21

Family

ID=82529981

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/081121 WO2023174216A1 (en) 2022-03-18 2023-03-13 Video resolution adaptive adjustment method, apparatus and device, and storage medium

Country Status (2)

Country Link
CN (1) CN114827662A (en)
WO (1) WO2023174216A1 (en)

Families Citing this family (3)

* 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
CN117041669B (en) * 2023-09-27 2023-12-08 湖南快乐阳光互动娱乐传媒有限公司 Super-division control method and device for video stream and electronic equipment
CN117478934B (en) * 2023-12-26 2024-04-16 南昌航天广信科技有限责任公司 Video stream data transmission method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702061A (en) * 2013-12-23 2014-04-02 上海网达软件股份有限公司 Automatic adjustment method of resolution of video call of intelligent terminal
CN111225240A (en) * 2020-01-19 2020-06-02 安徽文香信息技术有限公司 Method and device for automatically adjusting occupied bandwidth, storage medium and electronic equipment
CN113038222A (en) * 2021-03-08 2021-06-25 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and storage medium
CN113242434A (en) * 2021-05-31 2021-08-10 山东云海国创云计算装备产业创新中心有限公司 Video compression method and related device
WO2022044164A1 (en) * 2020-08-26 2022-03-03 日本電気株式会社 Video quality estimating device, video quality estimating method, and video quality estimating system
CN114827662A (en) * 2022-03-18 2022-07-29 百果园技术(新加坡)有限公司 Video resolution self-adaptive adjusting method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100584006C (en) * 2006-06-20 2010-01-20 中兴通讯股份有限公司 Video conversion process method based on transform of time resolution
CN104539917A (en) * 2015-02-03 2015-04-22 成都金本华科技股份有限公司 Method for improving definition of video image
CN111182268B (en) * 2016-01-29 2021-08-17 深圳市大疆创新科技有限公司 Video data transmission method, system, equipment and shooting device
CN109936744B (en) * 2017-12-19 2020-08-18 腾讯科技(深圳)有限公司 Video coding processing method and device and application with video coding function
CN110827380B (en) * 2019-09-19 2023-10-17 北京铂石空间科技有限公司 Image rendering method and device, electronic equipment and computer readable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702061A (en) * 2013-12-23 2014-04-02 上海网达软件股份有限公司 Automatic adjustment method of resolution of video call of intelligent terminal
CN111225240A (en) * 2020-01-19 2020-06-02 安徽文香信息技术有限公司 Method and device for automatically adjusting occupied bandwidth, storage medium and electronic equipment
WO2022044164A1 (en) * 2020-08-26 2022-03-03 日本電気株式会社 Video quality estimating device, video quality estimating method, and video quality estimating system
CN113038222A (en) * 2021-03-08 2021-06-25 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and storage medium
CN113242434A (en) * 2021-05-31 2021-08-10 山东云海国创云计算装备产业创新中心有限公司 Video compression method and related device
CN114827662A (en) * 2022-03-18 2022-07-29 百果园技术(新加坡)有限公司 Video resolution self-adaptive adjusting method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114827662A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
WO2023174216A1 (en) Video resolution adaptive adjustment method, apparatus and device, and storage medium
WO2021068598A1 (en) Encoding method and device for screen sharing, and storage medium and electronic equipment
US20230393802A1 (en) Real-time screen sharing
WO2021244341A1 (en) Picture coding method and apparatus, electronic device and computer readable storage medium
US8928678B2 (en) Media workload scheduler
US10555002B2 (en) Long term reference picture coding
US9363187B2 (en) Jitter buffering system and method of jitter buffering
US8452120B2 (en) Image processing device and method
US20200267396A1 (en) Human visual system adaptive video coding
CN108681439B (en) Uniform display method based on frame rate control
US8233534B2 (en) Frame buffer compression and memory allocation in a video decoder
TWI715157B (en) System and method for maintaining a stable frame rate
CN106412588B (en) Image frame processing method
WO2021092821A1 (en) Adaptively encoding video frames using content and network analysis
CN108810468B (en) Video transmission device and method for optimizing display effect
WO2022057362A1 (en) Image processing method and apparatus, cloud real machine system, storage medium, and electronic device
CN112350998B (en) Video streaming transmission method based on edge calculation
CN111405347B (en) Picture display method and device, electronic equipment and readable storage medium
CN110912922B (en) Image transmission method and device, electronic equipment and storage medium
TW201842775A (en) Systems and methods for deferred post-processes in video encoding
US11825088B2 (en) Adaptively encoding video frames based on complexity
CN110753229A (en) Video acquisition device and method based on H.265 coding
CN113192169B (en) Image display optimization method and device for dynamically adjusting LOD Scale
US10135896B1 (en) Systems and methods providing metadata for media streaming
US11736822B1 (en) Controlling an image sensor based on GPU temporal processing values

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23769718

Country of ref document: EP

Kind code of ref document: A1