Video processing method and device, equipment and storage medium

By obtaining and matching the decoding rules and supporting parameters of the hardware decoding device, and selecting optimized decoding rules for video decoding, the problem of low decoding efficiency in the existing technology is solved, and more efficient video decoding processing is achieved.

CN118555403APending Publication Date: 2024-08-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310208955.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In the existing technology, when a terminal device decodes video encoded data, it needs to perform statistical analysis on multiple decoding rules, resulting in low processing efficiency and thus affecting video decoding efficiency.

Method used

Obtain the video decoding rules supported by the hardware decoding device through the query interface provided by the operating system, and use the query interface provided by the driver to obtain the decoding support parameters under the target decoding rules, and match the decoding support parameters and video encoding parameters to select optimized decoding rules. to decode.

Benefits of technology

It improves video decoding efficiency, simplifies the processing process, and can quickly determine whether the decoding device supports the target decoding rules, thereby improving decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555403A
    Figure CN118555403A
Patent Text Reader

Abstract

The invention discloses a video processing method and device, equipment and a storage medium, which can be used for scenes such as cloud technology and can be used for video transmission scenes in data transmission. The method comprises the following steps: acquiring video coding data to be decoded; acquiring a video decoding rule supported by the hardware decoding equipment through a first query interface provided in an operating system of terminal equipment to which the hardware decoding equipment belongs; under the condition that the video decoding rule comprises the target decoding rule, obtaining a decoding support parameter of the hardware decoding equipment under the target decoding rule through a second query interface provided by a driving program of the hardware decoding equipment; and when the decoding support parameter is matched with a video coding parameter corresponding to the video coding data, calling hardware decoding equipment to perform video decoding processing on the video coding data based on the target decoding rule to obtain a decoded video. Whether the video decoding equipment supports decoding based on the target decoding rule can be quickly judged, the processing flow is simple and efficient, and the video decoding efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a video processing method, apparatus, device and storage medium. Background Art

[0002] In the relevant scenarios of video transmission, it is usually necessary to encode the video to be transmitted to obtain the corresponding video encoding data. After receiving the video encoding data, the terminal device can decode the video encoding data to obtain the decoded video and play it. In the prior art, after obtaining the video encoding data, the terminal device usually performs statistical analysis on the decoding results of the historically obtained video encoding data based on the hardware decoding device of the terminal device to determine whether the hardware decoding device supports decoding the video encoding data to be decoded based on a certain decoding rule. In the process of determining whether the video decoding device supports decoding the video encoding data to be decoded based on a certain decoding rule, a large amount of data is processed, resulting in low processing efficiency, which in turn leads to low video decoding efficiency. Summary of the invention

[0003] The embodiments of the present application provide a video processing method, apparatus, device, storage medium and computer program product, which can quickly determine whether a video decoding device supports decoding of video encoding data based on target decoding rules. The processing flow is simple and efficient, thereby improving video decoding efficiency.

[0004] On the one hand, an embodiment of the present application provides a video processing method, including:

[0005] Obtaining video encoding data to be decoded;

[0006] Obtaining video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in an operating system of a terminal device to which the hardware decoding device belongs;

[0007] In the case where the video decoding rules supported by the hardware decoding device include a target decoding rule, a decoding support parameter of the hardware decoding device under the target decoding rule is obtained through a second query interface; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted;

[0008] When the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

[0009] On the one hand, an embodiment of the present application provides a video processing device, including:

[0010] An acquisition unit, used for acquiring video encoding data to be decoded;

[0011] A processing unit, configured to obtain video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in an operating system of a terminal device to which the hardware decoding device belongs;

[0012] The processing unit is further configured to obtain, through a second query interface, decoding support parameters of the hardware decoding device under the target decoding rule when the video decoding rule supported by the hardware decoding device includes the target decoding rule; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted;

[0013] The processing unit is also used to call the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data.

[0014] On the one hand, an embodiment of the present application provides a terminal device, characterized in that the terminal device includes an input interface and an output interface, and further includes:

[0015] a processor adapted to implement one or more instructions; and,

[0016] A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned video processing method.

[0017] On the one hand, an embodiment of the present application provides a computer storage medium, characterized in that computer program instructions are stored in the computer storage medium, and when the computer program instructions are executed by a processor, they are used to execute the above-mentioned video processing method.

[0018] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a terminal device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the terminal device executes the above-mentioned video processing method.

[0019] In an embodiment of the present application, after obtaining the video encoding data to be decoded, the video decoding rules supported by the hardware decoding device corresponding to the terminal device can be obtained through the first query interface provided in the operating system of the terminal device; and when the video decoding rules supported by the hardware decoding device include the target decoding rules, the decoding support parameters of the hardware decoding device under the target decoding rules are obtained through the second query interface provided by the driver of the hardware decoding device; when the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video. Among them, the target decoding rule can be a video decoding rule with a better decoding effect. By preferentially detecting the video decoding rule with a better decoding effect, the better video decoding rule can be preferentially selected to decode the video encoding data to achieve a better decoding effect; through the first query interface and the second query interface, it can be quickly determined whether the video decoding device supports decoding the video encoding data based on the target decoding rule, and the processing flow is simple and efficient, thereby improving the video decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a structural diagram of a video processing system provided in an embodiment of the present application;

