WO2023165590A1 - Video coding adaptation method and apparatus, device, and storage medium - Google Patents
Video coding adaptation method and apparatus, device, and storage medium Download PDFInfo
- Publication number
- WO2023165590A1 WO2023165590A1 PCT/CN2023/079478 CN2023079478W WO2023165590A1 WO 2023165590 A1 WO2023165590 A1 WO 2023165590A1 CN 2023079478 W CN2023079478 W CN 2023079478W WO 2023165590 A1 WO2023165590 A1 WO 2023165590A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- hard
- coded
- quality information
- quality
- video
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/157—Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
Definitions
- the embodiments of the present application relate to the technical field of video processing, and in particular, to a video encoding adaptation method, device, device, and storage medium.
- hard encoding When encoding video, there are two commonly used encoding methods: hard encoding and soft encoding.
- the hard coding of video mainly depends on the graphics processor, which has the advantages of fast speed and low power consumption.
- the hardware encoder is an encoder integrated by the hardware manufacturer at the bottom layer. The compression performance is worse than that of soft coding, and different hardware production Manufacturers use different encoding solutions. If hardcoding is used directly, there will be a large difference in video encoding resolution under the same encoding configuration, which will affect the video viewing experience. Certain encoding quality conditions must be met before enabling hardcoding. coding.
- Video coding quality can be measured by objective quality indicators PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity), VMAF (Video Multi-method Assessment Fusion), etc.
- PSNR Peak Signal-to-Noise Ratio
- SSIM Structuretural Similarity
- VMAF Video Multi-method Assessment Fusion
- Embodiments of the present application provide a video coding adaptation method, device, device, and storage medium to measure video coding quality by directly calculating objective quality in real-time video coding of mobile devices in related technologies, and to calculate coding quality.
- the embodiment of the present application provides a video coding adaptation method, which is applied to a video coding adaptation device, including:
- an embodiment of the present application provides a video coding adaptation device, including a quality query module, an information acquisition module, and a coding adaptation module, wherein:
- the quality query module is configured to send a quality query request to the server according to the device type information, so as to query whether the server stores hard-coded quality information corresponding to the device type information;
- the information acquisition module is configured to determine to obtain hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;
- the encoding adaptation module is configured to determine a video encoding method according to the hard-coded quality information.
- an embodiment of the present application provides a video coding adaptation device, including: a memory and one or more processors;
- the memory configured to store one or more programs
- the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the video coding adaptation method as described in the first aspect.
- the embodiment of the present application provides a storage medium storing computer-executable instructions, and the computer-executable instructions are configured to execute the video coding adaptation method as described in the first aspect when executed by a computer processor .
- the embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads the computer program from the computer-readable storage medium Acquiring and executing a computer program, so that the device executes the video coding adaptation method as described in the first aspect.
- a quality query request is sent to the server according to the device type information, and when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from The hard-coded quality information of the device type is obtained from the server, and there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality information. Quality inspection obtains hard-coded quality information, and then determines the video encoding method according to the obtained hard-coded quality information, effectively improving the adaptation efficiency of video encoding methods, and ensuring video encoding quality and user experience.
- FIG. 1 is a flow chart of a video coding adaptation method provided in an embodiment of the present application
- FIG. 2 is a flow chart of another video coding adaptation method provided by an embodiment of the present application.
- FIG. 3 is a schematic diagram of a hard-coded quality detection process provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of a video encoding method determination flow provided by an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a video coding adaptation device provided in an embodiment of the present application.
- Fig. 6 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application.
- Figure 1 shows a flow chart of a video encoding adaptation method provided by an embodiment of the present application.
- the video encoding adaptation method provided by an embodiment of this application can be performed by a video encoding adaptation device, and the video encoding adaptation device can It is realized by means of hardware and/or software, and is integrated in a video coding adaptation device (such as a mobile phone, a tablet, a computer, etc.).
- the video coding adaptation method performed by the video coding adaptation device is taken as an example for description below.
- the video coding adaptation method includes:
- S101 Send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information.
- the device type information provided in this embodiment is used to indicate the device type corresponding to the video encoding adaptation device, and the device type information may be one of the device model, processing chip, operating system, and system version or a combination of several.
- the device type information may be one of the device model, processing chip, operating system, and system version or a combination of several.
- different video encoding adaptation devices with the same device type information have similar encoding and processing capabilities for the same video file due to the same combination of one or more of the device model, processing chip, operating system, and system version.
- the hard-coded quality information obtained from the hard-coded quality detection of the test video file by other video coding adaptation devices corresponding to the same device type information can reflect the hard-coded quality information obtained by the current video coding adaptation device from the hard-coded quality detection of the test video file Hard-coded quality information.
- the hard-coded quality information is recorded in the server based on the corresponding device type information, and the hard-coded quality information recorded in the server may be obtained by testers performing hard-coded quality detection on test video files based on different types of devices, or by other
- the video encoding adaptation device performs hard-coded quality inspection on the test video file and uploads it.
- the hard-coded quality information can be recorded in the form of a map, that is, the device type information is used as a key, and the corresponding hard-coded quality information is used as a value, and the hard-coded quality information and device type information are encapsulated in a key-value pair.
- the server After receiving the quality query request sent by the video coding adaptation device, the server uses the device type information carried in the quality query request as a key, and matches the same key in the record file of hard-coded quality information to find the hardware Encode quality information.
- the server when it is necessary to request hard-coded quality information from the server to determine the video encoding method, determine the device type information corresponding to the current video encoding adaptation device, and generate a quality query request according to the device type information.
- the server After receiving the quality query request sent by the video coding adaptation device, the server determines the device type information carried in the quality query request, and checks whether the hard-coded quality corresponding to the device type information is saved in the record file of the hard-coded quality information. information, and return the corresponding quality query result to the video coding adaptation device.
- the server finds the hard-coded quality information of the same device type information, it returns a quality query result indicating that the query is successful to the video coding adaptation device;
- the video coding adaptation device returns a quality query result indicating that the query fails.
- S102 Determine to obtain the hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information.
- the acquisition method of the hardware coding quality according to the quality query result that is, determine whether to obtain the hard-coded quality information from the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information. quality information.
- the quality query result indicates that the query is successful
- the direct query result may carry corresponding hard-coded quality information.
- the quality query result indicates that the query fails, it is determined to perform hard-coded quality detection according to the test video file to obtain hard-coded quality information.
- the test video file can be a test file provided by the server, or a test file previously stored locally by a video encoding adaptation device, and the test video files used by different video encoding adaptation devices for hard-coded quality inspection are the same test Files, select test video files with the same content for encoding, to ensure that the evaluation of video hard-coded quality is not affected by content differences, and to ensure the consistency and objectivity of hard-coded test results between different video encoding adaptation devices.
- the video coding mode used when encoding the video is determined according to the hard-coded quality information.
- the video coding method includes a hard coding method using a hardware encoder and a soft coding method using a software encoder. It is understandable that in real-time coding, hard coding is faster than soft coding, with lower power consumption, higher coding frame rate, and smoother picture playback. If the hardware performance allows or is sufficient, the quality of video coding can be guaranteed. Under the premise, the encoding effect of the hard-coding method is better than that of the soft-coding method. When the hard-coded quality information indication meets the set conditions, the hard-coded method is preferred to improve the video coding frame rate, reduce the energy consumption of coding, and improve user experience.
- the video encoding method when the video needs to be encoded later (for example, when the anchor device needs to upload the video stream generated during the live broadcast to the server), the video will be encoded according to the determined video encoding method .
- the determined video encoding method can be recorded, and when the corresponding application is subsequently restarted, the previously determined video encoding method based on the hard-coded quality information will be used, or when the device is detected
- the type information changes such as hardware or system version update
- the video encoding method is re-determined based on the hard-coded quality information.
- the server by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. The hard-coded quality information is measured, and then the video coding method is determined according to the obtained hard-coded quality information, so as to effectively improve the adaptation efficiency of the video coding method and ensure the video coding quality and user experience.
- FIG. 2 shows a flowchart of another video coding adaptation method provided by the embodiment of the present application.
- the video coding adaptation method is the embodiment of the above-mentioned video coding adaptation method.
- the video encoding adaptation method includes:
- S201 Determine whether hard-coded quality information is stored locally.
- the video coding adaptation device performs video coding through an installed application program (such as live video software), and after the video coding adaptation device starts the application program, it will determine the video coding method at an appropriate time. For example, when the application program is started for a set duration (for example, 5s), or when a functional module that requires video encoding is enabled (for example, the host turns on the live broadcast function), it is determined that the video encoding method needs to be determined through hard-coded quality information.
- an installed application program such as live video software
- a functional module that requires video encoding for example, the host turns on the live broadcast function
- the hard-coded quality information stored locally in the video coding adaptation device is preferentially used, and the hard-coded quality information is requested from the server when the hard-coded quality information is not stored locally.
- search for hard-coded quality information locally if there is hard-coded quality information locally, then jump to step S202, if there is no hard-coded quality information locally, then jump to step S203 .
- locally stored hardcoded quality information may be associated with device type information.
- the hard-coded quality information can be verified based on the latest device type information of the video coding adaptation device. If the latest device type information corresponds to the found hard-coded quality information If the type information is consistent, it is determined that the hard-coded quality information is saved locally. If the latest device type information is inconsistent with the device type information corresponding to the found hard-coded quality information (for example, the video encoding adaptation device has been repaired or upgraded to change the hardware or system) version, resulting in inconsistent device type information), it is considered that the hard-coded quality information is not saved locally, and the wrong hard-coded quality information is deleted.
- S202 In response to the hard-coded quality information being stored locally, determine to determine a video encoding method directly according to the hard-coded quality information.
- the method of determining the video encoding method is to directly determine the video encoding method based on the local hard-coded quality information, and there is no need to request the hard-coded quality information from the server or to test Video files have hard-coded quality checks.
- the hard-coded quality information stored locally is compared with the coding quality threshold, and when the hard-coded quality information reaches the coding quality threshold, it is determined that the video coding method is hard-coding, and when the hard-coded quality information does not reach the coding quality threshold
- the quality threshold is set, the video encoding mode is determined to be soft encoding.
- the hard-coded quality information stored locally may be the hard-coded quality information obtained from the server when the video coding adaptation device determined the video coding mode last time, or the hard-coded quality information obtained by performing hard-coded quality detection on the test video file
- the hard-coded quality information may also be the hard-coded quality information sent by the server actively according to the device type information of the video coding adaptation device.
- S203 In response to no hard-coded quality information stored locally, determine to send a quality query request to the server according to the device type information.
- S204 Send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information.
- the server when the server returns a successful quality query result, the quality query hard-coded quality information corresponding to the device type information is directly obtained from the server, and jumps to step S208, and the video is directly determined according to the hard-coded quality information returned by the server. Encoding.
- S206 In response to the server returning a quality query result of query failure, obtain a test video file from the server, and perform hard-coded quality detection on the test video file to obtain hard-coded quality information.
- the server when the server returns the quality query result of query failure, that is, there is no previous video coding adaptation device of the same device type to perform hard-coded quality detection based on the test video file and upload the corresponding hard-coded quality information, in order to ensure video coding quality , requires hard-coded quality checks locally.
- S2061 Encode the test video file in a hard-coded manner to obtain a video encoding result.
- S2062 Calculate hard-coded quality information for hard-coding the test video file according to the video coding result.
- test video file downloads the test video file according to the video file address provided by the server, and use the local hardware encoder to encode the test video file in a hard-coded manner to obtain the video encoding result, and use the video encoding result to calculate the test video file Hardcoded quality information is hardcoded.
- the hard-coded quality information is saved locally, and when the corresponding application is subsequently opened, the video encoding can be directly determined according to the locally recorded hard-coded quality information. mode to improve the adaptation efficiency of the video coding mode.
- S207 Save the hard-coded quality information to the server based on the device type information.
- the locally calculated hard-coded quality information is uploaded to the server, and the server saves the hard-coded quality information based on the device type information
- the hard-coded quality information is used for other video coding adaptation devices of the same type to obtain the hard-coded quality information based on the same device type information to adapt the video coding method.
- the hard-coded quality information and the corresponding device type information are recorded in the form of a map, that is, after the hard-coded quality information is calculated, the device type information is used as the key and the hard-coded quality information is used as the value to construct Key-value pairs are packaged into a map and uploaded to the server, which facilitates the server to record the correspondence between hard-coded quality information and device type information, and improves the query matching efficiency of hard-coded quality information and device type information.
- the video encoding mode adopted may be determined according to a comparison result between the hard-coded quality information and a preset encoding quality threshold. Based on this, as shown in Figure 4, as shown in a flow diagram of determining a video encoding method, this solution specifically includes when determining a video encoding method based on hard-coded quality information:
- the hard-coded quality information corresponding to the current device type information is obtained, the hard-coded quality information is compared with the coding quality threshold, and a corresponding comparison result is obtained.
- the comparison result indicates that the hard-coded quality information reaches the coding quality threshold
- the comparison result indicates that the hard-coded quality information does not reach the coding quality threshold, it can be determined that the coding quality of hard-coding the video under the current hardware configuration does not meet the set coding quality requirements.
- the video encoding method it is necessary to determine the video encoding method as a soft encoding method.
- the hard-coded quality information is one or a combination of objective quality indicators such as peak signal-to-noise ratio (PSNR), structural similarity (SSIM), and video multi-method assessment fusion (VMAF).
- the encoding quality threshold is also configured as one or a combination of objective quality index thresholds such as peak signal-to-noise ratio threshold, structural similarity threshold, and video multi-method evaluation fusion threshold.
- the live broadcast device Take the video encoding adaptation device configured on the mobile phone, tablet and other live broadcast equipment (video encoding adaptation equipment) used by the anchor as an example. (for example, 3 to 5 seconds), the live broadcast device first judges whether there is hard-coded quality information stored locally. If there is hard-coded quality information stored locally, it directly compares the hard-coded quality information If the information reaches the comparison result of the encoding quality threshold, set the video encoding method of the live broadcast program to hard-coding mode. If the hard-coded quality information does not reach the comparison result of the encoding quality threshold, set the video encoding method of the live program to soft encoding mode .
- a quality query request is sent to the server according to the device type information of the live broadcast device. If the server returns a quality query result indicating that the query is successful, obtain the hard-coded quality information corresponding to the device type information from the server, and compare the hard-coded quality information with the coding quality threshold. If the hard-coded quality information reaches the coding quality threshold If the comparison result, set the video coding method of the live broadcast program to hard coding, if the hard coded quality information does not reach the comparison result of the coding quality threshold, set the video coding method of the live broadcast program to soft coding.
- the video file address provided by the server is sent to the live broadcast program, the test video file is downloaded by the live program based on the video file address, and the test video file is hard-coded by the live program using a hardware encoder. Encode to obtain the video encoding result, and calculate the hard-coded quality information based on the video encoding result, save the hard-coded quality information locally, and encapsulate the hard-coded quality information and device type information into a map and upload it to the server for storage.
- the hard-coded quality information saved locally is compared with the coding quality threshold, and if the hard-coded quality information reaches the comparison result of the coding quality threshold, the video coding method of the live program is set to the hard-coded method, if If the comparison result of the hard-coded quality information does not reach the coding quality threshold, configure the video coding method of the live program as a soft coding method.
- Subsequent anchors enable the live broadcast function of the live program
- the live program encodes the video information collected by the camera based on the determined video encoding method to obtain the encoded video information, and uploads the encoded video information to the corresponding server, and the server sends the encoded video information to the viewer's device.
- video information After receiving the coded video information, the viewer device can decode the coded video information and play the corresponding video.
- the server by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. Obtain the hard-coded quality information, and then determine the video coding method according to the obtained hard-coded quality information, effectively improve the adaptation efficiency of the video coding method, and ensure the video coding quality and user experience.
- the server when the server queries the hard-coded quality information of the same device type information, it can directly request the hard-coded information from the server, and there is no need to perform hard-coded quality inspection on the test video file locally, which improves the efficiency of video coding adaptation.
- the hard-coded quality inspection of the test video file is performed locally to obtain the hard-coded quality information
- the hard-coded quality information is uploaded to the server based on the corresponding device type information.
- other devices of the same type need to determine the video encoding method, they can directly obtain the hard-coded quality information from the server. Acquire the corresponding hard-coded quality information to adapt to the video encoding method, further improving the efficiency of video encoding adaptation.
- Fig. 5 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application.
- the video encoding adaptation device includes a quality query module 51 , an information acquisition module 52 and an encoding adaptation module 53 .
- the quality query module 51 is configured to send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information;
- the information acquisition module 52 is configured to return based on the quality query result returned by the server Determine to obtain the hard-coded quality information from the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;
- the coding adaptation module 53 is configured to determine the video coding method according to the hard-coded quality information.
- the server by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. Obtain the hard-coded quality information, and then determine the video coding method according to the obtained hard-coded quality information, effectively improve the adaptation efficiency of the video coding method, and ensure the video coding quality and user experience.
- the information acquisition module 52 is specifically configured as:
- the test video file is obtained from the server, and hard-coded quality detection is performed on the test video file to obtain hard-coded quality information.
- the information acquisition module 52 when the information acquisition module 52 performs hard-coded quality detection on the test video file to obtain the hard-coded quality information, it includes:
- Hard-coded quality information hard-coded on a test video file is calculated from the video encoding results.
- the information acquisition module 52 is also configured to save the hard-coded quality information to the server based on the device type information after performing hard-coded quality detection on the test video file to obtain the hard-coded quality information
- the code adaptation module 53 is specifically configured as:
- the video coding mode is a hard-coded mode
- the video coding mode is a soft coding mode.
- the video coding adaptation device further includes a local query module, configured to: before the quality query module 51 sends a quality query request to the server according to the device type information:
- the hard-coded quality information is a combination of one or more of peak signal-to-noise ratio, structural similarity, and video multi-method assessment fusion.
- the embodiment of the present application also provides a video coding adaptation device, and the video coding adaptation device can integrate the video coding adaptation device provided in the embodiment of the present application.
- Fig. 6 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application.
- the video coding adaptation device includes: an input device 63, an output device 64, a memory 62 and one or more processors 61; a memory 62 configured to store one or more programs; when one or more programs are One or more processors 61 execute such that a One or more processors 61 implement the video coding adaptation method provided in the foregoing embodiments.
- the video coding adaptation apparatus, equipment, and computer provided above can be configured to execute the video coding adaptation method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
- the embodiment of the present application further provides a storage medium storing computer-executable instructions, and the computer-executable instructions are configured to execute the video coding adaptation method provided in the foregoing embodiments when executed by a computer processor.
- the computer-executable instructions are not limited to the video coding adaptation method provided above, and may also execute the video coding adaptation method provided in any embodiment of the present application.
- Related operations in the recipe method The video coding adaptation device, equipment, and storage medium provided in the above-mentioned embodiments can execute the video coding adaptation method provided in any embodiment of the present application.
- the video coding adaptation method provided by the example please refer to any implementation of the application.
- various aspects of the methods provided in the present disclosure can also be implemented in the form of a program product, which includes program code.
- the above program product is run on a computer device, the above program code is configured to make the above
- the computer device executes the steps in the methods described above in this specification according to various exemplary embodiments of the present disclosure.
- the above computer device may execute the real-time gesture detection method described in the embodiments of the present disclosure.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Embodiments of the present application provide a video coding adaptation method and apparatus, a device and a storage medium. According to the present technical solution, hard coding quality information corresponding to different device type information is recorded in a server. A quality query request is sent to the server according to the device type information; when the hard coding quality information corresponding to the device type information is recorded in the server, the hard coding quality information of the device type is directly obtained from the server, and there is no need to perform hard coding quality detection on a test video file; if the hard coding quality information corresponding to the device type information is not recorded in the server, hard coding quality detection is performed by using the test video file to obtain the hard coding quality information, and then a video coding mode is determined according to the obtained hard coding quality information. Thus, the adaptation efficiency of the video coding mode is effectively improved, and the video coding quality and the user experience are ensured.
Description
本申请要求在2022年03月04日提交中国专利局,申请号为202210214074.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with application number 202210214074.X submitted to the China Patent Office on March 4, 2022, the entire content of which is incorporated in this application by reference.
本申请实施例涉及视频处理技术领域,尤其涉及一种视频编码适配方法、装置、设备及存储介质。The embodiments of the present application relate to the technical field of video processing, and in particular, to a video encoding adaptation method, device, device, and storage medium.
在对视频进行编码时,常用的编码方式有硬编码和软编码两种。视频的硬编码主要依赖图形处理器,其具有速度快、功耗低等优点,但硬件编码器是由硬件生产厂商在底层集成的编码器,压缩性能比软编码要差,且不同的硬件生产厂商采用不同的编码解决方案,若直接采用硬编码,会出现相同的编码配置下,视频的编码清晰度差别较大的情况,影响视频的观看体验,需要满足一定的编码质量条件才可以开启硬编码。When encoding video, there are two commonly used encoding methods: hard encoding and soft encoding. The hard coding of video mainly depends on the graphics processor, which has the advantages of fast speed and low power consumption. However, the hardware encoder is an encoder integrated by the hardware manufacturer at the bottom layer. The compression performance is worse than that of soft coding, and different hardware production Manufacturers use different encoding solutions. If hardcoding is used directly, there will be a large difference in video encoding resolution under the same encoding configuration, which will affect the video viewing experience. Certain encoding quality conditions must be met before enabling hardcoding. coding.
视频的编码质量可以用客观质量指标PSNR(峰值信噪比)、SSIM(结构相似性)、VMAF(视频多方法评估融合)等来衡量,但在实时视频编码中,若直接在移动设备的实时视频编码中计算客观质量的方式来衡量视频的编码质量,会占用较多的cpu、内存,编码质量计算的开销较大。Video coding quality can be measured by objective quality indicators PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity), VMAF (Video Multi-method Assessment Fusion), etc. The method of calculating the objective quality in video encoding to measure the encoding quality of the video will occupy more cpu and memory, and the overhead of encoding quality calculation is relatively large.
发明内容Contents of the invention
本申请实施例提供一种视频编码适配方法、装置、设备及存储介质,以解决相关技术中直接在移动设备的实时视频编码中计算客观质量的方式来衡量视频的编码质量,编码质量计算的开销较大的技术问题,有效提高编码方式的适配效率。Embodiments of the present application provide a video coding adaptation method, device, device, and storage medium to measure video coding quality by directly calculating objective quality in real-time video coding of mobile devices in related technologies, and to calculate coding quality. A technical problem with high overhead, effectively improving the adaptation efficiency of the coding method.
在第一方面,本申请实施例提供了一种视频编码适配方法,应用于视频编码适配设备,其中,包括:In the first aspect, the embodiment of the present application provides a video coding adaptation method, which is applied to a video coding adaptation device, including:
根据设备类型信息向服务器发送质量查询请求,以查询所述服务器是否保
存有所述设备类型信息对应的硬编码质量信息;Send a quality query request to the server according to the device type information to query whether the server is guaranteed Hard-coded quality information corresponding to the device type information is stored;
基于所述服务器返回的质量查询结果确定从所述服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息;Determine to obtain hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;
根据所述硬编码质量信息确定视频编码方式。Determine the video encoding mode according to the hard-coded quality information.
在第二方面,本申请实施例提供了一种视频编码适配装置,包括质量查询模块、信息获取模块和编码适配模块,其中:In the second aspect, an embodiment of the present application provides a video coding adaptation device, including a quality query module, an information acquisition module, and a coding adaptation module, wherein:
所述质量查询模块,配置为根据设备类型信息向服务器发送质量查询请求,以查询所述服务器是否保存有所述设备类型信息对应的硬编码质量信息;The quality query module is configured to send a quality query request to the server according to the device type information, so as to query whether the server stores hard-coded quality information corresponding to the device type information;
所述信息获取模块,配置为基于所述服务器返回的质量查询结果确定从所述服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息;The information acquisition module is configured to determine to obtain hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;
所述编码适配模块,配置为根据所述硬编码质量信息确定视频编码方式。The encoding adaptation module is configured to determine a video encoding method according to the hard-coded quality information.
在第三方面,本申请实施例提供了一种视频编码适配设备,包括:存储器以及一个或多个处理器;In a third aspect, an embodiment of the present application provides a video coding adaptation device, including: a memory and one or more processors;
所述存储器,配置为存储一个或多个程序;the memory configured to store one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的视频编码适配方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the video coding adaptation method as described in the first aspect.
在第四方面,本申请实施例提供了一种存储计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时配置为执行如第一方面所述的视频编码适配方法。In the fourth aspect, the embodiment of the present application provides a storage medium storing computer-executable instructions, and the computer-executable instructions are configured to execute the video coding adaptation method as described in the first aspect when executed by a computer processor .
在第五方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行如第一方面所述的视频编码适配方法。In the fifth aspect, the embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads the computer program from the computer-readable storage medium Acquiring and executing a computer program, so that the device executes the video coding adaptation method as described in the first aspect.
本申请实施例通过在服务器中记录不同设备类型信息对应的硬编码质量信息,根据设备类型信息向服务器发送质量查询请求,在服务器中记录有该设备类型信息对应的硬编码质量信息时,直接从服务器中获取该设备类型的硬编码质量信息,不需要再根据测试视频文件进行硬编码质量检测,若服务器中未记录有该设备类型信息对应的硬编码质量信息,则利用测试视频文件进行硬编码质量检测得到硬编码质量信息,再根据得到的硬编码质量信息确定视频编码方式,有效提高视频编码方式的适配效率,保证视频编码质量和用户体验。
In this embodiment of the present application, by recording hard-coded quality information corresponding to different device type information in the server, a quality query request is sent to the server according to the device type information, and when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from The hard-coded quality information of the device type is obtained from the server, and there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality information. Quality inspection obtains hard-coded quality information, and then determines the video encoding method according to the obtained hard-coded quality information, effectively improving the adaptation efficiency of video encoding methods, and ensuring video encoding quality and user experience.
图1是本申请实施例提供的一种视频编码适配方法的流程图;FIG. 1 is a flow chart of a video coding adaptation method provided in an embodiment of the present application;
图2是本申请实施例提供的另一种视频编码适配方法的流程图;FIG. 2 is a flow chart of another video coding adaptation method provided by an embodiment of the present application;
图3是本申请实施例提供的一种硬编码质量检测流程示意图;FIG. 3 is a schematic diagram of a hard-coded quality detection process provided by an embodiment of the present application;
图4是本申请实施例提供的一种视频编码方式确定流程示意图;FIG. 4 is a schematic diagram of a video encoding method determination flow provided by an embodiment of the present application;
图5是本申请实施例提供的一种视频编码适配装置的结构示意图;FIG. 5 is a schematic structural diagram of a video coding adaptation device provided in an embodiment of the present application;
图6是本申请实施例提供的一种视频编码适配设备的结构示意图。Fig. 6 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application.
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时上述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。上述处理可以对应于方法、函数、规程、子例程、子程序等等。In order to make the purpose, technical solution and advantages of the present application clearer, specific embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only parts relevant to the present application are shown in the drawings but not all content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe various operations (or steps) as sequential processing, many of the operations may be performed in parallel, concurrently, or simultaneously. In addition, the order of operations can be rearranged. The above-described processing may be terminated when its operations are complete, but may also have additional steps not included in the figures. The above-described processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
图1给出了本申请实施例提供的一种视频编码适配方法的流程图,本申请实施例提供的视频编码适配方法可以由视频编码适配装置来执行,该视频编码适配装置可以通过硬件和/或软件的方式实现,并集成在视频编码适配设备(例如手机、平板、电脑等)中。Figure 1 shows a flow chart of a video encoding adaptation method provided by an embodiment of the present application. The video encoding adaptation method provided by an embodiment of this application can be performed by a video encoding adaptation device, and the video encoding adaptation device can It is realized by means of hardware and/or software, and is integrated in a video coding adaptation device (such as a mobile phone, a tablet, a computer, etc.).
下述以视频编码适配装置执行视频编码适配方法为例进行描述。参考图1,该视频编码适配方法包括:The video coding adaptation method performed by the video coding adaptation device is taken as an example for description below. Referring to Figure 1, the video coding adaptation method includes:
S101:根据设备类型信息向服务器发送质量查询请求,以查询服务器是否保存有设备类型信息对应的硬编码质量信息。S101: Send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information.
本实施例提供的设备类型信息用于指示视频编码适配装置对应的设备类型,设备类型信息可以是设备机型、处理芯片、操作系统、系统版本中的一种
或多种的组合。一般的,设备类型信息一致的不同视频编码适配装置,由于其设备机型、处理芯片、操作系统、系统版本中的一种或多种的组合一致,其对相同视频文件的编码处理能力相近,可通过其他相同设备类型信息对应的视频编码适配装置对测试视频文件的硬编码质量检测得到的硬编码质量信息,来反映当前视频编码适配装置对测试视频文件的硬编码质量检测得到的硬编码质量信息。The device type information provided in this embodiment is used to indicate the device type corresponding to the video encoding adaptation device, and the device type information may be one of the device model, processing chip, operating system, and system version or a combination of several. Generally, different video encoding adaptation devices with the same device type information have similar encoding and processing capabilities for the same video file due to the same combination of one or more of the device model, processing chip, operating system, and system version. , the hard-coded quality information obtained from the hard-coded quality detection of the test video file by other video coding adaptation devices corresponding to the same device type information can reflect the hard-coded quality information obtained by the current video coding adaptation device from the hard-coded quality detection of the test video file Hard-coded quality information.
其中,硬编码质量信息基于对应的设备类型信息记录在服务器中,服务器中记录的硬编码质量信息可以是由测试人员基于不同类型设备对测试视频文件进行硬编码质量检测得到,也可以是由其他视频编码适配装置对测试视频文件进行硬编码质量检测并上传得到。Wherein, the hard-coded quality information is recorded in the server based on the corresponding device type information, and the hard-coded quality information recorded in the server may be obtained by testers performing hard-coded quality detection on test video files based on different types of devices, or by other The video encoding adaptation device performs hard-coded quality inspection on the test video file and uploads it.
可选的,硬编码质量信息可以map的形式进行记录,即以设备类型信息为键,以对应的硬编码质量信息为值,通过键值对的方式封装硬编码质量信息和设备类型信息。服务器在接收到视频编码适配装置发送的质量查询请求后,以质量查询请求携带的设备类型信息为键,在硬编码质量信息的记录文件中匹配相同的键,从而查找设备类型信息对应的硬编码质量信息。Optionally, the hard-coded quality information can be recorded in the form of a map, that is, the device type information is used as a key, and the corresponding hard-coded quality information is used as a value, and the hard-coded quality information and device type information are encapsulated in a key-value pair. After receiving the quality query request sent by the video coding adaptation device, the server uses the device type information carried in the quality query request as a key, and matches the same key in the record file of hard-coded quality information to find the hardware Encode quality information.
示例性的,在需要向服务器请求硬编码质量信息以确定对视频的编码方式时,确定当前视频编码适配装置对应的设备类型信息,根据设备类型信息生成质量查询请求。Exemplarily, when it is necessary to request hard-coded quality information from the server to determine the video encoding method, determine the device type information corresponding to the current video encoding adaptation device, and generate a quality query request according to the device type information.
服务器在接收到视频编码适配装置发送的质量查询请求后,确定质量查询请求所携带的设备类型信息,并在硬编码质量信息的记录文件中查询是否保存有该设备类型信息对应的硬码质量信息,并向视频编码适配装置返回对应的质量查询结果。After receiving the quality query request sent by the video coding adaptation device, the server determines the device type information carried in the quality query request, and checks whether the hard-coded quality corresponding to the device type information is saved in the record file of the hard-coded quality information. information, and return the corresponding quality query result to the video coding adaptation device.
例如,服务器在查询到相同设备类型信息的硬编码质量信息时,向视频编码适配装置返回指示查询成功的质量查询结果,而在未查询到相同设备类型信息的硬编码质量信息时,则向视频编码适配装置返回指示查询失败的质量查询结果。For example, when the server finds the hard-coded quality information of the same device type information, it returns a quality query result indicating that the query is successful to the video coding adaptation device; The video coding adaptation device returns a quality query result indicating that the query fails.
S102:基于服务器返回的质量查询结果确定从服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息。S102: Determine to obtain the hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information.
示例性的,在接收到服务器返回的质量查询结果后,根据质量查询结果确定硬件编码质量的获取方式,即确定从服务器获取硬编码质量信息,还是根据测试视频文件进行硬编码质量检测得到硬编码质量信息。
Exemplarily, after receiving the quality query result returned by the server, determine the acquisition method of the hardware coding quality according to the quality query result, that is, determine whether to obtain the hard-coded quality information from the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information. quality information.
例如,在质量查询结果指示查询成功时,确定从服务器获取硬编码质量信息。在一个实施例中,若质量查询结果指示查询成功时,直接查询结果中可携带对应的硬编码质量信息。而在质量查询结果指示查询失败时,确定根据测试视频文件进行硬编码质量检测得到硬编码质量信息。其中测试视频文件可以是服务器提供的测试文件,还可以是视频编码适配装置预先保存在本地的测试文件,并且不同视频编码适配装置进行硬编码质量检测所使用的测试视频文件为相同的测试文件,选择相同内容的测试视频文件来做编码,保证了视频硬编码质量的评价不受内容差异的影响,保证不同视频编码适配装置之间硬编码测试结果的一致性和客观性。For example, when the quality query result indicates that the query is successful, it is determined to obtain the hard-coded quality information from the server. In one embodiment, if the quality query result indicates that the query is successful, the direct query result may carry corresponding hard-coded quality information. When the quality query result indicates that the query fails, it is determined to perform hard-coded quality detection according to the test video file to obtain hard-coded quality information. The test video file can be a test file provided by the server, or a test file previously stored locally by a video encoding adaptation device, and the test video files used by different video encoding adaptation devices for hard-coded quality inspection are the same test Files, select test video files with the same content for encoding, to ensure that the evaluation of video hard-coded quality is not affected by content differences, and to ensure the consistency and objectivity of hard-coded test results between different video encoding adaptation devices.
S103:根据硬编码质量信息确定视频编码方式。S103: Determine a video encoding method according to the hard-coded quality information.
示例性的,在得到硬编码质量信息后,根据该硬编码质量信息确定对视频进行编码时所使用的视频编码方式。其中,视频编码方式包括利用硬件编码器进行编码的硬编码方式以及利用软件编码器进行编码的软编码方式。可以理解的是,在实时编码中,硬编码相对于软编码速度更快,功耗更低,编码帧率更高,画面的播放更加流畅,在硬件性能允许或充足,可保证视频编码质量的前提下,硬编码方式的编码效果优于软编码方式的编码效果,在硬编码质量信息指示达到设定条件时,优先采用硬编码方式,以提高视频编码帧率,减少编码的能量消耗,提升用户体验。Exemplarily, after the hard-coded quality information is obtained, the video coding mode used when encoding the video is determined according to the hard-coded quality information. Wherein, the video coding method includes a hard coding method using a hardware encoder and a soft coding method using a software encoder. It is understandable that in real-time coding, hard coding is faster than soft coding, with lower power consumption, higher coding frame rate, and smoother picture playback. If the hardware performance allows or is sufficient, the quality of video coding can be guaranteed. Under the premise, the encoding effect of the hard-coding method is better than that of the soft-coding method. When the hard-coded quality information indication meets the set conditions, the hard-coded method is preferred to improve the video coding frame rate, reduce the energy consumption of coding, and improve user experience.
在一个实施例中,在确定视频编码方式后,后续在需要对视频进行编码时(例如主播设备需要向服务器上传直播过程中产生的视频流时),将根据确定的视频编码方式对视频进行编码。可选的,在确定视频编码方式后,可对确定的视频编码方式进行记录,后续重新启动对应的应用程序时,将沿用之前根据硬编码质量信息确定的视频编码方式,或者是在检测到设备类型信息发生变化(例如硬件或系统版本更新)时清楚记录的视频编码方式和/或重新根据测试视频文件进行硬编码质量检测,还可以是不记录确定的视频编码方式,在每次重新启动对应的应用程序时,重新根据硬编码质量信息确定视频编码方式。In one embodiment, after the video encoding method is determined, when the video needs to be encoded later (for example, when the anchor device needs to upload the video stream generated during the live broadcast to the server), the video will be encoded according to the determined video encoding method . Optionally, after the video encoding method is determined, the determined video encoding method can be recorded, and when the corresponding application is subsequently restarted, the previously determined video encoding method based on the hard-coded quality information will be used, or when the device is detected When the type information changes (such as hardware or system version update), clearly record the video encoding method and/or perform hard-coded quality inspection based on the test video file again, or not record the determined video encoding method, corresponding to each restart When using the application, the video encoding method is re-determined based on the hard-coded quality information.
上述,通过在服务器中记录不同设备类型信息对应的硬编码质量信息,根据设备类型信息向服务器发送质量查询请求,在服务器中记录有该设备类型信息对应的硬编码质量信息时,直接从服务器中获取该设备类型的硬编码质量信息,不需要再根据测试视频文件进行硬编码质量检测,若服务器中未记录有该设备类型信息对应的硬编码质量信息,则利用测试视频文件进行硬编码质量检
测得到硬编码质量信息,再根据得到的硬编码质量信息确定视频编码方式,有效提高视频编码方式的适配效率,保证视频编码质量和用户体验。As mentioned above, by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. The hard-coded quality information is measured, and then the video coding method is determined according to the obtained hard-coded quality information, so as to effectively improve the adaptation efficiency of the video coding method and ensure the video coding quality and user experience.
在上述实施例的基础上,图2给出了本申请实施例提供的另一种视频编码适配方法的流程图,该视频编码适配方法是对上述视频编码适配方法的具体化。参考图2,该视频编码适配方法包括:On the basis of the above-mentioned embodiments, FIG. 2 shows a flowchart of another video coding adaptation method provided by the embodiment of the present application. The video coding adaptation method is the embodiment of the above-mentioned video coding adaptation method. Referring to Figure 2, the video encoding adaptation method includes:
S201:确定本地是否保存有硬编码质量信息。S201: Determine whether hard-coded quality information is stored locally.
本实施例提供的视频编码适配装置通过安装的应用程序(例如视频直播软件)进行视频的编码,在视频编码适配装置启动该应用程序后,将在合适的时机确定对视频的编码方式。例如在启动应用程序达到设定时长(例如5s),或者是在开启需要进行视频编码的功能模块(例如主播打开直播功能)时,确定需要通过硬编码质量信息确定视频编码方式。The video coding adaptation device provided in this embodiment performs video coding through an installed application program (such as live video software), and after the video coding adaptation device starts the application program, it will determine the video coding method at an appropriate time. For example, when the application program is started for a set duration (for example, 5s), or when a functional module that requires video encoding is enabled (for example, the host turns on the live broadcast function), it is determined that the video encoding method needs to be determined through hard-coded quality information.
本实施例优先采用保存在视频编码适配装置本地的硬编码质量信息,在本地未保存有硬编码质量信息时再向服务器请求硬编码质量信息。示例性的,在需要确定视频编码方式时,在本地查找硬编码质量信息,若本地存在硬编码质量信息,则跳转至步骤S202,若本地不存在硬编码质量信息,则跳转至步骤S203。In this embodiment, the hard-coded quality information stored locally in the video coding adaptation device is preferentially used, and the hard-coded quality information is requested from the server when the hard-coded quality information is not stored locally. Exemplarily, when it is necessary to determine the video encoding method, search for hard-coded quality information locally, if there is hard-coded quality information locally, then jump to step S202, if there is no hard-coded quality information locally, then jump to step S203 .
在一个实施例中,保存在本地的硬编码质量信息可与设备类型信息进行关联。后续在确定本地是否保存有硬编码质量信息时,可基于视频编码适配装置最新的设备类型信息对硬编码质量信息进行验证,若最新的设备类型信息与查找到的硬编码质量信息对应的设备类型信息一致,则确定本地保存有硬编码质量信息,若最新的设备类型信息与查找到的硬编码质量信息对应的设备类型信息不一致(例如视频编码适配装置经过维修或升级改变了硬件或系统版本,导致设备类型信息不一致),则认为本地未保存有硬编码质量信息,并将该错误的硬编码质量信息删除。In one embodiment, locally stored hardcoded quality information may be associated with device type information. When determining whether there is hard-coded quality information stored locally, the hard-coded quality information can be verified based on the latest device type information of the video coding adaptation device. If the latest device type information corresponds to the found hard-coded quality information If the type information is consistent, it is determined that the hard-coded quality information is saved locally. If the latest device type information is inconsistent with the device type information corresponding to the found hard-coded quality information (for example, the video encoding adaptation device has been repaired or upgraded to change the hardware or system) version, resulting in inconsistent device type information), it is considered that the hard-coded quality information is not saved locally, and the wrong hard-coded quality information is deleted.
S202:响应于本地保存有硬编码质量信息,确定直接根据硬编码质量信息确定视频编码方式。S202: In response to the hard-coded quality information being stored locally, determine to determine a video encoding method directly according to the hard-coded quality information.
示例性的,在本地保存有硬编码质量信息时,可确定对视频编码方式的确定方式为直接根据本地的硬编码质量信息确定视频编码方式,不需要再向服务器请求硬编码质量信息或对测试视频文件进行硬编码质量检测。即将本地保存的硬编码质量信息与编码质量阈值进行比较,并在硬编码质量信息达到编码质量阈值时,确定视频编码方式为硬编码方式,而在硬编码质量信息未达到编码
质量阈值时,确定视频编码方式为软编码方式。在确定直接根据硬编码质量信息确定视频编码方式时,跳转至步骤S208。Exemplarily, when the hard-coded quality information is stored locally, it can be determined that the method of determining the video encoding method is to directly determine the video encoding method based on the local hard-coded quality information, and there is no need to request the hard-coded quality information from the server or to test Video files have hard-coded quality checks. The hard-coded quality information stored locally is compared with the coding quality threshold, and when the hard-coded quality information reaches the coding quality threshold, it is determined that the video coding method is hard-coding, and when the hard-coded quality information does not reach the coding quality threshold When the quality threshold is set, the video encoding mode is determined to be soft encoding. When it is determined that the video encoding mode is determined directly according to the hard-coded quality information, jump to step S208.
其中,保存在本地的硬编码质量信息可以是该视频编码适配装置在上一次确定视频编码方式时,从服务器获取的硬编码质量信息,或者是在对测试视频文件进行硬编码质量检测得到的硬编码质量信息,还可以是服务器主动根据视频编码适配装置的设备类型信息下发的硬编码质量信息。Wherein, the hard-coded quality information stored locally may be the hard-coded quality information obtained from the server when the video coding adaptation device determined the video coding mode last time, or the hard-coded quality information obtained by performing hard-coded quality detection on the test video file The hard-coded quality information may also be the hard-coded quality information sent by the server actively according to the device type information of the video coding adaptation device.
S203:响应于本地未保存有硬编码质量信息,确定根据设备类型信息向服务器发送质量查询请求。S203: In response to no hard-coded quality information stored locally, determine to send a quality query request to the server according to the device type information.
示例性的,在本地未保存有硬编码质量信息时,则需要根据自身的设备类型信息向服务器发送质量查询请求,以确定从服务器获取硬编码质量信息,还是根据测试视频文件进行硬编码质量检测的方式获取硬编码质量信息。Exemplarily, when there is no hard-coded quality information saved locally, it is necessary to send a quality query request to the server according to its own device type information to determine whether to obtain the hard-coded quality information from the server or perform hard-coded quality detection based on the test video file way to get hard-coded quality information.
S204:根据设备类型信息向服务器发送质量查询请求,以查询服务器是否保存有设备类型信息对应的硬编码质量信息。S204: Send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information.
S205:响应于服务器返回查询成功的质量查询结果,从服务器获取查询到的硬编码质量信息。S205: In response to the server returning a successful quality query result, acquire the queried hard-coded quality information from the server.
示例性的,在服务器返回查询成功的质量查询结果时,直接从服务器中获取设备类型信息对应的质量查询硬编码质量信息,并跳转至步骤S208,直接根据服务器返回的硬编码质量信息确定视频编码方式。Exemplarily, when the server returns a successful quality query result, the quality query hard-coded quality information corresponding to the device type information is directly obtained from the server, and jumps to step S208, and the video is directly determined according to the hard-coded quality information returned by the server. Encoding.
S206:响应于服务器返回查询失败的质量查询结果,从服务器获取测试视频文件,并对测试视频文件进行硬编码质量检测得到硬编码质量信息。S206: In response to the server returning a quality query result of query failure, obtain a test video file from the server, and perform hard-coded quality detection on the test video file to obtain hard-coded quality information.
示例性的,在服务器返回查询失败的质量查询结果时,即先前并没有相同设备类型的视频编码适配装置基于测试视频文件进行硬编码质量检测并上传对应硬编码质量信息,为了保证视频编码质量,需要在本地进行硬编码质量检测。Exemplarily, when the server returns the quality query result of query failure, that is, there is no previous video coding adaptation device of the same device type to perform hard-coded quality detection based on the test video file and upload the corresponding hard-coded quality information, in order to ensure video coding quality , requires hard-coded quality checks locally.
如图3提供的一种硬编码质量检测流程示意图所示,在对测试视频文件进行硬编码质量检测得到硬编码质量信息时,具体包括:As shown in the schematic diagram of a hard-coded quality inspection process provided in Figure 3, when the hard-coded quality inspection is performed on the test video file to obtain the hard-coded quality information, it specifically includes:
S2061:按照硬编码方式对测试视频文件进行编码得到视频编码结果。S2061: Encode the test video file in a hard-coded manner to obtain a video encoding result.
S2062:根据视频编码结果计算对测试视频文件进行硬编码的硬编码质量信息。S2062: Calculate hard-coded quality information for hard-coding the test video file according to the video coding result.
示例性的,根据服务器提供的视频文件地址下载测试视频文件,并利用本地的硬件编码器,按照硬编码方式对测试视频文件进行编码得到视频编码结果,并利用视频编码结果计算对该测试视频文件进行硬编码的硬编码质量信息。
Exemplarily, download the test video file according to the video file address provided by the server, and use the local hardware encoder to encode the test video file in a hard-coded manner to obtain the video encoding result, and use the video encoding result to calculate the test video file Hardcoded quality information is hardcoded.
在一个实施例中,在对测试视频文件进行硬编码的硬编码质量信息后,将硬编码质量信息保存在本地,后续开启对应应用程序时,可直接根据本地记录的硬编码质量信息确定视频编码方式,提高视频编码方式的适配效率。In one embodiment, after hard-coding the hard-coded quality information of the test video file, the hard-coded quality information is saved locally, and when the corresponding application is subsequently opened, the video encoding can be directly determined according to the locally recorded hard-coded quality information. mode to improve the adaptation efficiency of the video coding mode.
S207:基于设备类型信息将硬编码质量信息保存至服务器。S207: Save the hard-coded quality information to the server based on the device type information.
示例性的,在对测试视频文件进行硬编码的硬编码质量信息后,基于当前视频编码适配装置的设备类型信息将本地计算得到的硬编码质量信息上传给服务器,由服务器基于设备类型信息保存硬编码质量信息,以供其他相同类型的视频编码适配装置基于相同的设备类型信息获取该硬编码质量信息适配视频编码方式。Exemplarily, after hard-coding the hard-coded quality information on the test video file, based on the device type information of the current video coding adaptation device, the locally calculated hard-coded quality information is uploaded to the server, and the server saves the hard-coded quality information based on the device type information The hard-coded quality information is used for other video coding adaptation devices of the same type to obtain the hard-coded quality information based on the same device type information to adapt the video coding method.
在一个可能的实施例中,硬编码质量信息和对应的设备类型信息以map的形式进行记录,即在计算得到硬编码质量信息后,以设备类型信息为键,以硬编码质量信息为值构建键值对,并封装成map的形式上传给服务器,方便服务器对硬编码质量信息和设备类型信息的对应关系进行记录,并提高对硬编码质量信息和设备类型信息的查询匹配效率。In a possible embodiment, the hard-coded quality information and the corresponding device type information are recorded in the form of a map, that is, after the hard-coded quality information is calculated, the device type information is used as the key and the hard-coded quality information is used as the value to construct Key-value pairs are packaged into a map and uploaded to the server, which facilitates the server to record the correspondence between hard-coded quality information and device type information, and improves the query matching efficiency of hard-coded quality information and device type information.
S208:根据硬编码质量信息确定视频编码方式。S208: Determine a video encoding method according to the hard-coded quality information.
在一个可能的实施例中,可根据硬编码质量信息与预先设定的编码质量阈值的比较结果确定所采用的视频编码方式。基于此,如图4提供的一种视频编码方式确定流程示意图所示,本方案在根据硬编码质量信息确定视频编码方式时,具体包括:In a possible embodiment, the video encoding mode adopted may be determined according to a comparison result between the hard-coded quality information and a preset encoding quality threshold. Based on this, as shown in Figure 4, as shown in a flow diagram of determining a video encoding method, this solution specifically includes when determining a video encoding method based on hard-coded quality information:
S2081:将硬编码质量信息与编码质量阈值进行比较。S2081: Compare the hard-coded quality information with a coding quality threshold.
S2082:响应于硬编码质量信息达到编码质量阈值的比较结果,确定视频编码方式为硬编码方式。S2082: In response to the comparison result that the hard-coded quality information reaches the coding quality threshold, determine that the video coding mode is the hard-coded mode.
S2083:响应于硬编码质量信息未达到编码质量阈值的比较结果,确定视频编码方式为软编码方式。S2083: In response to the comparison result that the hard-coded quality information does not reach the coding quality threshold, determine that the video coding mode is a soft coding mode.
示例性的,在得到当前设备类型信息下对应的硬编码质量信息后,将硬编码质量信息和编码质量阈值进行比较,并得到对应的比较结果。Exemplarily, after the hard-coded quality information corresponding to the current device type information is obtained, the hard-coded quality information is compared with the coding quality threshold, and a corresponding comparison result is obtained.
在一个实施例中,在比较结果指示硬编码质量信息达到编码质量阈值时,可确定当前硬件配置下对视频进行硬编码的编码质量可达到设定的编码质量要求,则将视频编码方式确定为硬编码方式。In one embodiment, when the comparison result indicates that the hard-coded quality information reaches the coding quality threshold, it can be determined that the coding quality of the hard-coded video under the current hardware configuration can meet the set coding quality requirement, and then the video coding method is determined as Hardcoded way.
而在比较结果指示硬编码质量信息未达到编码质量阈值时,可确定当前硬件配置下对视频进行硬编码的编码质量未达到设定的编码质量要求,为了保证
视频的编码效果,需要将视频编码方式确定为软编码方式。When the comparison result indicates that the hard-coded quality information does not reach the coding quality threshold, it can be determined that the coding quality of hard-coding the video under the current hardware configuration does not meet the set coding quality requirements. For the encoding effect of the video, it is necessary to determine the video encoding method as a soft encoding method.
在一个实施例中,硬编码质量信息为峰值信噪比(PSNR)、结构相似性(SSIM)和视频多方法评估融合(VMAF)等客观质量指标中的一种或多种的组合。对应的,编码质量阈值也配置为峰值信噪比阈值、结构相似性阈值和视频多方法评估融合阈值等客观质量指标阈值中的一种或多种的组合。In one embodiment, the hard-coded quality information is one or a combination of objective quality indicators such as peak signal-to-noise ratio (PSNR), structural similarity (SSIM), and video multi-method assessment fusion (VMAF). Correspondingly, the encoding quality threshold is also configured as one or a combination of objective quality index thresholds such as peak signal-to-noise ratio threshold, structural similarity threshold, and video multi-method evaluation fusion threshold.
以主播所使用的手机、平板等直播设备(视频编码适配设备)上配置的视频编码适配装置为例,假设在直播设备上安装有视频直播程序,在开启视频直播程序达到设定时间长度(例如3~5秒)时,直播设备先判断本地是否保存有硬编码质量信息,若本地保存有硬编码质量信息,则直接将该硬编码质量信息与编码质量阈值进行比较,若硬编码质量信息达到编码质量阈值的比较结果,则将直播程序的视频编码方式设置为硬编码方式,若硬编码质量信息未达到编码质量阈值的比较结果,则将直播程序的视频编码方式配置为软编码方式。Take the video encoding adaptation device configured on the mobile phone, tablet and other live broadcast equipment (video encoding adaptation equipment) used by the anchor as an example. (for example, 3 to 5 seconds), the live broadcast device first judges whether there is hard-coded quality information stored locally. If there is hard-coded quality information stored locally, it directly compares the hard-coded quality information If the information reaches the comparison result of the encoding quality threshold, set the video encoding method of the live broadcast program to hard-coding mode. If the hard-coded quality information does not reach the comparison result of the encoding quality threshold, set the video encoding method of the live program to soft encoding mode .
若本地未保存有硬编码质量信息,则根据直播设备的设备类型信息向服务器发起质量查询请求。若服务器返回指示查询成功的质量查询结果,则从服务器获取该设备类型信息对应的硬编码质量信息,并将该硬编码质量信息与编码质量阈值进行比较,若硬编码质量信息达到编码质量阈值的比较结果,则将直播程序的视频编码方式设置为硬编码方式,若硬编码质量信息未达到编码质量阈值的比较结果,则将直播程序的视频编码方式配置为软编码方式。If there is no hard-coded quality information saved locally, a quality query request is sent to the server according to the device type information of the live broadcast device. If the server returns a quality query result indicating that the query is successful, obtain the hard-coded quality information corresponding to the device type information from the server, and compare the hard-coded quality information with the coding quality threshold. If the hard-coded quality information reaches the coding quality threshold If the comparison result, set the video coding method of the live broadcast program to hard coding, if the hard coded quality information does not reach the comparison result of the coding quality threshold, set the video coding method of the live broadcast program to soft coding.
而在服务器返回指示查询失败的质量查询结果时,将服务器提供的视频文件地址发送给直播程序,由直播程序基于视频文件地址下载测试视频文件,由直播程序利用硬件编码器对测试视频文件进行硬编码得到视频编码结果,并根据视频编码结果计算硬编码质量信息,将硬编码质量信息保存到本地,并将硬编码质量信息和设备类型信息封装成map形式上传给服务器进行保存。在一个实施例中,将保存到本地的硬编码质量信息与编码质量阈值进行比较,若硬编码质量信息达到编码质量阈值的比较结果,则将直播程序的视频编码方式设置为硬编码方式,若硬编码质量信息未达到编码质量阈值的比较结果,则将直播程序的视频编码方式配置为软编码方式。And when the server returns the quality query result indicating query failure, the video file address provided by the server is sent to the live broadcast program, the test video file is downloaded by the live program based on the video file address, and the test video file is hard-coded by the live program using a hardware encoder. Encode to obtain the video encoding result, and calculate the hard-coded quality information based on the video encoding result, save the hard-coded quality information locally, and encapsulate the hard-coded quality information and device type information into a map and upload it to the server for storage. In one embodiment, the hard-coded quality information saved locally is compared with the coding quality threshold, and if the hard-coded quality information reaches the comparison result of the coding quality threshold, the video coding method of the live program is set to the hard-coded method, if If the comparison result of the hard-coded quality information does not reach the coding quality threshold, configure the video coding method of the live program as a soft coding method.
后续主播开启直播程序的视频直播功能时,直播程序基于确定的视频编码方式对摄像头采集的视频信息进行编码得到编码视频信息,并将编码视频信息上传到相应的服务器,由服务器向观众设备发送编码视频信息。观众设备在接收到编码视频信息后,可对编码视频信息进行解码并播放对应视频。
Subsequent anchors enable the live broadcast function of the live program, the live program encodes the video information collected by the camera based on the determined video encoding method to obtain the encoded video information, and uploads the encoded video information to the corresponding server, and the server sends the encoded video information to the viewer's device. video information. After receiving the coded video information, the viewer device can decode the coded video information and play the corresponding video.
上述,通过在服务器中记录不同设备类型信息对应的硬编码质量信息,根据设备类型信息向服务器发送质量查询请求,在服务器中记录有该设备类型信息对应的硬编码质量信息时,直接从服务器中获取该设备类型的硬编码质量信息,不需要再根据测试视频文件进行硬编码质量检测,若服务器中未记录有该设备类型信息对应的硬编码质量信息,则利用测试视频文件进行硬编码质量检测得到硬编码质量信息,再根据得到的硬编码质量信息确定视频编码方式,有效提高视频编码方式的适配效率,保证视频编码质量和用户体验。同时,在服务器查询到相同设备类型信息的硬编码质量信息时,可直接向服务器请求硬编码信息,不需要再在本地对测试视频文件进行硬编码质量检测,提高视频编码适配效率。在本地对测试视频文件进行硬编码质量检测得到硬编码质量信息后,基于对应的设备类型信息将硬编码质量信息上传到服务器中,其他相同类型设备在需要确定视频编码方式时,可直接从服务器获取对应的硬编码质量信息适配视频编码方式,进一步提高视频编码适配效率。As mentioned above, by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. Obtain the hard-coded quality information, and then determine the video coding method according to the obtained hard-coded quality information, effectively improve the adaptation efficiency of the video coding method, and ensure the video coding quality and user experience. At the same time, when the server queries the hard-coded quality information of the same device type information, it can directly request the hard-coded information from the server, and there is no need to perform hard-coded quality inspection on the test video file locally, which improves the efficiency of video coding adaptation. After the hard-coded quality inspection of the test video file is performed locally to obtain the hard-coded quality information, the hard-coded quality information is uploaded to the server based on the corresponding device type information. When other devices of the same type need to determine the video encoding method, they can directly obtain the hard-coded quality information from the server. Acquire the corresponding hard-coded quality information to adapt to the video encoding method, further improving the efficiency of video encoding adaptation.
图5是本申请实施例提供的一种视频编码适配装置的结构示意图。参考图5,该视频编码适配装置包括质量查询模块51、信息获取模块52和编码适配模块53。Fig. 5 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application. Referring to FIG. 5 , the video encoding adaptation device includes a quality query module 51 , an information acquisition module 52 and an encoding adaptation module 53 .
其中,质量查询模块51,配置为根据设备类型信息向服务器发送质量查询请求,以查询服务器是否保存有设备类型信息对应的硬编码质量信息;信息获取模块52,配置为基于服务器返回的质量查询结果确定从服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息;编码适配模块53,配置为根据硬编码质量信息确定视频编码方式。Among them, the quality query module 51 is configured to send a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information; the information acquisition module 52 is configured to return based on the quality query result returned by the server Determine to obtain the hard-coded quality information from the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information; the coding adaptation module 53 is configured to determine the video coding method according to the hard-coded quality information.
上述,通过在服务器中记录不同设备类型信息对应的硬编码质量信息,根据设备类型信息向服务器发送质量查询请求,在服务器中记录有该设备类型信息对应的硬编码质量信息时,直接从服务器中获取该设备类型的硬编码质量信息,不需要再根据测试视频文件进行硬编码质量检测,若服务器中未记录有该设备类型信息对应的硬编码质量信息,则利用测试视频文件进行硬编码质量检测得到硬编码质量信息,再根据得到的硬编码质量信息确定视频编码方式,有效提高视频编码方式的适配效率,保证视频编码质量和用户体验。As mentioned above, by recording the hard-coded quality information corresponding to different device type information in the server, and sending a quality query request to the server according to the device type information, when the hard-coded quality information corresponding to the device type information is recorded in the server, directly from the server To obtain the hard-coded quality information of this device type, there is no need to perform hard-coded quality inspection based on the test video file. If the hard-coded quality information corresponding to the device type information is not recorded in the server, use the test video file to perform hard-coded quality inspection. Obtain the hard-coded quality information, and then determine the video coding method according to the obtained hard-coded quality information, effectively improve the adaptation efficiency of the video coding method, and ensure the video coding quality and user experience.
在可能的实施例中,信息获取模块52具体配置为:In a possible embodiment, the information acquisition module 52 is specifically configured as:
响应于服务器返回查询成功的质量查询结果,从服务器获取查询到的硬编
码质量信息;In response to the server returning the quality query result of query success, obtain the hard-coded query from the server code quality information;
响应于服务器返回查询失败的质量查询结果,从服务器获取测试视频文件,并对测试视频文件进行硬编码质量检测得到硬编码质量信息。In response to the server returning a quality query result of query failure, the test video file is obtained from the server, and hard-coded quality detection is performed on the test video file to obtain hard-coded quality information.
在可能的实施例中,信息获取模块52在对测试视频文件进行硬编码质量检测得到硬编码质量信息时,包括:In a possible embodiment, when the information acquisition module 52 performs hard-coded quality detection on the test video file to obtain the hard-coded quality information, it includes:
按照硬编码方式对测试视频文件进行编码得到视频编码结果;Encode the test video file according to the hard-coded method to obtain the video encoding result;
根据视频编码结果计算对测试视频文件进行硬编码的硬编码质量信息。Hard-coded quality information hard-coded on a test video file is calculated from the video encoding results.
在可能的实施例中,信息获取模块52还配置为在对测试视频文件进行硬编码质量检测得到硬编码质量信息之后,基于设备类型信息将硬编码质量信息保存至服务器In a possible embodiment, the information acquisition module 52 is also configured to save the hard-coded quality information to the server based on the device type information after performing hard-coded quality detection on the test video file to obtain the hard-coded quality information
在可能的实施例中,编码适配模块53具体配置为:In a possible embodiment, the code adaptation module 53 is specifically configured as:
将硬编码质量信息与编码质量阈值进行比较;Compare hard-coded quality information with coded quality thresholds;
响应于硬编码质量信息达到编码质量阈值的比较结果,确定视频编码方式为硬编码方式;In response to the comparison result that the hard-coded quality information reaches the coding quality threshold, determine that the video coding mode is a hard-coded mode;
响应于硬编码质量信息未达到编码质量阈值的比较结果,确定视频编码方式为软编码方式。In response to the comparison result that the hard coding quality information does not reach the coding quality threshold, it is determined that the video coding mode is a soft coding mode.
在可能的实施例中,视频编码适配装置还包括本地查询模块,配置为在质量查询模块51根据设备类型信息向服务器发送质量查询请求之前:In a possible embodiment, the video coding adaptation device further includes a local query module, configured to: before the quality query module 51 sends a quality query request to the server according to the device type information:
确定本地是否保存有硬编码质量信息;Determine whether there is hard-coded quality information saved locally;
响应于本地保存有硬编码质量信息,确定直接根据硬编码质量信息确定视频编码方式;In response to the hard-coded quality information stored locally, determine the video encoding method directly according to the hard-coded quality information;
响应于本地未保存有硬编码质量信息,确定根据设备类型信息向服务器发送质量查询请求In response to the fact that the hard-coded quality information is not saved locally, it is determined to send a quality query request to the server according to the device type information
在可能的实施例中,硬编码质量信息为峰值信噪比、结构相似性和视频多方法评估融合中的一种或多种的组合。In a possible embodiment, the hard-coded quality information is a combination of one or more of peak signal-to-noise ratio, structural similarity, and video multi-method assessment fusion.
本申请实施例还提供了一种视频编码适配设备,该视频编码适配设备可集成本申请实施例提供的视频编码适配装置。图6是本申请实施例提供的一种视频编码适配设备的结构示意图。参考图6,该视频编码适配设备包括:输入装置63、输出装置64、存储器62以及一个或多个处理器61;存储器62,配置为存储一个或多个程序;当一个或多个程序被一个或多个处理器61执行,使得一个
或多个处理器61实现如上述实施例提供的视频编码适配方法。上述提供的视频编码适配装置、设备和计算机可配置为执行上述任意实施例提供的视频编码适配方法,具备相应的功能和有益效果。The embodiment of the present application also provides a video coding adaptation device, and the video coding adaptation device can integrate the video coding adaptation device provided in the embodiment of the present application. Fig. 6 is a schematic structural diagram of a video coding adaptation device provided by an embodiment of the present application. Referring to Fig. 6, the video coding adaptation device includes: an input device 63, an output device 64, a memory 62 and one or more processors 61; a memory 62 configured to store one or more programs; when one or more programs are One or more processors 61 execute such that a One or more processors 61 implement the video coding adaptation method provided in the foregoing embodiments. The video coding adaptation apparatus, equipment, and computer provided above can be configured to execute the video coding adaptation method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
本申请实施例还提供一种存储计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时配置为执行如上述实施例提供的视频编码适配方法。当然,本申请实施例所提供的一种存储计算机可执行指令的存储介质,其计算机可执行指令不限于如上提供的视频编码适配方法,还可以执行本申请任意实施例所提供的视频编码适配方法中的相关操作。上述实施例中提供的视频编码适配装置、设备及存储介质可执行本申请任意实施例所提供的视频编码适配方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的视频编码适配方法。The embodiment of the present application further provides a storage medium storing computer-executable instructions, and the computer-executable instructions are configured to execute the video coding adaptation method provided in the foregoing embodiments when executed by a computer processor. Of course, for a storage medium storing computer-executable instructions provided in the embodiments of the present application, the computer-executable instructions are not limited to the video coding adaptation method provided above, and may also execute the video coding adaptation method provided in any embodiment of the present application. Related operations in the recipe method. The video coding adaptation device, equipment, and storage medium provided in the above-mentioned embodiments can execute the video coding adaptation method provided in any embodiment of the present application. For technical details not described in detail in the above-mentioned embodiments, please refer to any implementation of the application. The video coding adaptation method provided by the example.
在一些可能的实施方式中,本公开提供的方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当上述程序产品在计算机设备上运行时,上述程序代码配置为使上述计算机设备执行本说明书上述描述的根据本公开各种示例性实施方式的方法中的步骤,例如,上述计算机设备可以执行本公开实施例所记载的实时手势检测方法。
In some possible implementations, various aspects of the methods provided in the present disclosure can also be implemented in the form of a program product, which includes program code. When the above program product is run on a computer device, the above program code is configured to make the above The computer device executes the steps in the methods described above in this specification according to various exemplary embodiments of the present disclosure. For example, the above computer device may execute the real-time gesture detection method described in the embodiments of the present disclosure.
Claims (11)
- 一种视频编码适配方法,应用于视频编码适配设备,其中,包括:A video encoding adaptation method applied to a video encoding adaptation device, including:根据设备类型信息向服务器发送质量查询请求,以查询所述服务器是否保存有所述设备类型信息对应的硬编码质量信息;Sending a quality query request to the server according to the device type information, to query whether the server stores hard-coded quality information corresponding to the device type information;基于所述服务器返回的质量查询结果确定从所述服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息;Determine to obtain hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;根据所述硬编码质量信息确定视频编码方式。Determine the video encoding mode according to the hard-coded quality information.
- 根据权利要求1所述的视频编码适配方法,其中,所述基于所述服务器返回的质量查询结果确定从所述服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息,包括:The video coding adaptation method according to claim 1, wherein the hard-coded quality information is determined to be obtained from the server based on the quality query result returned by the server, or hard-coded quality information is obtained by performing hard-coded quality detection according to a test video file. Quality information, including:响应于所述服务器返回查询成功的质量查询结果,从所述服务器获取查询到的硬编码质量信息;In response to the server returning a successful quality query result, acquiring the queried hard-coded quality information from the server;响应于所述服务器返回查询失败的质量查询结果,从所述服务器获取测试视频文件,并对所述测试视频文件进行硬编码质量检测得到硬编码质量信息。In response to the server returning a quality query result of query failure, a test video file is obtained from the server, and hard-coded quality detection is performed on the test video file to obtain hard-coded quality information.
- 根据权利要求2所述的视频编码适配方法,其中,所述对所述测试视频文件进行硬编码质量检测得到硬编码质量信息,包括:The video coding adaptation method according to claim 2, wherein said performing hard-coded quality detection on said test video file to obtain hard-coded quality information comprises:按照硬编码方式对所述测试视频文件进行编码得到视频编码结果;Encoding the test video file in a hard-coded manner to obtain a video encoding result;根据所述视频编码结果计算对所述测试视频文件进行硬编码的硬编码质量信息。Hard-coded quality information for hard-coding the test video file is calculated according to the video coding result.
- 根据权利要求2所述的视频编码适配方法,其中,所述对所述测试视频文件进行硬编码质量检测得到硬编码质量信息之后,还包括:The video coding adaptation method according to claim 2, wherein, after performing hard-coded quality detection on the test video file to obtain hard-coded quality information, further comprising:基于所述设备类型信息将所述硬编码质量信息保存至所述服务器。The hardcoded quality information is saved to the server based on the device type information.
- 根据权利要求1-4任一项所述的视频编码适配方法,其中,所述根据所述硬编码质量信息确定视频编码方式,包括:The video coding adaptation method according to any one of claims 1-4, wherein said determining a video coding method according to said hard-coded quality information includes:将所述硬编码质量信息与编码质量阈值进行比较;comparing said hard-coded quality information with a coding quality threshold;响应于所述硬编码质量信息达到所述编码质量阈值的比较结果,确定视频编码方式为硬编码方式;In response to the comparison result that the hard-coded quality information reaches the coding quality threshold, determine that the video coding mode is a hard-coded mode;响应于所述硬编码质量信息未达到所述编码质量阈值的比较结果,确定视频编码方式为软编码方式。In response to the comparison result that the hard coding quality information does not reach the coding quality threshold, it is determined that the video coding mode is a soft coding mode.
- 根据权利要求1-4任一项所述的视频编码适配方法,其中,所述根据设备类型信息向服务器发送质量查询请求之前,还包括:The video coding adaptation method according to any one of claims 1-4, wherein, before sending the quality query request to the server according to the device type information, further comprising:确定本地是否保存有硬编码质量信息; Determine whether there is hard-coded quality information saved locally;响应于本地保存有硬编码质量信息,确定直接根据所述硬编码质量信息确定视频编码方式;In response to the hard-coded quality information stored locally, determine to directly determine the video encoding method according to the hard-coded quality information;响应于本地未保存有硬编码质量信息,确定根据设备类型信息向服务器发送质量查询请求。In response to the fact that the hard-coded quality information is not stored locally, it is determined to send a quality query request to the server according to the device type information.
- 根据权利要求1-4任一项所述的视频编码适配方法,其中,所述硬编码质量信息为峰值信噪比、结构相似性和视频多方法评估融合中的一种或多种的组合。The video coding adaptation method according to any one of claims 1-4, wherein the hard-coded quality information is a combination of one or more of peak signal-to-noise ratio, structural similarity, and video multi-method evaluation fusion .
- 一种视频编码适配装置,其中,包括质量查询模块、信息获取模块和编码适配模块,其中:A video coding adaptation device, which includes a quality query module, an information acquisition module, and a coding adaptation module, wherein:所述质量查询模块,配置为根据设备类型信息向服务器发送质量查询请求,以查询所述服务器是否保存有所述设备类型信息对应的硬编码质量信息;The quality query module is configured to send a quality query request to the server according to the device type information, so as to query whether the server stores hard-coded quality information corresponding to the device type information;所述信息获取模块,配置为基于所述服务器返回的质量查询结果确定从所述服务器获取硬编码质量信息,或根据测试视频文件进行硬编码质量检测得到硬编码质量信息;The information acquisition module is configured to determine to obtain hard-coded quality information from the server based on the quality query result returned by the server, or perform hard-coded quality detection according to the test video file to obtain the hard-coded quality information;所述编码适配模块,配置为根据所述硬编码质量信息确定视频编码方式。The encoding adaptation module is configured to determine a video encoding method according to the hard-coded quality information.
- 一种视频编码适配设备,其中,包括:存储器以及一个或多个处理器;A video coding adaptation device, including: a memory and one or more processors;所述存储器,配置为存储一个或多个程序;the memory configured to store one or more programs;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7任一项所述的视频编码适配方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the video coding adaptation method according to any one of claims 1-7.
- 一种存储计算机可执行指令的存储介质,其中,所述计算机可执行指令在由计算机处理器执行时配置为执行如权利要求1-7任一项所述的视频编码适配方法。A storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the video coding adaptation method according to any one of claims 1-7 when executed by a computer processor.
- 一种计算机程序产品,包括计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1-14任一项所述的视频编码适配方法。 A computer program product, including a computer program, wherein, when the computer program is executed by a processor, the video coding adaptation method according to any one of claims 1-14 is implemented.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210214074.XA CN114501017A (en) | 2022-03-04 | 2022-03-04 | Video coding adaptation method, device, equipment and storage medium |
CN202210214074.X | 2022-03-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023165590A1 true WO2023165590A1 (en) | 2023-09-07 |
Family
ID=81486901
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/079478 WO2023165590A1 (en) | 2022-03-04 | 2023-03-03 | Video coding adaptation method and apparatus, device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114501017A (en) |
WO (1) | WO2023165590A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114501017A (en) * | 2022-03-04 | 2022-05-13 | 百果园技术(新加坡)有限公司 | Video coding adaptation method, device, equipment and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140146895A1 (en) * | 2012-11-28 | 2014-05-29 | Cisco Technology, Inc. | Fast Switching Hybrid Video Decoder |
CN104159113A (en) * | 2014-06-30 | 2014-11-19 | 北京奇艺世纪科技有限公司 | Method and device for selecting video coding mode for Android system |
CN106331765A (en) * | 2015-06-30 | 2017-01-11 | 腾讯科技(深圳)有限公司 | Hardware decoding test method, terminal and server |
CN106375789A (en) * | 2016-09-05 | 2017-02-01 | 腾讯科技(深圳)有限公司 | Media live broadcast method and device |
CN107948660A (en) * | 2017-11-16 | 2018-04-20 | 北京小米移动软件有限公司 | The method and device of Video coding adaptation |
CN107948683A (en) * | 2017-11-28 | 2018-04-20 | 北京潘达互娱科技有限公司 | Network direct broadcasting media stream compatibility method, network main broadcaster end and client |
US20180227606A1 (en) * | 2011-11-18 | 2018-08-09 | At&T Intellectual Property I, L.P. | System and Method for Automatically Selecting Encoding/Decoding for Streaming Media |
CN110198427A (en) * | 2018-07-05 | 2019-09-03 | 腾讯科技(深圳)有限公司 | Video call method and device |
CN110740313A (en) * | 2019-10-25 | 2020-01-31 | 腾讯科技(深圳)有限公司 | Hardware coding capability detection method and device |
CN111385563A (en) * | 2018-12-29 | 2020-07-07 | 广州市百果园信息技术有限公司 | Hardware encoder detection method and device and terminal |
CN112003976A (en) * | 2020-07-31 | 2020-11-27 | 北京达佳互联信息技术有限公司 | Hard-coding and hard-decoding test method and device |
CN112840663A (en) * | 2018-12-13 | 2021-05-25 | 深圳市欢太科技有限公司 | Video coding method and device, electronic equipment and storage medium |
CN114501017A (en) * | 2022-03-04 | 2022-05-13 | 百果园技术(新加坡)有限公司 | Video coding adaptation method, device, equipment and storage medium |
-
2022
- 2022-03-04 CN CN202210214074.XA patent/CN114501017A/en active Pending
-
2023
- 2023-03-03 WO PCT/CN2023/079478 patent/WO2023165590A1/en unknown
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180227606A1 (en) * | 2011-11-18 | 2018-08-09 | At&T Intellectual Property I, L.P. | System and Method for Automatically Selecting Encoding/Decoding for Streaming Media |
US20140146895A1 (en) * | 2012-11-28 | 2014-05-29 | Cisco Technology, Inc. | Fast Switching Hybrid Video Decoder |
CN104159113A (en) * | 2014-06-30 | 2014-11-19 | 北京奇艺世纪科技有限公司 | Method and device for selecting video coding mode for Android system |
CN106331765A (en) * | 2015-06-30 | 2017-01-11 | 腾讯科技(深圳)有限公司 | Hardware decoding test method, terminal and server |
CN106375789A (en) * | 2016-09-05 | 2017-02-01 | 腾讯科技(深圳)有限公司 | Media live broadcast method and device |
CN107948660A (en) * | 2017-11-16 | 2018-04-20 | 北京小米移动软件有限公司 | The method and device of Video coding adaptation |
CN107948683A (en) * | 2017-11-28 | 2018-04-20 | 北京潘达互娱科技有限公司 | Network direct broadcasting media stream compatibility method, network main broadcaster end and client |
CN110198427A (en) * | 2018-07-05 | 2019-09-03 | 腾讯科技(深圳)有限公司 | Video call method and device |
CN112840663A (en) * | 2018-12-13 | 2021-05-25 | 深圳市欢太科技有限公司 | Video coding method and device, electronic equipment and storage medium |
CN111385563A (en) * | 2018-12-29 | 2020-07-07 | 广州市百果园信息技术有限公司 | Hardware encoder detection method and device and terminal |
CN110740313A (en) * | 2019-10-25 | 2020-01-31 | 腾讯科技(深圳)有限公司 | Hardware coding capability detection method and device |
CN112003976A (en) * | 2020-07-31 | 2020-11-27 | 北京达佳互联信息技术有限公司 | Hard-coding and hard-decoding test method and device |
CN114501017A (en) * | 2022-03-04 | 2022-05-13 | 百果园技术(新加坡)有限公司 | Video coding adaptation method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114501017A (en) | 2022-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10282246B2 (en) | Application error detection method for cloud streaming service, and apparatus and system therefor | |
WO2023165590A1 (en) | Video coding adaptation method and apparatus, device, and storage medium | |
KR20180105675A (en) | Method, apparatus, and system for synchronizing data | |
WO2018077266A1 (en) | Breakpoint-resume transmission method and device for surveillance video | |
US9594552B2 (en) | Terminal device, information processing system, request target selection method and program | |
US9100460B2 (en) | Media stream fragment request | |
CN109413186B (en) | Application program updating method, terminal, server and system | |
CN111436004B (en) | Video playing method, device and equipment and computer readable storage medium | |
JP2019009774A (en) | Loss data compression method, data compression method, and data compression system | |
JP6314252B2 (en) | Network video playback method and apparatus | |
WO2013071747A1 (en) | Method and apparatus for obtaining file | |
CN110662017B (en) | Video playing quality detection method and device | |
CN105138376A (en) | Mixed model application, webpage resource upgrading method thereof, mobile terminal and system | |
US11284140B2 (en) | Machine learning techniques for determining quality of user experience | |
CN111669577A (en) | Hardware decoding detection method and device, electronic equipment and storage medium | |
CN104053015A (en) | Media data transmitting method and virtual desktop server | |
JP2016076766A (en) | Information processing apparatus and information processing method | |
CN111263162B (en) | Video compression method, device, equipment and storage medium | |
CN113810773B (en) | Video downloading method and device, electronic equipment and storage medium | |
WO2018032696A1 (en) | Method and system for desktop screenshot control | |
CN117119201B (en) | Compressed video transmission method, device, equipment and storage medium | |
US11395002B2 (en) | Prediction direction selection method and apparatus in image encoding, and storage medium | |
US8812584B2 (en) | Moving picture file transmitting server and method of controlling operation of same | |
CN108134957A (en) | A kind of throwing screen method, terminal and computer storage media | |
CN116842205A (en) | Game playback method, device and storage medium |
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: 23762988 Country of ref document: EP Kind code of ref document: A1 |