Video processing method and device, storage medium and program product
By pre-detecting and storing hardware decoding capabilities, and directly querying and creating suitable hardware decoders, the problem of video decoding in the prior art is solved, and the decoding efficiency and playback speed are improved.
Patent Information
- Application Number
- CN202310953366.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, when playing or editing videos, different hardware decoders need to be tried one by one, resulting in the problem of long-term decoding and slow video playback.
By detecting the hardware decoding capabilities of the hardware environment in advance and storing the detection results, directly querying whether the hardware decoding conditions of the video are met when decoding the video. If so, create a corresponding hardware decoder for decoding.
Improves video decoding efficiency and avoids lags caused by attempting various hardware or excessive playback initialization time.
Smart Images

Figure CN119450081A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer and network communication technology, and in particular, to a video processing method, device, storage medium, and program product. Background Art
[0002] There are various video encoding formats involved in the process of playing or editing videos. Different devices have different hardware decoding capabilities for different encoding formats.
[0003] In the related art, it is usually necessary to try different hardware decoders one by one to perform hardware decoding on the video.
[0004] However, the inventors have discovered that there are at least the following technical problems in the related art: the above method is likely to cause the decoding to take a long time and the video to start playing slowly. Summary of the invention
[0005] The embodiments of the present disclosure provide a video processing method, device, storage medium and program product to improve decoding efficiency and avoid freezing or long playback initialization time caused by trying various hardware.
[0006] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0007] Obtaining a hardware decoding capability detection result; the hardware decoding capability detection result includes hardware decoding capability possessed by at least one callable hardware;
[0008] Acquire a video to be processed, and determine a hardware decoding condition for the video to be processed;
[0009] If the hardware decoding capability detection result indicates that the hardware decoding condition is met, a corresponding hardware decoder is created according to the hardware decoding condition, and hardware decoding is performed on the video to be processed based on the hardware decoder.
[0010] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0011] An acquisition module is configured to acquire a hardware decoding capability detection result; the hardware decoding capability detection result includes a hardware decoding capability possessed by at least one hardware that can be called;
[0012] The acquisition module is further used to acquire the video to be processed and determine the hardware decoding condition of the video to be processed;
[0013] A decoding module is used to create a corresponding hardware decoder according to the hardware decoding condition if the hardware decoding capability detection result indicates that the hardware decoding condition is met, and perform hardware decoding on the video to be processed based on the hardware decoder.
[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0015] The memory stores computer-executable instructions;
[0016] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method as described in the first aspect and various possible designs of the first aspect.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible designs of the first aspect.
[0019] The video processing method, device, storage medium and program product provided by the present embodiment include obtaining a hardware decoding capability detection result, the hardware decoding capability detection result includes the hardware decoding capability possessed by at least one hardware that can be called, obtaining a video to be processed, and determining the hardware decoding condition of the video to be processed. If the hardware decoding capability detection result indicates that the hardware decoding condition is met, a corresponding hardware decoder is created according to the hardware decoding condition, and hardware decoding is performed on the video to be processed based on the hardware decoder. The video processing method provided by the present embodiment detects the hardware decoding capability of the hardware environment in advance and stores the hardware decoding capability detection result, so that when hardware decoding of the video to be processed is required, it is possible to directly query whether the detection result meets the hardware decoding condition of the video to be processed, thereby improving the decoding efficiency and avoiding the situation where freezes or the playback initialization takes too long due to trying various hardware. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present disclosure 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 some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0021] Figure 1 A schematic diagram of an application scenario of the video processing method provided by an embodiment of the present disclosure;
[0022] Figure 2 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 1 ;
[0023] Figure 3 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 2 ;
[0024] Figure 4 A structural block diagram of a video processing device provided in an embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of the hardware structure of a video processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0027] Hardware decoding is the decoding of videos through hardware. Hardware decoding is performed by hardware such as the Graphics Processing Unit (GPU). Using GPU decoding can reduce the workload of the Central Processing Unit (CPU) and reduce power consumption. This is the traditional solution of using the CPU to perform decoding work. The advantages are high efficiency, low power consumption, and low thermal power consumption.
[0028] Different hardware can support different encoding formats. Various video encoding formats are involved in the playback or editing process. Therefore, when a device is used to play or edit a video of a certain encoding format, it is necessary to traverse and try the GPU and other hardware in the device to find the hardware that can support the encoding format and create a decoder. This process is time-consuming and leads to slow playback.
[0029] In order to solve the above technical problems, the inventors of the present application have found that the hardware decoding capabilities of each hardware of the device can be detected and stored in advance, so that when the video needs to be decoded, it can be directly read and compared with the hardware decoding conditions of the video, thereby avoiding the situation where the video is stuck or the initialization of the playback takes too long due to trying various hardware. Based on this, the embodiment of the present application provides a video processing method.
[0030] refer to Figure 1 , Figure 1Schematic diagram of an application scenario of the video processing method provided in an embodiment of the present disclosure. The terminal device includes a plurality of hardware (GPU1, GPU2, application-specific integrated circuit (ASIC) etc.) that can be used for hardware decoding, and the terminal device is installed with an application for video processing, such as a video editing application for performing video editing processing.
[0031] In the specific implementation process, when the application is started or the video is imported into the application, it indicates that the video needs to be decoded, then the terminal device can obtain the hardware decoding capability detection result, and parse the video to be processed to determine the hardware decoding condition corresponding to the video to be processed. Based on the hardware decoding condition, it is queried in the hardware decoding capability detection result whether there is hardware that meets the hardware decoding condition. If so, a decoder can be created based on the corresponding hardware, and the video to be processed can be hardware decoded based on the decoder. The video processing method provided by the embodiment of the present disclosure detects the hardware decoding capability of the hardware environment in advance, and stores the hardware decoding capability detection result, so that when the video to be processed needs to be hardware decoded, it is possible to directly query whether the detection result meets the hardware decoding condition of the video to be processed, thereby improving the decoding efficiency and avoiding the situation where freezes or the playback initialization takes too long due to trying various hardware.
[0032] refer to Figure 2 , Figure 2 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 1 The method of this embodiment can be applied in a terminal device or a server. The video processing method includes:
[0033] 201. Obtain a hardware decoding capability detection result; the hardware decoding capability detection result includes hardware decoding capability possessed by at least one callable hardware.
[0034] 202. Obtain a video to be processed, and determine a hardware decoding condition for the video to be processed.
[0035] 203. If the hardware decoding capability detection result indicates that the hardware decoding condition is met, create a corresponding hardware decoder according to the hardware decoding condition, and perform hardware decoding on the to-be-processed video based on the hardware decoder.
[0036] Specifically, when the device needs to decode the video (for example, when the video is edited through a video editing application installed on the terminal device and the decoding of the video is involved), the pre-stored hardware decoding capability detection result can be read first to find out which encoding formats can be supported by the GPU and other hardware that can be used for hardware decoding in the device, so as to match the hardware decoding conditions required for the imported video to be processed. If the match is successful, it indicates that the device can perform hardware decoding on the video to be processed. If the match is unsuccessful, the video to be processed can be decoded by software decoding.
[0037] The pre-stored hardware decoding capability detection result may be obtained and stored by detecting the device, or may be obtained and stored by detecting other devices of the same model. The hardware decoding capability detection result may be stored locally on the device in the form of a cache file, or may be stored in a cloud server.
[0038] The hardware decoding capability detection result may include the hardware decoding capabilities corresponding to different hardware, for example, hardware 1 supports encoding formats 1 and 2, where encoding format 1 corresponds to maximum resolution 1, encoding format 2 corresponds to maximum resolution 2, hardware 2 supports encoding format 3, encoding format 3 corresponds to maximum resolution 3, etc. Accordingly, by parsing the video to be processed, its corresponding hardware decoding conditions may be obtained, and the hardware decoding conditions may include the encoding format, pixel format, and resolution adopted by the video to be processed.
[0039] The callable hardware may be hardware in a terminal device, such as GPU1, GPU2, an Application-Specific Integrated Circuit (ASIC), and the like.
[0040] From the above description, it can be seen that the video processing method provided by the embodiment of the present disclosure detects the hardware decoding capability of the hardware environment in advance and stores the hardware decoding capability detection results, so that when it is necessary to perform hardware decoding on the video to be processed, it is possible to directly query whether the detection result meets the hardware decoding conditions of the video to be processed, thereby improving the decoding efficiency and avoiding the situation where freezes or long playback initialization time are consumed due to trying various hardware.
[0041] In one embodiment of the present disclosure, considering that the hardware and software environment of the device may change, such as system version upgrade, driver version upgrade, hardware changes from available state to unavailable state, etc., the hardware decoding capability also changes. Therefore, when the change is detected, the hardware decoding capability needs to be updated in time. Based on this, before step 201 obtains the hardware decoding capability detection result, it can also include: if the environment of at least one of the callable hardware changes, and there is a pre-stored hardware decoding capability detection result in the preset storage space, and the corresponding environment information changes, then the hardware decoding capability of at least one of the callable hardware is re-detected, and the hardware decoding capability detection result is updated.
[0042] The environment includes hardware status, system version, driver version, etc.
[0043] refer to Figure 3 , Figure 3 The video processing method provided by the embodiment of the present disclosure is shown in FIG. Figure 2 Considering that there may be a situation where the hardware decoding capability of the hardware in the device has not been detected, in this case, the hardware decoding capability of one or more hardware in the device that can be used for hardware decoding can be detected first, and the detection result can be saved for subsequent direct call. Specifically, the method includes:
[0044] 301. An application for video processing is started.
[0045] Specifically, in response to an application start instruction from a user, a video processing application installed on the device is started.
[0046] 302. Determine whether there is a hardware decoding capability detection result in the preset storage space. If yes, execute step 304; if not, execute step 303.
[0047] Specifically, the startup of the application indicates that the video needs to be processed, so before acquiring the video, the hardware decoding capability detection result corresponding to the device can be searched in a preset storage space (local or cloud).
[0048] 303. Detect the hardware decoding capability of at least one callable hardware, obtain a hardware decoding capability detection result, and store the hardware decoding capability detection result in a preset storage space.
[0049] Specifically, if the corresponding hardware decoding capability cannot be found, the hardware decoding capability of one or more hardware components that can be used for hardware decoding in the device may be detected.
[0050] In some embodiments, considering that the hardware decoding conditions mainly need to meet the requirements of encoding format, pixel format, and maximum resolution, therefore, in this embodiment, the hardware decoding capability of at least one callable hardware is detected to obtain the hardware decoding capability detection result, which may include: for each hardware in the at least one callable hardware, detecting and obtaining the decoder type supported by the hardware, and determining the pixel format and / or maximum resolution supported by different decoder types.
[0051] Specifically, first, the hardware that can be used for hardware encoding can be found in the device, such as a GPU, an ASIC dedicated to hardware decoding, etc. Then, the hardware decoding capability can be tested for each hardware.
[0052] In one embodiment of the present disclosure, determining the pixel formats and maximum resolutions respectively supported by different decoder types may include: for each decoder type supported by the hardware, detecting and obtaining the pixel formats supported by the decoder type; for each pixel format among the pixel formats supported by the decoder type, obtaining the decoder configuration item corresponding to the decoder type, and creating decoders based on multiple resolutions respectively according to the decoder configuration items, and determining the maximum resolution supported by the decoder from the multiple resolutions based on the creation results.
[0053] Exemplarily, the hardware decoding capability of GPU1 can be tested first to test whether GPU1 supports the specified encoding format, such as the H264 encoding format. If supported, further test whether it supports the specified pixel format, such as YUYV. If supported, further test what the maximum resolution that can be supported is. When testing the maximum resolution, a resolution range can be limited, such as 8K to 2K, and tested from high to low. For example, 6K is not supported before, and it can be supported only when it is lower than 6K, so the maximum resolution is positioned at 6K. And so on, test whether the H265 encoding format is supported, until the specified multiple encoding formats are traversed and tested. The hardware decoding capability of GPU1 can be obtained, and then it can be written into the cache file.
[0054] In one embodiment of the present disclosure, detecting the hardware decoding capability of at least one callable hardware to obtain the hardware decoding capability detection result may include: detecting the hardware decoding capability of at least one callable hardware through a preset application programming interface API to obtain the hardware decoding capability detection result.
[0055] Specifically, the device's operating system's native API can be used, for example, for a device running Windows operating system, the Direct3D11 API or DXVA2 API can be used to complete the test. The hardware driver's API can also be used, for example, the CUDA API or oneAPI can be used.
[0056] In one embodiment of the present disclosure, considering that different APIs have different detection capabilities and detection ranges, in order to perform a more comprehensive and accurate detection of the hardware decoding capability of the hardware, multiple methods can be used for detection, and the detection results can be merged to obtain the final hardware decoding capability detection result. Specifically, through a preset application programming interface API, the hardware decoding capability of at least one hardware that can be called is detected to obtain a hardware decoding capability detection result, which can include: through an operating system API, the hardware decoding capability of at least one hardware that can be called is detected to obtain a first detection result; through a driver API, the hardware decoding capability of at least one hardware that can be called is detected to obtain a second detection result; according to the first detection result and the second detection result, the hardware decoding capability detection result is determined.
[0057] For example, taking a device running Windows operating system as an example, the following four methods can be used to detect the hardware decoding capability.
[0058] The first method is the Direct3D11 detection method. Specifically, first, you can create a d3d11device corresponding to the GPU, and use ID3D11Device->GetFeatureLevel() to get the d3d11 level supported by the current GPU device. If it is less than 11.0, the environment does not support d3d11 hard decoding; secondly, you can use ID3D11VideoDevice->GetVideoDecoderProfileCount() and ID3D11VideoDevice->GetVideoDecoderProfile() to get the supported decoders, and for each decoder, use ID3D11Device->CheckFormatSuppor() and ID3D11VideoDevice->CheckVideoDecoderFormat() to determine whether the specified pixel format is supported; thirdly, if supported, use ID3D11VideoDevice->GetVideoDecoderConfigCoun() and ID3D11VideoDevice->GetVideoDecoderConfig() to get the configuration items of the specified decoder, and select the non-encrypted decoder id and configuration config. Finally, you can set the resolution from 8K->2K, and try to create a decoder through ID3D11VideoDevice->CreateVideoDecoder() according to the decoder id, config and resolution from high to low, and record it if the creation is successful.
[0059] The second method is the DXVA2 detection method. Using the DXVA2 API, you can use the same detection ideas as the first method. I will not go into details here.
[0060] The third method is the CUDA detection method. First, you can use cuDeviceGetCount to get the number of NVIDIA GPU devices on the current system. Second, you can use cuCtxCreate to create a context for the GPU you want to detect. Third, you can use cuvidGetDecoderCaps to detect the expected decoder capabilities. During the detection process, you can fill in the corresponding detection data, such as the specified encoding format, pixel format, etc.
[0061] The fourth method is to detect Intel hardware. You can use oneAPI or MediaSDK. Specifically, you can create a corresponding session for the Intel GPU you want to detect, and then fill in the capabilities you want to detect, and query through MFXVideoDECODE_Query to get the actual supported results.
[0062] After the above four detection methods are completed, the detection results of the four methods can be combined to obtain the most comprehensive and accurate hardware decoding capability detection result.
[0063] 304. Obtain a pre-stored hardware decoding capability detection result; the hardware decoding capability detection result includes hardware decoding capability of at least one callable hardware.
[0064] Specifically, if the pre-stored hardware decoding capability corresponding to the device can be found, the decoding capability detection result is read locally or downloaded and read from the cloud. In response to the user's video import operation, the video to be processed is obtained and the hardware decoding conditions of the video to be processed are determined (for example, encoding format (H264\H265\MPEG2\VC1\AV1, etc.), pixel format (RGB, NV12, NV2, I420, YV12, YUYV, etc.), resolution, etc.), and the hardware decoding conditions are matched with the hardware decoding capability detection result. If the match is successful, a hardware decoder can be created to perform hardware decoding on the video to be processed.
[0065] 305. Obtain a video to be processed, and determine a hardware decoding condition for the video to be processed.
[0066] 306. Determine whether the hardware decoding condition is met based on the hardware decoding capability detection result. If yes, execute step 307; if no, perform software decoding on the video to be processed.
[0067] 307. Create a corresponding hardware decoder according to the hardware decoding condition, and perform hardware decoding on the to-be-processed video based on the hardware decoder.
[0068] Specifically, after obtaining the video to be processed, the video to be processed can be parsed to determine the encoding format, pixel format, resolution and other information of the video to be processed, and then determine the corresponding hardware decoding conditions. After determining the hardware decoding conditions, it can be queried in the obtained hardware decoding capability detection results whether there is hardware with corresponding hardware decoding capabilities that can meet the hardware decoding conditions. If there is corresponding hardware, a decoder can be created through the hardware based on the hardware decoding conditions, and hardware decoding can be performed on the video to be processed based on the decoder. If there is no corresponding hardware, software decoding can be used to perform software decoding on the video to be processed.
[0069] From the above description, it can be seen that the video processing method provided by the embodiment of the present disclosure pre-detects the hardware decoding capability of the hardware environment, and stores the hardware decoding capability detection results, so that when it is necessary to perform hardware decoding on the video to be processed, it is possible to directly query whether the detection result meets the hardware decoding conditions of the video to be processed, thereby improving the decoding efficiency and avoiding the situation where freezes or long playback initialization time are consumed due to trying various hardware.
[0070] Corresponding to the video processing method of the above embodiment, Figure 4 The structure block diagram of the video processing device provided by the embodiment of the present disclosure. For the convenience of explanation, only the part related to the embodiment of the present disclosure is shown. Figure 4 , the device includes: an acquisition module 401 and a decoding module 402.
[0071] The acquisition module 401 is provided with a function of acquiring a hardware decoding capability detection result; the hardware decoding capability detection result includes a hardware decoding capability possessed by at least one hardware that can be called;
[0072] The acquisition module 401 is further used to acquire the video to be processed and determine the hardware decoding condition of the video to be processed;
[0073] The decoding module 402 is configured to create a corresponding hardware decoder according to the hardware decoding condition if the hardware decoding capability detection result indicates that the hardware decoding condition is met, and perform hardware decoding on the video to be processed based on the hardware decoder.
[0074] In one embodiment of the present disclosure, the acquisition module 401 is also used to: if there is no pre-stored hardware decoding capability detection result in the preset storage space, then the hardware decoding capability of at least one callable hardware is detected to obtain the hardware decoding capability detection result, and the hardware decoding capability detection result is stored in the preset storage space.
[0075] In one embodiment of the present disclosure, the acquisition module 401 is further specifically used to: for each hardware of at least one callable hardware, detect and obtain the decoder type supported by the hardware, and determine the pixel format and / or maximum resolution supported by different decoder types.
[0076] In one embodiment of the present disclosure, the acquisition module 401 is further specifically used to: for each decoder type supported by the hardware, detect and obtain the pixel format supported by the decoder type; for each pixel format supported by the decoder type, obtain the decoder configuration item corresponding to the decoder type, and create decoders based on multiple resolutions according to the decoder configuration items, and based on the creation results, determine the maximum resolution supported by the decoder from the multiple resolutions.
[0077] In one embodiment of the present disclosure, the acquisition module 401 is further specifically used to: detect the hardware decoding capability of at least one callable hardware through a preset application programming interface API to obtain a hardware decoding capability detection result.
[0078] In one embodiment of the present disclosure, the acquisition module 401 is also specifically used to: detect the hardware decoding capability of at least one callable hardware through the operating system API to obtain a first detection result; detect the hardware decoding capability of at least one callable hardware through the driver API to obtain a second detection result; determine the hardware decoding capability detection result based on the first detection result and the second detection result.
[0079] In one embodiment of the present disclosure, the acquisition module 401 is also used for: if the environment in which the at least one callable hardware is located changes, and there is a pre-stored hardware decoding capability detection result in the preset storage space, and the corresponding environmental information changes, then the hardware decoding capability of the at least one callable hardware is re-detected, and the hardware decoding capability detection result is updated.
[0080] In one embodiment of the present disclosure, the acquisition module 401 is specifically used to: obtain the hardware decoding capability detection result in response to a startup instruction of a video processing application; the video processing application is used to process the video to be processed.
[0081] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0082] In order to implement the above embodiment, the embodiment of the present disclosure also provides an electronic device.
[0083] refer to Figure 5, which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure, and the electronic device 500 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0084] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 to a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0085] Typically, the following devices may be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication devices 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0086] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0087] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0089] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0090] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0091] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0092] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0093] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0094] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0095] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0096] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0097] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A video processing method, characterized in that: include: Get the hardware decoding capability test results; The hardware decoding capability detection result includes the hardware decoding capability possessed by at least one callable hardware; Acquire a video to be processed, and determine a hardware decoding condition for the video to be processed; If the hardware decoding capability detection result indicates that the hardware decoding condition is met, a corresponding hardware decoder is created according to the hardware decoding condition, and hardware decoding is performed on the video to be processed based on the hardware decoder.
2. The method according to claim 1, characterized in that Before obtaining the hardware decoding capability detection result, the method further includes: If there is no pre-stored hardware decoding capability detection result in the preset storage space, the hardware decoding capability of at least one callable hardware is detected to obtain the hardware decoding capability detection result, and the hardware decoding capability detection result is stored in the preset storage space.
3. The method according to claim 2, characterized in that The detecting of the hardware decoding capability of at least one callable hardware to obtain the hardware decoding capability detection result includes: For each hardware of at least one callable hardware, a decoder type supported by the hardware is detected and obtained, and pixel formats and / or maximum resolutions respectively supported by different decoder types are determined.
4. The method according to claim 3, characterized in that The determining of the pixel formats and maximum resolutions supported by different decoder types includes: For each decoder type supported by the hardware, detecting and obtaining a pixel format supported by the decoder type; For each pixel format supported by the decoder type, a decoder configuration item corresponding to the decoder type is obtained, and according to the decoder configuration item, decoders are created based on multiple resolutions respectively, and based on the creation result, the maximum resolution supported by the decoder is determined from the multiple resolutions.
5. The method according to claim 3, characterized in that: The detecting of the hardware decoding capability of at least one callable hardware to obtain the hardware decoding capability detection result includes: Through a preset application programming interface API, the hardware decoding capability of at least one callable hardware is detected to obtain a hardware decoding capability detection result.
6. The method according to claim 5, characterized in that The method of detecting the hardware decoding capability of at least one hardware that can be called through a preset application programming interface API to obtain a hardware decoding capability detection result includes: Through the operating system API, the hardware decoding capability of at least one hardware that can be called is detected to obtain a first detection result; Through the driver API, the hardware decoding capability of at least one callable hardware is detected to obtain a second detection result; A hardware decoding capability detection result is determined according to the first detection result and the second detection result.
7. The method according to any one of claims 1 to 6, characterized in that: Before obtaining the hardware decoding capability detection result, the method further includes: If the environment in which at least one of the callable hardware is located changes, and there is a pre-stored hardware decoding capability detection result in the preset storage space, and the corresponding environmental information changes, the hardware decoding capability of at least one of the callable hardware is re-detected and the hardware decoding capability detection result is updated.
8. The method according to any one of claims 1 to 6, characterized in that: Applied to a terminal device, the terminal device is installed with a video processing application, the video processing application is a video editing application, and the at least one callable hardware is hardware in the terminal device.
9. The method according to claim 8, characterized in that The obtaining of the hardware decoding capability detection result includes: In response to a startup instruction of a video processing application, a hardware decoding capability detection result is obtained; the video processing application is used to process the video to be processed.
10. A video processing device, characterized in that: include: An acquisition module is provided for acquiring a hardware decoding capability detection result; the hardware decoding capability detection result includes a hardware decoding capability possessed by at least one hardware that can be called; The acquisition module is further used to acquire the video to be processed and determine the hardware decoding condition of the video to be processed; A decoding module is used to create a corresponding hardware decoder according to the hardware decoding condition if the hardware decoding capability detection result indicates that the hardware decoding condition is met, and perform hardware decoding on the video to be processed based on the hardware decoder.
11. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the video processing method according to any one of claims 1 to 9 is implemented.