[0022] Figure 2 It is a flowchart of a video processing method provided by an embodiment of the present application;

[0023] Figure 3 is a flowchart of another video processing method provided in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of video decoding provided by an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of another video decoding provided by an embodiment of the present application;

[0026] Figure 6 is a schematic diagram of another video decoding provided by an embodiment of the present application;

[0027] Figure 7is a schematic diagram of another video decoding provided by an embodiment of the present application;

[0028] Figure 8 is a schematic diagram of another video decoding provided by an embodiment of the present application;

[0029] Fig. 9 is a schematic diagram of another video decoding provided by an embodiment of the present application;

[0030] Fig.10 is a structural diagram of a video processing device provided in an embodiment of the present application;

[0031] Fig.11 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] The embodiment of the present application provides a video processing solution, which can obtain the video decoding rules supported by the hardware decoding device corresponding to the terminal device through the first query interface provided in the operating system of the terminal device after obtaining the video encoding data to be decoded; and when the video decoding rules supported by the hardware decoding device include the target decoding rules, obtain the decoding support parameters of the hardware decoding device under the target decoding rules through the second query interface provided by the driver of the hardware decoding device; when the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data, call the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video. Wherein, the target decoding rule is determined from a plurality of preset decoding rules, and the decoding effect when the target decoding rule is adopted is better than the decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted.

[0034] Based on the above video processing solution, the embodiment of the present application provides a video processing system. Figure 1 , is a structural diagram of a video processing system provided in an embodiment of the present application. Figure 1The video processing system shown may include a terminal device 101, a video server 102, and a hardware decoding device 103. The terminal device 101 may include any one or more of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart car-mounted device, and a smart wearable device, and the processing core of the terminal device 101 is usually a central processing unit CPU. The video server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The hardware decoding device 103 may be any electronic device that can implement hardware decoding, and the processing core of the hardware decoding device 103 is usually a graphics processor GPU. For example, the hardware decoding device 103 may be a graphics card. The terminal device 101 and the video server 102, and the terminal device 101 and the hardware decoding device 103 may be directly or indirectly connected in communication via wired or wireless communication, and this application is not limited here.

[0035] In one embodiment, a target application may be running in the terminal device 101, and the target application may be an application that can support video decoding and playback, for example, the target application may be a video playback application, an instant messaging application, a social application, a game application, etc.; the video server 102 is a server corresponding to the target application, and may provide service support for the target application. In one embodiment, during the operation of the target application, if the object requests to play the target video, the terminal device 101 may send a video playback request for the target video to the video server 102; after receiving the video playback request, the video server 102 may perform video encoding processing on the target video to obtain corresponding video encoding data, and then may send the video encoding data to the terminal device 101. After receiving the video encoding data, the terminal device 101 can obtain the video decoding rules supported by the hardware decoding device 103 through the first query interface provided in the operating system of the terminal device 101; and when the video decoding rules supported by the hardware decoding device 103 include the target decoding rules, the second query interface provided by the driver of the hardware decoding device 103 is used to obtain the decoding support parameters of the hardware decoding device 103 under the target decoding rules; when the decoding support parameters of the hardware decoding device 103 under the target decoding rules match the video encoding parameters corresponding to the video encoding data, the hardware decoding device 103 is called to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video. Further, the terminal device 101 can play and display the decoded video. Further, the processing process of the terminal device 101 can all be implemented based on the target application; the above video processing scheme can also support scenarios of video streaming transmission, such as video instant messaging scenarios, cloud gaming scenarios, and the like.

[0036] It is particularly important to note that in the specific implementation of this application, object-related data is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with local laws, regulations and standards.

[0037] Based on the above video processing solution, the present application embodiment provides a video processing method. Figure 2 , is a flow chart of a video processing method provided in an embodiment of the present application. Figure 2 The video processing method shown can be collaboratively executed by a terminal device, a video server, and a hardware decoding device. Figure 2 The video processing method shown may include the following steps:

[0038] S201, obtaining video encoding data to be decoded.

[0039] In one embodiment, the video encoding data can be obtained by the video server performing video encoding processing on the target video. In an application scenario, if the target application is a video playback application, during the operation of the target application, if the object requests to play the target video online, the corresponding video server can perform video encoding processing and transmission on the target video based on the video stream transmission method. Then, at the current moment, the video encoding data obtained by the terminal device may not be the video encoding data used to decode the complete target video; that is, in this scenario, the video server can encode and transmit the target video in real time, and the terminal device can decode and play it in real time to achieve online playback of the target video. In another application scenario, if the target application is a cloud game application, the video server can be the cloud game server corresponding to the cloud game application; cloud games are a game method based on cloud computing, which puts logical operations such as logical calculations and screen rendering that should be performed in the terminal device in the cloud (i.e., the cloud game server). The cloud game server can perform logical operations such as logical calculation and screen rendering according to the real-time operation feedback generated by the object in the cloud game application running in the terminal device, obtain the game screen, perform video encoding processing on the game screen, obtain video encoding data, and transmit the video encoding data to the terminal device; after receiving the video encoding data, the terminal device can perform video decoding processing on the video encoding data, and then display the decoded game screen; in this scenario, since the game screen of the cloud game application is obtained by decoding the video encoding data received in real time, the game screen obtained by the cloud game server performing logical operations such as logical calculation and screen rendering during the operation of the cloud game application can be used as a target video screen, that is, the game screen generated from the startup to the shutdown of the cloud game application can be used as a target video screen.

