Bit rate determination method and device, electronic device and storage medium
By obtaining the target peak signal-to-noise ratio range, reference resolution and code rate, the adaptive code rate of the terminal device is calculated, and the bit rate selection problem caused by the difference in physical resolution of the terminal device is solved, and efficient transmission of cloud application videos is achieved. Image quality assurance.
Patent Information
- Application Number
- CN202411252730.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The differences in physical resolutions of different terminal devices have led to how to choose a reasonable bit rate becoming a technical problem that needs to be solved in cloud applications, affecting video quality and network transmission efficiency.
By obtaining the target peak signal-to-noise ratio range, determine the relationship between physical resolution and code rate, use the reference resolution, reference code rate and target adjustment factors to calculate the code rate of the adapted terminal device to ensure the video drawing encoded by the cloud server Quality meets clarity requirements.
It realizes automatic determination of reasonable bit rate based on the physical resolution of the terminal device, ensures that the picture quality of cloud application video meets the requirements, and improves the efficiency and quality of video transmission.
Smart Images

Figure CN118803245B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for determining a bit rate, an electronic device and a storage medium. Background Art
[0002] Cloud applications (such as cloud games) are an application model based on cloud computing technology. Users connect to cloud servers through the network. The cloud servers run applications in real time and transmit the application screens to the user's terminal devices through video streaming after encoding and compressing them through encoders. The user's input instructions are also transmitted to the cloud server through the network for real-time interaction. This model greatly reduces the hardware requirements for user terminal devices, so that they only need basic video decoding capabilities and network connection capabilities to experience high-quality applications. Encoding compression can significantly reduce the size of videos, making video storage and network transmission more convenient. The encoding bit rate is the data flow used per unit time of the video file, which is set when the encoder is encoding. As an important parameter for video encoding compression, the bit rate is directly related to the video quality, network transmission, and video storage.
[0003] Currently, there are many terminal devices that can use cloud applications, such as mobile phones, TVs, and car-mounted devices. The physical resolutions of different terminal devices often vary. How to choose a reasonable bit rate based on the physical resolution of the terminal device has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the embodiments of the present application provide a method and device for determining a bit rate, an electronic device, and a storage medium.
[0005] In a first aspect, an embodiment of the present application provides a method for determining a bit rate, including:
[0006] Obtaining a target peak signal-to-noise ratio range, and determining a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range;
[0007] The physical resolution of the terminal device is obtained, and a bit rate adapted to the terminal device is determined according to the physical resolution of the terminal device and the relationship between the physical resolution and the bit rate.
[0008] In a second aspect, an embodiment of the present application further provides a bit rate determination device, including:
[0009] a first determining unit, configured to obtain a target peak signal-to-noise ratio range, and determine a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range;
[0010] The second determination unit is used to obtain the physical resolution of the terminal device, and determine the bit rate adapted to the terminal device according to the physical resolution of the terminal device and the relationship between the physical resolution and the bit rate.
[0011] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the bit rate determination method described in the first aspect are executed.
[0012] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the bit rate determination method described in the first aspect.
[0013] In the above scheme, the final bit rate is determined based on the relationship between the physical resolution and the bit rate, and the relationship between the physical resolution and the bit rate is determined based on the specified reference resolution, reference bit rate and target adjustment factor. The peak signal-to-noise ratio determined according to the reference resolution and reference bit rate belongs to the target peak signal-to-noise ratio range. In this way, the cloud server encodes the cloud application video according to the final bit rate, and after streaming the cloud application video to the terminal device, the picture quality of the cloud application video played by the terminal device can meet the clarity requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for determining a bit rate provided in an embodiment of the present application;
[0015] Figure 2 A schematic diagram of the structure of an embodiment of a bit rate determination device provided in an embodiment of the present application;
[0016] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0018] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0019] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0020] Reference Figure 1 FIG. 1 is a flow chart of a method for determining a bit rate provided in an embodiment of the present application, the method comprising:
[0021] S10, obtaining a target peak signal-to-noise ratio range, and determining a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range;
[0022] In this embodiment, it should be noted that the target peak signal-to-noise ratio range can be set as a value range of the peak signal-to-noise ratio PSNR (such as 40dB-41dB) or a specific PSNR value (such as 40dB) as needed, that is, the target peak signal-to-noise ratio range includes at least one PSNR value. In the case of a specified reference resolution, a peak signal-to-noise ratio range corresponds to a relationship between a physical resolution and a bit rate. After determining the target peak signal-to-noise ratio range, the relationship between the physical resolution and the bit rate corresponding to the target peak signal-to-noise ratio range can be determined through the corresponding relationship. In order to obtain the relationship between the physical resolution and the bit rate, it is necessary to specify the reference resolution and the reference bit rate, and determine the target adjustment factor, that is, the relationship between the physical resolution and the bit rate can be presented through the reference resolution, the reference bit rate and the target adjustment factor. The target adjustment factor can be a specified value (such as 1.2) or determined according to the target peak signal-to-noise ratio range.
[0023] S11. Obtain a physical resolution of a terminal device, and determine a bit rate suitable for the terminal device according to the physical resolution of the terminal device and a relationship between the physical resolution and the bit rate.
[0024] In this embodiment, it should be noted that after the relationship between the physical resolution and the bit rate is determined, the physical resolution of the terminal device is substituted into the relationship to obtain the bit rate adapted to the terminal device. The cloud server encodes the cloud application screen generated during the operation of the cloud application using the bit rate adapted to the terminal device and then pushes the stream to the terminal device. The terminal device decodes and plays the encoded video data, and the PSNR of the played video falls within the target peak signal-to-noise ratio range.
[0025] The bit rate determination method provided in the embodiment of the present application finally determines the bit rate based on the relationship between the physical resolution and the bit rate, and the relationship between the physical resolution and the bit rate is determined based on the specified reference resolution, the reference bit rate and the target adjustment factor. The peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range. In this way, the cloud server encodes the cloud application video according to the finally determined bit rate, and after streaming the cloud application video to the terminal device, the picture quality of the cloud application video played by the terminal device can meet the clarity requirement.
[0026] Based on the above method embodiment, the calculation process of the target adjustment factor may include:
[0027] Obtaining a minimum bit rate from a plurality of first image quality assessment data as a reference bit rate, and obtaining a plurality of adjustment factors based on the relationship between the reference resolution, the reference bit rate, the physical resolution and the bit rate, and the plurality of second image quality assessment data, wherein each piece of the first image quality assessment data comprises a resolution, a bit rate and a peak signal-to-noise ratio of a segment of video, the resolution in each piece of the first image quality assessment data is the reference resolution, the peak signal-to-noise ratio in each piece of the first image quality assessment data belongs to the target peak signal-to-noise ratio range, each piece of the second image quality assessment data comprises a resolution, a bit rate and a peak signal-to-noise ratio of a segment of video, the peak signal-to-noise ratio in each piece of the second image quality assessment data belongs to the target peak signal-to-noise ratio range, and the resolution in at least one piece of the second image quality assessment data is different from the reference resolution;
[0028] A target adjustment factor is obtained according to the multiple adjustment factors.
[0029] In this embodiment, it should be noted that a video source obtained by capturing and encoding the cloud application screen generated during the operation of the cloud application using a recording tool and / or a video consisting of a video segment or a partial frame of the obtained video obtained after encoding by the cloud server can be used as a video source. When determining a partial frame, only the specific cloud application screen rendered by the cloud application can be saved, and the video frame obtained after encoding the specific cloud application screen can be found through the pts (presentation time stamp) timestamp. The video source can be updated as the cloud application is updated. Thereafter, the video source is transcoded into videos of different resolutions and bit rates to obtain multiple video segments, and the peak signal-to-noise ratio of each of the multiple video segments is calculated. In this way, multiple first image quality evaluation data and multiple second image quality evaluation data can be obtained from the resolution, bit rate and peak signal-to-noise ratio corresponding to the multiple video segments.
[0030] After taking the minimum bit rate among the plurality of first image quality assessment data as the reference bit rate, the reference resolution, the reference bit rate, and the resolution and bit rate of the plurality of second image quality assessment data are substituted into the relationship between the physical resolution and the bit rate to obtain a plurality of adjustment factors. Afterwards, the plurality of adjustment factors may be processed according to a preset processing strategy to obtain a target adjustment factor, for example, a weighted sum of the plurality of adjustment factors may be performed to obtain the target adjustment factor, wherein the weight coefficient of the weighted sum may be set as required.
[0031] It should be noted that the plurality of second image quality evaluation data may include or not include at least one first image quality evaluation data.
[0032] Based on the aforementioned method embodiment, the video can be obtained by capturing and encoding the cloud application screen.
[0033] Based on the foregoing method embodiment, the relationship between the physical resolution and the bit rate may be:
[0034] bitrate=(width×height×ref_bitrate) / (ref_width×ref_height)×(factor_x) n ;
[0035] Where n=log 2 ((ref_width×ref_height) / (width×height)), bitrate represents the bit rate, width and height represent the width and height of the physical resolution respectively, ref_bitrate represents the reference bit rate, ref_width and ref_height represent the width and height of the reference resolution respectively, and factor_x represents the target adjustment factor.
[0036] Reference Figure 2 FIG. 1 is a schematic diagram of a structure of a bit rate determination device provided in an embodiment of the present application, the device comprising:
[0037] a first determining unit 20, configured to obtain a target peak signal-to-noise ratio range, and determine a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range;
[0038] The second determining unit 21 is used to obtain the physical resolution of the terminal device, and determine the bit rate adapted to the terminal device according to the physical resolution of the terminal device and the relationship between the physical resolution and the bit rate.
[0039] The bit rate determination device provided in the embodiment of the present application finally determines the bit rate based on the relationship between the physical resolution and the bit rate, and the relationship between the physical resolution and the bit rate is determined based on the specified reference resolution, the reference bit rate and the target adjustment factor. The peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range. In this way, the cloud server encodes the cloud application video according to the finally determined bit rate, and after streaming the cloud application video to the terminal device, the picture quality of the cloud application video played by the terminal device can meet the clarity requirement.
[0040] Based on the above device embodiment, the calculation process of the target adjustment factor may include:
[0041] Obtaining a minimum bit rate from a plurality of first image quality assessment data as a reference bit rate, and obtaining a plurality of adjustment factors based on the relationship between the reference resolution, the reference bit rate, the physical resolution and the bit rate, and the plurality of second image quality assessment data, wherein each piece of the first image quality assessment data comprises a resolution, a bit rate and a peak signal-to-noise ratio of a segment of video, the resolution in each piece of the first image quality assessment data is the reference resolution, the peak signal-to-noise ratio in each piece of the first image quality assessment data belongs to the target peak signal-to-noise ratio range, each piece of the second image quality assessment data comprises a resolution, a bit rate and a peak signal-to-noise ratio of a segment of video, the peak signal-to-noise ratio in each piece of the second image quality assessment data belongs to the target peak signal-to-noise ratio range, and the resolution in at least one piece of the second image quality assessment data is different from the reference resolution;
[0042] A target adjustment factor is obtained according to the multiple adjustment factors.
[0043] Based on the aforementioned device embodiment, the video can be obtained by capturing and encoding the cloud application screen.
[0044] Based on the above device embodiment, the relationship between the physical resolution and the bit rate may be:
[0045] bitrate=(width×height×ref_bitrate) / (ref_width×ref_height)×(factor_x) n ;
[0046] Where n=log 2 ((ref_width×ref_height) / (width×height)), bitrate represents the bit rate, width and height represent the width and height of the physical resolution respectively, ref_bitrate represents the reference bit rate, ref_width and ref_height represent the width and height of the reference resolution respectively, and factor_x represents the target adjustment factor.
[0047] The bit rate determination device provided in the embodiment of the present application has an implementation process that is consistent with the bit rate determination method provided in the embodiment of the present application, and the effect that can be achieved is also the same as the bit rate determination method provided in the embodiment of the present application, which will not be repeated here.
[0048] like Figure 3 As shown, an electronic device provided by an embodiment of the present application includes: a processor 30, a memory 31 and a bus 32, wherein the memory 31 stores machine-readable instructions executable by the processor 30, and when the electronic device is running, the processor 30 communicates with the memory 31 through the bus 32, and the processor 30 executes the machine-readable instructions to perform the steps of the above-mentioned bit rate determination method.
[0049] Specifically, the memory 31 and the processor 30 can be general-purpose memories and processors, which are not specifically limited here. When the processor 30 runs the computer program stored in the memory 31, the bit rate determination method can be executed.
[0050] Corresponding to the above-mentioned bit rate determination method, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned bit rate determination method are executed.
[0051] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for determining a bit rate, characterized in that: Applied to cloud servers, including: Obtaining a target peak signal-to-noise ratio range, and determining a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range; Acquire the physical resolution of the terminal device, and determine a bit rate adapted to the terminal device according to the physical resolution of the terminal device and the relationship between the physical resolution and the bit rate; The determining the relationship between the physical resolution and the bit rate according to the target peak signal-to-noise ratio range includes: The minimum bit rate among multiple first image quality assessment data is obtained as a reference bit rate, wherein each first image quality assessment data includes the resolution, bit rate and peak signal-to-noise ratio of a video, the resolution in each first image quality assessment data is the reference resolution, the peak signal-to-noise ratio in each first image quality assessment data belongs to the target peak signal-to-noise ratio range, and the relationship between the physical resolution and the bit rate is determined by the reference resolution, the reference bit rate and the target adjustment factor.
2. The method according to claim 1, characterized in that The calculation process of the target adjustment factor includes: Based on the reference resolution, the reference bit rate, the relationship between the physical resolution and the bit rate, and multiple pieces of second image quality evaluation data, multiple adjustment factors are obtained, wherein each piece of second image quality evaluation data includes the resolution, bit rate and peak signal-to-noise ratio of a video, the peak signal-to-noise ratio in each piece of second image quality evaluation data belongs to the target peak signal-to-noise ratio range, and the resolution in at least one piece of second image quality evaluation data is different from the reference resolution; A target adjustment factor is obtained according to the multiple adjustment factors.
3. The method according to claim 2, characterized in that The video is obtained by capturing and encoding the cloud application screen.
4. The method according to any one of claims 1 to 3, characterized in that The relationship between the physical resolution and the bit rate is: bitrate=(width×height×ref_bitrate) / (ref_width×ref_height)×(factor_x) n ; Where n=log2((ref_width×ref_height) / (width×height)), bitrate represents the bit rate, width and height represent the width and height of the physical resolution respectively, ref_bitrate represents the reference bit rate, ref_width and ref_height represent the width and height of the reference resolution respectively, and factor_x represents the target adjustment factor.
5. A bit rate determination device, characterized in that: Applied to cloud servers, including: a first determining unit, configured to obtain a target peak signal-to-noise ratio range, and determine a relationship between a physical resolution and a bit rate according to the target peak signal-to-noise ratio range, wherein, in the case of specifying a reference resolution and a reference bit rate, the physical resolution and the bit rate are expressed in relationship through a target adjustment factor, the target adjustment factor is a specified value or is determined according to the reference bit rate, and a peak signal-to-noise ratio determined according to the reference resolution and the reference bit rate belongs to the target peak signal-to-noise ratio range; A second determining unit is used to obtain a physical resolution of a terminal device, and determine a bit rate adapted to the terminal device according to the physical resolution of the terminal device and a relationship between the physical resolution and the bit rate; The determining the relationship between the physical resolution and the bit rate according to the target peak signal-to-noise ratio range includes: The minimum bit rate among multiple first image quality assessment data is obtained as a reference bit rate, wherein each first image quality assessment data includes the resolution, bit rate and peak signal-to-noise ratio of a video, the resolution in each first image quality assessment data is the reference resolution, the peak signal-to-noise ratio in each first image quality assessment data belongs to the target peak signal-to-noise ratio range, and the relationship between the physical resolution and the bit rate is determined by the reference resolution, the reference bit rate and the target adjustment factor.
6. The device according to claim 5, characterized in that The calculation process of the target adjustment factor includes: Based on the reference resolution, the reference bit rate, the relationship between the physical resolution and the bit rate, and multiple pieces of second image quality evaluation data, multiple adjustment factors are obtained, wherein each piece of second image quality evaluation data includes the resolution, bit rate and peak signal-to-noise ratio of a video, the peak signal-to-noise ratio in each piece of second image quality evaluation data belongs to the target peak signal-to-noise ratio range, and the resolution in at least one piece of second image quality evaluation data is different from the reference resolution; A target adjustment factor is obtained according to the multiple adjustment factors.
7. The device according to claim 6, characterized in that The video is obtained by capturing and encoding the cloud application screen.
8. The device according to any one of claims 5 to 7, characterized in that The relationship between the physical resolution and the bit rate is: bitrate=(width×height×ref_bitrate) / (ref_width×ref_height)×(factor_x) n ; Where n=log2((ref_width×ref_height) / (width×height)), bitrate represents the bit rate, width and height represent the width and height of the physical resolution respectively, ref_bitrate represents the reference bit rate, ref_width and ref_height represent the width and height of the reference resolution respectively, and factor_x represents the target adjustment factor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the bit rate determination method according to any one of claims 1 to 4 are executed.
10. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the bit rate determination method according to any one of claims 1 to 4.