[0040] S202: Obtain video decoding rules supported by the hardware decoding device through a first query interface.

[0041] Among them, the first query interface is a query interface provided in the operating system of the terminal device to which the hardware decoding device belongs. Further, the operating system of the terminal device is integrated with relevant data of video decoding rules supported by hardware decoding devices produced by different hardware manufacturers, and the data can be obtained by calling the first query interface provided by the operating system of the terminal device. The video decoding rules supported by the hardware decoding device can indicate the video decoding methods supported by the hardware decoding device. In one embodiment, when the operating system of the terminal device is a Windows operating system, the first query interface can be a query interface based on DXVA (DirectX Video Acceleration, video hardware acceleration specification), wherein DXVA is a decoder interface specification, DXVA defines the hardware decoding capabilities under different video encoding rules, and in the DXVA specification, the hardware decoding capabilities of different hardware decoding devices are different. By integrating the relevant data of the hardware decoding capabilities of the hardware decoding devices produced by different hardware manufacturers, including the supported video decoding rules, into the operating system, it is possible to query the hardware decoding rules supported by different hardware decoding devices through the query interface based on DXVA, so that the hardware decoding rules supported by different hardware decoding devices can be more easily obtained.

[0042] S203: When the video decoding rules supported by the hardware decoding device include the target decoding rule, obtain decoding support parameters of the hardware decoding device under the target decoding rule through a second query interface.

[0043] Among them, the second query interface is a query interface provided by the driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and the decoding effect when the target decoding rule is used is better than the decoding effect when other preset decoding rules in the plurality of preset decoding rules are used. Further, the preset decoding rules include video decoding rules commonly used in the current video decoding field, for example, video decoding rules of the H.265 standard, video decoding rules of the H.264 standard, video decoding rules of the MPEG-2 standard, and the like; further, the target decoding rule may be a video decoding rule with a better decoding effect, and the video decoding rule with a better decoding effect is preferentially detected in order to preferentially use a better video decoding rule to decode the video encoding data to achieve a better decoding effect; further optionally, the target decoding rule may also be set by the technical developer of the target application, so that the terminal device running the target application can preferentially decode the acquired video encoding data based on the target decoding rule to obtain a better decoding effect. The decoding effect here may include but is not limited to the improvement of one or more effects in the decoding speed, decoding accuracy, video quality, resolution, frame rate, etc. of the decoded video obtained by decoding. The embodiments of the present application are subsequently explained using the target decoding rules as the video decoding rules of the H.265 standard as an example; wherein, the H.265 standard is based on the video coding standard H.264, retaining some of the original technologies while improving some related technologies; it can improve the relationship between bit stream, coding quality, delay and algorithm complexity to achieve the optimal setting, and its specific research content may include: improving compression efficiency, improving robustness and error recovery capability, reducing real-time delay, reducing channel acquisition time and random access delay, reducing complexity, etc.; when the video decoding rules of the H.265 standard are adopted, a better decoding effect can be achieved.

[0044] In one embodiment, the driver of the hardware decoding device integrates the decoding support parameters under the video decoding rules supported by the hardware decoding device, and the decoding support parameters under any video decoding rule are used to indicate: the maximum hardware decoding capability of the hardware decoding device under the corresponding video decoding rule; the second query interface is the query interface provided by the driver of the hardware decoding device, that is, the native API interface (Application Programming Interface) provided by the driver of the hardware decoding device, and the decoding support parameters of the hardware decoding device under the corresponding video decoding rule can be obtained by calling the native API interface. Further, the decoding support parameters under any video decoding rule may include parameters such as resolution and frame rate; for example, if the resolution in the decoding support parameters under the video decoding rule is 2K, it means that the hardware decoding device can support decoding at a maximum resolution of 2K when decoding using the video decoding rule, that is, the decoding resolution supports up to 2K; if the frame rate in the decoding support parameters under the video decoding rule is 60fps, it means that the hardware decoding device can support decoding at a maximum frame rate of 60fps when decoding using the video decoding rule, that is, the decoding frame rate supports up to 60fps. Although relevant data on the hardware decoding capabilities of hardware decoding devices produced by different hardware manufacturers, including supported video decoding rules, can be obtained through the first query interface provided in the operating system of the terminal device; however, the relevant data on the integrated hardware decoding capabilities usually do not include decoding support parameters such as maximum resolution and maximum frame rate. Therefore, when the video decoding rules supported by the hardware decoding device include target decoding rules, it is necessary to further obtain the decoding support parameters of the hardware decoding device under the target decoding rules through the second query interface provided by the driver of the hardware decoding device, so as to obtain the maximum decoding capability of the hardware decoding device under the target decoding rules, so as to make up for the shortcomings of the method of obtaining the video decoding capability through the first query interface and improve the detection accuracy of the video decoding capability of the video decoding device.

[0045] S204, when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

[0046] In one embodiment, when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is considered to have the ability to perform video decoding processing on the video decoding data based on the target decoding rule, so the terminal device can call the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video. In the process of the terminal device calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, the hardware decoding device can create a video decoder for performing video decoding processing on the video encoding data.

[0047] In an embodiment of the present application, after obtaining the video encoding data to be decoded, the video decoding rules supported by the hardware decoding device corresponding to the terminal device can be obtained through the first query interface provided in the operating system of the terminal device; and when the video decoding rules supported by the hardware decoding device include the target decoding rules, the decoding support parameters of the hardware decoding device under the target decoding rules are obtained through the second query interface provided by the driver of the hardware decoding device; when the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video. Among them, the target decoding rule can be a video decoding rule with a better decoding effect. By preferentially detecting the video decoding rule with a better decoding effect, the better video decoding rule can be preferentially selected to decode the video encoding data to achieve a better decoding effect; through the first query interface and the second query interface, it can be quickly determined whether the video decoding device supports decoding the video encoding data based on the target decoding rule, and the processing flow is simple and efficient, thereby improving the video decoding efficiency.

[0048] Based on the above-mentioned related embodiments of the video processing method, the present application embodiment provides another video processing method. Figure 3 , which is a flow chart of another video processing method provided in an embodiment of the present application. Figure 3 The video processing method shown can be collaboratively executed by a terminal device, a video server, and a hardware decoding device. Figure 3 The video processing method shown may include the following steps:

[0049] S301, obtaining video encoding data to be decoded.

[0050] S302: Obtain video decoding rules supported by the hardware decoding device through a first query interface.

[0051] The first query interface is a query interface provided in the operating system of the terminal device to which the hardware decoding device belongs.

[0052] S303: When the video decoding rules supported by the hardware decoding device include the target decoding rules, obtain decoding support parameters of the hardware decoding device under the target decoding rules through a second query interface.

[0053] Among them, the second query interface is a query interface provided by the driver of the hardware decoding device, the target decoding rule is determined from multiple preset decoding rules, and the decoding effect when using the target decoding rule is better than the decoding effect when using other preset decoding rules among the multiple preset decoding rules.

[0054] S304, when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

[0055] In one embodiment, the relevant process of step S301 to step S304 is similar to the relevant process of step S201 to step S204 described above, and will not be repeated here. Before executing step S304, the terminal device may also obtain the video encoding parameters corresponding to the video encoding data; if the resolution in the decoding support parameters of the hardware decoding device under the target decoding rule is greater than or equal to the resolution in the video encoding parameters, and the frame rate in the decoding support parameters of the hardware decoding device under the target decoding rule is greater than or equal to the frame rate in the video encoding parameters, then it is determined that the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data; otherwise, it is determined that the decoding support parameters of the hardware decoding device under the target decoding rule do not match the video encoding parameters corresponding to the video encoding data. The resolution and frame rate in the video encoding parameters corresponding to the video encoding data may be the resolution and frame rate used by the video server when performing video encoding processing on the target video, and may be transmitted to the terminal device together when transmitting the video encoding data.

[0056] S305, when the video decoding rules supported by the hardware decoding device do not include the target decoding rules, or when the decoding support parameters of the hardware decoding device under the target decoding rules do not match the video encoding parameters corresponding to the video encoding data, determine a backup decoding rule from the video decoding rules supported by the hardware decoding device.

[0057] S306, calling a hardware decoding device to perform video decoding processing on the video encoding data based on a backup decoding rule to obtain a decoded video.

[0058] In one embodiment, the backup decoding rule may be a video decoding rule supported by hardware decoding devices produced by most hardware manufacturers, so as to implement a fallback processing when the hardware decoding device cannot perform decoding based on the target decoding rule; optionally, the backup decoding rule may also be set by a technical developer of the target application; optionally, the backup decoding rule may also be selected based on the decoding effect corresponding to the video decoding rule supported by the hardware decoding device, and the video decoding rule with better decoding effect may be preferentially selected as the backup decoding rule. Further optionally, after determining the backup decoding rule, the terminal device may also obtain the decoding support parameters of the hardware decoding device under the backup decoding rule through the second query interface, and only when the decoding support parameters of the hardware decoding device under the backup decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule; otherwise, a new backup decoding rule may be determined from the video decoding rules supported by the hardware decoding device, and it may be determined whether the video encoding data can be video decoded based on the new backup decoding rule, until the new backup decoding rule determined is the video decoding rule adopted for the fallback processing, and the video encoding data is video decoded based on the video processing rule; in the subsequent embodiments of the present application, the target decoding rule is the video decoding rule of the H.265 standard, and the backup decoding rule is the video decoding rule of the H.264 standard adopted for the fallback processing as an example for explanation.

[0059] See also Figure 4 , is a schematic diagram of a video decoding provided by an embodiment of the present application. After obtaining the video encoding data to be decoded, the terminal device can detect the video decoding rules supported by the hardware decoding device through the first query interface, and determine whether the video decoding rules supported by the hardware decoding device include the target decoding rules; if the target decoding rules are included, the decoding support parameters of the hardware decoding device under the target decoding rules are detected through the second query interface, and determine whether the decoding support parameters match the video encoding parameters corresponding to the video encoding data; if the video encoding parameters corresponding to the video encoding data match, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video; if the video encoding parameters corresponding to the video encoding data do not match, a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain a decoded video; if the target decoding rule is not included, a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain a decoded video.

[0060] In one embodiment, during the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rule, the terminal device can also detect whether there is a decoding error; if there is no decoding error, the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rule continues to be executed; if there is a decoding error, the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rule ends, and a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video coding data based on the backup decoding rule to obtain a decoded video. Optionally, during the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rule, it can be detected whether a black screen will appear on the display device in the terminal device when the decoded video currently decoded is played and displayed. If a black screen appears, it is considered that there is a decoding error, and if no black screen appears, it is considered that there is no decoding error.

[0061] See also Figure 5 , is a schematic diagram of another video decoding provided by an embodiment of the present application. After obtaining the video encoding data to be decoded, the terminal device can detect the video decoding rules supported by the hardware decoding device through the first query interface, and determine whether the video decoding rules supported by the hardware decoding device include the target decoding rules; if the target decoding rules are not included, the standby decoding rules are determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the standby decoding rules; if the target decoding rules are included, the decoding support parameters of the hardware decoding device under the target decoding rules are detected through the second query interface, and it is determined whether the decoding support parameters match the video encoding parameters corresponding to the video encoding data. If the video encoding parameters corresponding to the video encoding data do not match, the standby decoding rules are determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the standby decoding rules; if the video encoding parameters corresponding to the video encoding data match, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rules, and a decoding error detection is performed. If there is no decoding error, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules continues; if there is a decoding error, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules ends, and a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain a decoded video.

[0062] In one embodiment, when the terminal device is in the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rules, if no decoding error is detected, that is, if there is no decoding error, it can be detected whether there is decoding jamming; if there is no decoding jamming, the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rules is continued; if there is decoding jamming, the process of calling the hardware decoding device to perform video decoding processing on the video coding data based on the target decoding rules is terminated, and a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video coding data based on the backup decoding rule to obtain a decoded video; the video decoding process can be performed by Figure 6 Optionally, in the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, it can be detected whether the display device in the terminal device will have playback jams when playing the decoded video obtained by the current decoding. If playback jams occur, it is considered that there is decoding jams, and if there are no playback jams, it is considered that there are no decoding jams; wherein, the storage of decoding jams can be considered to be insufficient decoding performance of the hardware decoding device.

[0063] In one embodiment, when the terminal device calls the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, if the decoding jam is detected, a prompt message indicating the decoding jam can be sent to the video server, so that the video server performs video encoding processing on the target video again after receiving the prompt message, and returns the obtained new video encoding data to the terminal device; after receiving the new video encoding data, the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the target decoding rule to obtain a decoded video; the video decoding process can be performed by Figure 7 As shown. Optionally, when the video server performs video encoding processing on the target video again, it can adopt smaller video encoding parameters than the last time the target video was encoded. That is, it can adopt a smaller frame rate and / or a smaller resolution than the last time the target video was encoded, to perform video encoding processing on the target video again, so as to reduce the possibility of decoding jams in the new video encoding data. Furthermore, in the scenario of video streaming transmission, the video server performs video encoding processing on the target video again, which can be a video encoding processing of the unencoded video part of the target video based on the new video encoding parameters, so as to ensure the continuity of video playback in the terminal device.

[0064] In one embodiment, during the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule, the terminal device may also check whether there is a decoding jam; if there is no decoding jam, the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule continues to be executed; if there is a decoding jam, the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule is terminated, and a backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the backup decoding rule to obtain a decoded video; the video decoding process may be performed by Figure 8 Optionally, if there is a decoding jam, a prompt message indicating the decoding jam can be sent to the video server again, so that the video server can perform video encoding processing on the target video again after receiving the prompt message, and return the obtained new video encoding data to the terminal device; until the terminal device detects the jam during the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule, there is no decoding jam.

[0065] In one embodiment, when the terminal device calls the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, if a decoding error or a decoding jam is detected, the terminal device can feedback the decoding error or the decoding jam to the video server so that the video server can record the relevant situation; that is, when there is a decoding error, feedback information of the decoding error can be sent to the video server so that the video server can record the decoding error, and specifically can record one or more information such as the device identification of the hardware decoding device where the decoding error occurs, decoding support parameters, the time when the decoding error occurs, the video identification of the target video, etc.; when there is a decoding jam, feedback information of the decoding jam can be sent to the video server so that the video server can record the decoding jam, and specifically can record one or more information such as the device identification of the hardware decoding device where the decoding jam occurs, decoding support parameters, the time when the decoding jam occurs, the video identification of the target video, etc. Based on this, before calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules, the terminal device can also obtain an error decoding device list from the video server; the error decoding device list includes: the device identification of the error hardware decoding device in the process of performing video decoding processing on the video encoding data based on the target decoding rules, that is, the device identification of the hardware decoding device for the target video decoding error; if the device identification of the hardware decoding device corresponding to the terminal device is not found in the error decoding device list, the operation of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules to obtain the decoded video is executed; if the device identification of the hardware decoding device corresponding to the terminal device is found in the error decoding device list, the backup decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain the decoded video; the video decoding process can be performed by Fig. 9 Shown.

[0066] In one embodiment, if there are multiple hardware decoding devices corresponding to the terminal device, for example, when the terminal device is connected to multiple graphics cards, after obtaining the video encoding data to be decoded, the terminal device can obtain the video decoding rules supported by each hardware decoding device through the first query interface provided in the operating system of the terminal device, and use the hardware decoding device whose supported hardware decoding rules include the target decoding rule as the first hardware decoding device; obtain the decoding support parameters of each first hardware decoding device under the target decoding rule through the second query interface provided by the driver of each first hardware decoding device, and use the first hardware decoding device whose decoding support parameters match the video encoding parameters corresponding to the video encoding data as the second hardware decoding device; and then determine a target hardware decoding device from the second hardware decoding devices, and call the target hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video. Optionally, when determining a target hardware decoding device from the second hardware decoding devices, it can be determined randomly, or the second hardware decoding device that is in an idle state or has a low processing resource consumption ratio can be preferentially determined as the target hardware decoding device. Further optionally, when in the process of calling the target hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules, in case it is necessary to switch to the backup decoding rules to perform video decoding processing on the video encoding data, for example, if a decoding error is detected; the terminal device can also determine a new target hardware decoding device from the remaining second hardware decoding devices, and call the new target hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules.

[0067] In the embodiment of the present application, after obtaining the video encoding data to be decoded, the terminal device can preferentially detect whether the hardware decoding device supports the video decoding processing of the video encoding data based on the target decoding rule with better decoding effect, so that the hardware decoding device can preferentially select the better target decoding rule to achieve better decoding effect, which can well meet the video transmission scenarios requiring high resolution, high frame rate and low latency, such as cloud games; when the target decoding rule selects the video decoding rule of the H.265 standard, the coverage rate of the video decoding rule of the H.265 standard can be improved. Moreover, through the first query interface and the second query interface, it can be quickly determined whether the video decoding device supports decoding the video encoding data based on the target decoding rule, and the processing flow is simple and efficient, thereby improving the efficiency of video decoding. Furthermore, in the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules, the terminal device can also detect whether there is a decoding error or decoding jamming, and take corresponding solution measures when there is a decoding error or decoding jamming. For example, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rules can be terminated, and a backup decoding rule can be determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device can be called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain a decoded video; it can well cope with the occurrence of decoding errors and decoding jamming, reduce the possibility of decoding failure, improve the object usage experience, and call the hardware decoding device to perform video decoding processing on the video encoding data based on the backup decoding rule to reduce the bandwidth usage cost.

[0068] Based on the above-mentioned embodiments related to the video processing method, the present application embodiment provides a video processing device. Fig.10 , is a structural diagram of a video processing device provided in an embodiment of the present application, and the video processing device may include an acquisition unit 1001 and a processing unit 1002. Fig.10 The video processing apparatus shown can be used to perform the following operations:

[0069] The acquisition unit 1001 is used to acquire the video encoding data to be decoded;

[0070] The processing unit 1002 is used to obtain the video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in the operating system of the terminal device to which the hardware decoding device belongs;

[0071] The processing unit 1002 is further configured to obtain, through a second query interface, a decoding support parameter of the hardware decoding device under the target decoding rule when the video decoding rule supported by the hardware decoding device includes the target decoding rule; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted;

[0072] The processing unit 1002 is also used to call the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data.

[0073] In one embodiment, the decoding support parameters of the hardware decoding device under the target decoding rule include: resolution and frame rate;

[0074] The acquisition unit 1001 is also used to acquire video encoding parameters corresponding to the video encoding data;

[0075] If the resolution of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the resolution in the video encoding parameters, and the frame rate of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the frame rate in the video encoding parameters, the processing unit 1002 determines that the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data.

[0076] In one embodiment, the processing unit 1002 is further configured to:

[0077] When the video decoding rules supported by the hardware decoding device do not include the target decoding rule, or when the decoding support parameters of the hardware decoding device under the target decoding rule do not match the video encoding parameters corresponding to the video encoding data, determining a backup decoding rule from the video decoding rules supported by the hardware decoding device;

[0078] The hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain the decoded video.

[0079] In one embodiment, the processing unit 1002 is further configured to:

[0080] In the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, detecting whether there is a decoding error;

[0081] If there is no decoding error, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule;

[0082] If a decoding error occurs, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

[0083] In one embodiment, the processing unit 1002 is further configured to:

[0084] If there is no decoding error, check whether there is decoding jam;

[0085] If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule;

[0086] If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

[0087] In one embodiment, the video encoding data is obtained by performing video encoding processing on the target video by the video server;

[0088] The processing unit 1002 is further configured to:

[0089] If there is a decoding jam, a prompt message indicating the decoding jam is sent to the video server, so that the video server performs video encoding processing on the target video again after receiving the prompt message, and returns the obtained new video encoding data to the terminal device;

[0090] After receiving the new video encoding data, the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the target decoding rule to obtain the decoded video.

[0091] In one embodiment, the processing unit 1002 is further configured to:

[0092] In the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule, checking whether there is a decoding freeze;

[0093] If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule;

[0094] If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the alternative decoding rule to obtain the decoded video.

[0095] In one embodiment, the acquisition unit 1001 is further used to acquire an error decoding device list from the video server; the error decoding device list includes: device identifiers of error hardware decoding devices that have decoding errors during the process of performing video decoding processing on the video encoding data based on the target decoding rule;

[0096] If the device identifier of the hardware decoding device is not found in the erroneous decoding device list, the processing unit 1002 executes the operation of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

[0097] According to one embodiment of the present application, Figure 2 as well as Figure 3 The various steps involved in the video processing method shown can be performed by Fig.10 The video processing device shown in the figure is executed by each unit. For example, Figure 2 Step S201 shown can be performed by Fig.10 The acquisition unit 1001 in the video processing device shown in the figure is used to execute, Figure 2 Steps S202 to S204 shown in FIG. Fig.10 The processing unit 1002 in the video processing device shown in the figure is used for execution. Figure 3 Step S301 shown can be performed by Fig.10 The acquisition unit 1001 in the video processing device shown in the figure is used to execute, Figure 3 Steps S302 to S306 shown in FIG. Fig.10 The processing unit 1002 in the video processing device shown is executed.

[0098] According to another embodiment of the present application, Fig.10 The various units in the video processing device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can also be split into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. For example, the functions implemented by the above-mentioned various units can be implemented by one processing unit. In other embodiments of the present application, the video processing device based on logical function division can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0099] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 as well as Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Fig.10 The video processing device shown in the embodiment of the present application is used to implement the video processing method of the embodiment of the present application. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.

[0100] In an embodiment of the present application, after obtaining the video encoding data to be decoded, the video decoding rules supported by the hardware decoding device corresponding to the terminal device can be obtained through the first query interface provided in the operating system of the terminal device; and when the video decoding rules supported by the hardware decoding device include the target decoding rules, the decoding support parameters of the hardware decoding device under the target decoding rules are obtained through the second query interface provided by the driver of the hardware decoding device; when the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rules to obtain a decoded video. Among them, the target decoding rule can be a video decoding rule with a better decoding effect. By preferentially detecting the video decoding rule with a better decoding effect, the better video decoding rule can be preferentially selected to decode the video encoding data to achieve a better decoding effect; through the first query interface and the second query interface, it can be quickly determined whether the video decoding device supports decoding the video encoding data based on the target decoding rule, and the processing flow is simple and efficient, thereby improving the video decoding efficiency.

[0101] Based on the above-mentioned video processing method and video processing device embodiments, the present application also provides a terminal device. Fig.11 , is a structural diagram of a terminal device provided in an embodiment of the present application. Fig.11 The terminal device shown may include at least a processor 1101, an input interface 1102, an output interface 1103, and a computer storage medium 1104. The processor 1101, the input interface 1102, the output interface 1103, and the computer storage medium 1104 may be connected via a bus or other means.

[0102] The computer storage medium 1104 may be stored in the memory of the terminal device, and the computer storage medium 1104 is used to store a computer program, and the computer program includes program instructions, and the processor 1101 is used to execute the program instructions stored in the computer storage medium 1104. The processor 1101 (or CPU (Central Processing Unit)) is the computing core and control core of the terminal device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the above-mentioned video processing method flow or corresponding functions.

[0103] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer storage medium here can include both the built-in storage medium in the terminal and the extended storage medium supported by the terminal. The computer storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor 1101 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed random access memory (RAM) memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0104] In one embodiment, the processor 1101 may load and execute one or more instructions stored in a computer storage medium to implement the above-mentioned Figure 2 as well as Figure 3 In the corresponding steps of the method in the video processing method embodiment, in a specific implementation, one or more instructions in the computer storage medium are loaded by the processor 1101 and execute the following steps:

[0105] Obtaining video encoding data to be decoded;

[0106] Obtaining video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in an operating system of a terminal device to which the hardware decoding device belongs;

[0107] In the case where the video decoding rules supported by the hardware decoding device include a target decoding rule, a decoding support parameter of the hardware decoding device under the target decoding rule is obtained through a second query interface; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted;

[0108] When the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

[0109] In one embodiment, the decoding support parameters of the hardware decoding device under the target decoding rule include: resolution and frame rate;

[0110] The processor 1101 is further configured to:

[0111] Obtaining video encoding parameters corresponding to the video encoding data;

[0112] If the resolution of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the resolution in the video encoding parameters, and the frame rate of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the frame rate in the video encoding parameters, then it is determined that the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data.

[0113] In one embodiment, the processor 1101 is further configured to:

[0114] When the video decoding rules supported by the hardware decoding device do not include the target decoding rule, or when the decoding support parameters of the hardware decoding device under the target decoding rule do not match the video encoding parameters corresponding to the video encoding data, determining a backup decoding rule from the video decoding rules supported by the hardware decoding device;

[0115] The hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain the decoded video.

[0116] In one embodiment, the processor 1101 is further configured to:

[0117] In the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, detecting whether there is a decoding error;

[0118] If there is no decoding error, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule;

[0119] If a decoding error occurs, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

[0120] In one embodiment, the processor 1101 is further configured to:

[0121] If there is no decoding error, check whether there is decoding jam;

[0122] If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule;

[0123] If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

[0124] In one embodiment, the video encoding data is obtained by performing video encoding processing on the target video by the video server;

[0125] The processor 1101 is further configured to:

[0126] If there is a decoding freeze, a prompt message indicating the decoding freeze is sent to the video server, so that the video server performs video encoding processing on the target video again after receiving the prompt message, and returns the obtained new video encoding data to the terminal device;

[0127] After receiving the new video encoding data, the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the target decoding rule to obtain the decoded video.

[0128] In one embodiment, the processor 1101 is further configured to:

[0129] In the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule, checking whether there is a decoding freeze;

[0130] If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule;

[0131] If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the alternative decoding rule to obtain the decoded video.

[0132] In one embodiment, the processor 1101 is further configured to:

[0133] Acquire an error decoding device list from the video server; the error decoding device list includes: device identifiers of error hardware decoding devices that have decoding errors during the process of performing video decoding processing on the video encoding data based on the target decoding rule;

[0134] If the device identification of the hardware decoding device is not found in the erroneous decoding device list, the operation of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video is executed.

[0135] The present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a terminal device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the terminal device performs the above-mentioned Figure 2 as well as Figure 3 The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A video processing method, characterized in that: include: Obtaining video encoding data to be decoded; Obtaining video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in an operating system of a terminal device to which the hardware decoding device belongs; In the case where the video decoding rules supported by the hardware decoding device include a target decoding rule, a decoding support parameter of the hardware decoding device under the target decoding rule is obtained through a second query interface; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted; When the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data, the hardware decoding device is called to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video.

2. The method according to claim 1, characterized in that The decoding support parameters of the hardware decoding device under the target decoding rule include: resolution and frame rate; The method further comprises: Obtaining video encoding parameters corresponding to the video encoding data; If the resolution of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the resolution in the video encoding parameters, and the frame rate of the decoding support parameters of the hardware decoding device under the target decoding rules is greater than or equal to the frame rate in the video encoding parameters, then it is determined that the decoding support parameters of the hardware decoding device under the target decoding rules match the video encoding parameters corresponding to the video encoding data.

3. The method according to claim 1, characterized in that The method further comprises: When the video decoding rules supported by the hardware decoding device do not include the target decoding rule, or when the decoding support parameters of the hardware decoding device under the target decoding rule do not match the video encoding parameters corresponding to the video encoding data, determining a backup decoding rule from the video decoding rules supported by the hardware decoding device; The hardware decoding device is called to perform video decoding processing on the video encoding data based on the backup decoding rule to obtain the decoded video.

4. The method according to claim 1, characterized in that The method further comprises: In the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule, detecting whether there is a decoding error; If there is no decoding error, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule; If a decoding error occurs, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

5. The method according to claim 4, characterized in that The method further comprises: If there is no decoding error, check whether there is decoding jam; If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule; If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the video encoding data based on the alternative decoding rule to obtain the decoded video.

6. The method according to claim 5, characterized in that The video encoding data is obtained by performing video encoding processing on the target video by the video server; The method further comprises: If there is a decoding freeze, a prompt message indicating the decoding freeze is sent to the video server, so that the video server performs video encoding processing on the target video again after receiving the prompt message, and returns the obtained new video encoding data to the terminal device; After receiving the new video encoding data, the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the target decoding rule to obtain the decoded video.

7. The method according to claim 6, characterized in that The method further comprises: In the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule, checking whether there is a decoding freeze; If there is no decoding freeze, continue to execute the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule; If there is a decoding freeze, the process of calling the hardware decoding device to perform video decoding processing on the new video encoding data based on the target decoding rule is terminated, and an alternative decoding rule is determined from the video decoding rules supported by the hardware decoding device, and the hardware decoding device is called to perform video decoding processing on the new video encoding data based on the alternative decoding rule to obtain the decoded video.

8. The method according to claim 1, characterized in that The method further comprises: Acquire an error decoding device list from the video server; the error decoding device list includes: device identifiers of error hardware decoding devices that have decoding errors during the process of performing video decoding processing on the video encoding data based on the target decoding rule; If the device identification of the hardware decoding device is not found in the erroneous decoding device list, the operation of calling the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video is executed.

9. A video processing device, characterized in that: include: An acquisition unit, used for acquiring video encoding data to be decoded; A processing unit, configured to obtain video decoding rules supported by the hardware decoding device through a first query interface; the first query interface is a query interface provided in an operating system of a terminal device to which the hardware decoding device belongs; The processing unit is further configured to obtain, through a second query interface, decoding support parameters of the hardware decoding device under the target decoding rule when the video decoding rule supported by the hardware decoding device includes the target decoding rule; the second query interface is a query interface provided by a driver of the hardware decoding device, the target decoding rule is determined from a plurality of preset decoding rules, and a decoding effect when the target decoding rule is adopted is better than a decoding effect when other preset decoding rules among the plurality of preset decoding rules are adopted; The processing unit is also used to call the hardware decoding device to perform video decoding processing on the video encoding data based on the target decoding rule to obtain a decoded video when the decoding support parameters of the hardware decoding device under the target decoding rule match the video encoding parameters corresponding to the video encoding data.

10. A terminal device, characterized in that: The terminal device includes an input interface and an output interface, and also includes: a processor adapted to implement one or more instructions; and, A computer storage medium storing one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the video processing method according to any one of claims 1 to 8.

11. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute the video processing method according to any one of claims 1 to 8.