CN114125432A - Video data processing method, device, equipment and storage medium - Google Patents

Video data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114125432A
CN114125432A CN202111388460.2A CN202111388460A CN114125432A CN 114125432 A CN114125432 A CN 114125432A CN 202111388460 A CN202111388460 A CN 202111388460A CN 114125432 A CN114125432 A CN 114125432A
Authority
CN
China
Prior art keywords
data
format
target
decoding
coding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111388460.2A
Other languages
Chinese (zh)
Other versions
CN114125432B (en
Inventor
章小敏
万志宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Tianrongxin Network Security Technology Co.,Ltd.
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111388460.2A priority Critical patent/CN114125432B/en
Publication of CN114125432A publication Critical patent/CN114125432A/en
Application granted granted Critical
Publication of CN114125432B publication Critical patent/CN114125432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Abstract

The present disclosure provides a video data processing method, apparatus, device and storage medium, the method comprising: detecting whether the current hardware decoding resource of the video gateway can process the data of the camera; if the camera data can be processed, detecting whether the current software decoding resource of the video gateway can process the camera data; if the camera data can be processed, determining a corresponding target software decoder according to the data format of the camera data, and performing decoding processing on the camera data to generate first data in a corresponding format; determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format; and performing format conversion packaging processing on the second data to generate target data, and sending the target data to the target equipment. According to the embodiment of the disclosure, on the basis of the current hardware resources, the number of the camera data which can be processed is increased.

Description

Video data processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing video data.
Background
In application scenarios such as data transmission, the camera data needs to be decoded and then encoded, so as to meet the requirements of different users on parameters such as code rate, resolution and the like.
In the prior art, a hardware decoder is used for decoding camera data to obtain decoded data, and then a hardware encoder is used for encoding the decoded data, so that the camera data cannot be processed under the condition that the hardware decoder and/or the hardware encoder are insufficient.
Disclosure of Invention
To solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a video data processing method, apparatus, device, and storage medium.
In a first aspect, the present disclosure provides a method for processing video data, the method comprising:
acquiring camera data acquired by a camera, and detecting whether current hardware decoding resources of a video gateway can process the camera data;
if the current hardware decoding resource cannot process the camera data, detecting whether the current software decoding resource of the video gateway can process the camera data;
if the current software decoding resource can process the camera data through detection, determining a corresponding target software decoder according to the data format of the camera data, and decoding the camera data according to the target software decoder to generate first data in a corresponding format;
determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format;
and performing format conversion packaging processing on the second data according to a preset target format to generate target data, and sending the target data to target equipment.
In an optional implementation manner, the determining, according to the data format of the first data, a corresponding target encoder, and performing encoding processing on the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format includes:
detecting whether the current hardware coding resources of the video gateway can process the first data;
if the current hardware coding resource can process the first data through detection, determining a corresponding target hardware encoder according to the data format of the first data, and performing coding processing on the first data according to the target hardware encoder and preset coding parameters to generate second data in a corresponding format;
if the current hardware coding resource cannot process the first data through detection, whether the current software coding resource of the video gateway can process the first data is detected;
and if the current software coding resource can process the first data through detection, determining a corresponding target software encoder according to the data format of the first data, and coding the first data according to the target software encoder and preset coding parameters to generate second data in a corresponding format.
In an optional embodiment, the method further comprises:
if the current hardware decoding resource can process the camera data through detection, determining a corresponding target hardware decoder according to the data format of the camera data, and decoding the camera data according to the target hardware decoder to generate third data in a corresponding format;
detecting whether the current hardware coding resources of the video gateway can process the third data;
and if the current hardware coding resource is detected to be capable of processing the third data, determining a corresponding target hardware encoder according to the data format of the third data, and coding the third data according to the target hardware encoder and preset coding parameters to generate fourth data in a corresponding format.
In an optional embodiment, the method further comprises:
if the current hardware coding resource cannot process the third data through detection, detecting whether the current software coding resource of the video gateway can process the third data;
and if the current software coding resource is detected to be capable of processing the third data, determining a corresponding target software encoder according to the data format of the third data, and coding the third data according to the target software encoder and preset coding parameters to generate fourth data in a corresponding format.
In an optional implementation manner, before the detecting whether the current hardware decoding resource of the video gateway can process the camera data, the method further includes:
registering a decoding container; wherein, the decoding container comprises at least one preset decoding data format;
the determining of the corresponding target software decoder or target hardware encoder according to the data format of the camera data includes:
judging whether a decoding data format preset in the decoding container comprises a data format of the camera data;
if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target software decoder or a target hardware decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and a software decoder or a hardware decoder;
before determining the corresponding target encoder according to the data format of the first data, the method further includes:
registering the coding container; wherein, the coding container comprises at least one preset coding data format;
the determining a corresponding target encoder according to the data format of the first data includes:
judging whether the coded data format preset in the coding container comprises the data format of the first data or not;
and if the preset coded data format in the coding container comprises the data format of the first data, determining a target coder corresponding to the first data according to the corresponding relation between the preset coded data format in the coding container and the target coder.
In an optional embodiment, the method further comprises:
calling an Application Program Interface (API) corresponding to the decoder to create decoding context information, and performing decoding processing according to the decoding context information; and
and calling an Application Program Interface (API) corresponding to the encoder to create encoding context information, and performing encoding processing according to the encoding context information.
In a second aspect, the present disclosure also provides a video data processing apparatus, the apparatus comprising:
the first detection module is used for acquiring camera data acquired by a camera and detecting whether the current hardware decoding resource of the video gateway can process the camera data;
the second detection module is used for detecting whether the current software decoding resource of the video gateway can process the camera data or not if the current hardware decoding resource cannot process the camera data is detected and known;
the first decoding module is used for determining a corresponding target software decoder according to the data format of the camera data and decoding the camera data according to the target software decoder to generate first data in a corresponding format if the current software decoding resource is detected to be capable of processing the camera data;
the first processing module is used for determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format;
and the packaging module is used for performing packaging processing of format conversion on the second data according to a preset target format to generate target data and sending the target data to target equipment.
In a third aspect, the present disclosure provides a computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to implement the above-mentioned method.
In a fourth aspect, the present disclosure provides an electronic device comprising: a processor; a memory for storing the processor-executable instructions; the processor is used for reading the executable instructions from the memory and executing the instructions to realize the method.
In a fifth aspect, the present disclosure provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the method described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the method for acquiring the network address category provided by the embodiment of the disclosure acquires camera data acquired by a camera, and detects whether the current hardware decoding resource of a video gateway can process the camera data; if the current hardware decoding resource cannot process the camera data, detecting whether the current software decoding resource of the video gateway can process the camera data; if the current software decoding resource can process the camera data through detection, determining a corresponding target software decoder according to the data format of the camera data, and decoding the camera data according to the target software decoder to generate first data in a corresponding format; determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format; and performing format conversion packaging processing on the second data according to a preset target format to generate target data, and sending the target data to the target equipment. Therefore, the number of the camera data which can be processed is increased on the basis of the current hardware resources.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a video data processing method according to an embodiment of the disclosure;
fig. 2 is a schematic flow chart illustrating a method for generating second data according to an embodiment of the disclosure;
fig. 3 is a schematic flowchart of another video data processing method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a video data processing apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Fig. 1 is a schematic flowchart of a video data processing method according to an embodiment of the disclosure. The method may be performed by a video data processing apparatus, wherein the apparatus may be implemented in software and/or hardware, and may generally be integrated in an electronic device.
As shown in fig. 1, the video data processing method may include:
step 101, acquiring camera data acquired by a camera, and detecting whether the current hardware decoding resource of the video gateway can process the camera data.
In the embodiment of the present disclosure, the CAMERA includes a network CAMERA (IP CAMERA, IPC), and a data format of the CAMERA data collected by the CAMERA includes: h.264 format, HEVC (High Efficiency Video Coding) format.
The pictures collected by the plurality of cameras can be displayed in real time through the video gateway, hardware decoding resources in the video gateway can provide support for hardware decoding of the camera data, and the hardware decoding resources comprise an integrated display card and/or an independent display card. In an optional implementation manner, when the gateway system is started, the camera data may be subjected to stream pulling processing and added to the shared memory, and when the camera data needs to be decoded, the camera data is acquired from the shared memory.
In order to determine the decoding mode adopted by the camera data, whether the current hardware decoding resources of the video gateway can process the camera data is detected, that is, whether enough hardware decoding resources exist currently to process the camera data is detected.
There are various methods for detecting whether the current hardware decoding resource of the video gateway can process the data of the camera, which are not limited in this embodiment and are described as follows:
in an optional implementation manner, a hardware decoding threshold may be set, the utilization rate of the current hardware decoding resource is compared with the hardware decoding threshold, and if the utilization rate of the current hardware decoding resource is smaller than the hardware decoding threshold, the current hardware decoding resource can process the camera data; and if the utilization rate of the current hardware decoding resource is not less than the hardware decoding threshold, the current hardware decoding resource cannot process the camera data. For example: setting a hardware decoding threshold value to be 95%, and if the utilization rate of the current hardware decoding resource is 90%, and the utilization rate of the current hardware decoding resource is smaller than the hardware decoding threshold value, enabling the current hardware decoding resource to process the camera data.
In another optional implementation, the estimated hardware decoding occupation space may be determined according to the data format, the data size, and the like of the camera data, the estimated hardware decoding occupation space is compared with the current idle hardware decoding resource, and if the estimated hardware decoding occupation space is smaller than the current idle hardware decoding resource, the current hardware decoding resource can process the camera data; and if the estimated hardware decoding occupied space is not smaller than the current idle hardware decoding resource, the current hardware decoding resource cannot process the camera data. For example: the estimated hardware decoding occupied space is 10%, the current idle hardware decoding resources are 5%, and the estimated hardware decoding occupied space is larger than the current idle hardware decoding resources, so that the current hardware decoding resources cannot process the camera data.
Optionally, before the detecting whether the current hardware decoding resource of the video gateway can process the camera data, the method further includes:
the decoding container is registered.
The decoding container comprises at least one preset decoding data format, and can be used for representing the decoding capability of a corresponding software decoder or hardware decoder. A target decoder, which includes a target software decoder or a target hardware decoder, for processing the camera data can then be subsequently determined based on the decoding container.
Step 102, if it is detected that the current hardware decoding resource cannot process the camera data, detecting whether the current software decoding resource of the video gateway can process the camera data.
If it is detected that the current hardware decoding resource cannot process the camera data, that is, there is not enough hardware decoding resource to process the camera data currently, in order to determine the decoding mode adopted by the camera data, it is detected whether the current software decoding resource of the video gateway can process the camera data, that is, it is detected whether there is enough software decoding resource to process the camera data currently. The software decoding resource includes a Central Processing Unit (CPU).
There are various methods for detecting whether the current software decoding resource of the video gateway can process the data of the camera, and this embodiment is not limited, and the following examples are illustrated:
in an optional implementation manner, a software resource threshold may be set, the utilization rate of the current software decoding resource is compared with the software resource threshold, and if the utilization rate of the current software decoding resource is smaller than the software resource threshold, the current software decoding resource can process camera data; and if the utilization rate of the current software decoding resource is not less than the software resource threshold value, the current software decoding resource cannot process the camera data. For example: setting the threshold value of the software resource to be 90%, and if the utilization rate of the current software decoding resource is 85% and the utilization rate of the current software decoding resource is less than the threshold value of the software resource, enabling the current software decoding resource to process the data of the camera.
In another optional implementation, a system resource threshold may be preset, where the system resource threshold is a minimum CPU utilization rate corresponding to normal operation of the system, and the system resource threshold may be set according to a CPU model and the like, and this embodiment is not limited. Calculating system usable resources in the current video gateway, wherein the system usable resources are resources which can be used for system operation in the current environment, the system usable resources can change according to the occupation condition of software decoding on a CPU (central processing unit), judging whether the system usable resources are smaller than a preset system resource threshold value or not, and if the system usable resources are not smaller than the preset system resource threshold value, the CPU resources which can be currently used for system operation are enough, the current software decoding resources can process camera data; if the system available resource is smaller than the preset system resource threshold value, which indicates that the CPU resource available for the system to run is not enough, the current software decoding resource cannot process the camera data. For example: the preset system resource threshold is 10%, and if the system available resource is 15%, the software decoding resource can process the camera data.
Step 103, if it is detected that the current software decoding resource can process the camera data, determining a corresponding target software decoder according to the data format of the camera data, and performing decoding processing on the camera data according to the target software decoder to generate first data in a corresponding format.
And if the current software decoding resources can process the camera data, namely enough software decoding resources are available to process the camera data, determining a corresponding target software decoder according to the data format of the camera data. And performing software decoding processing on the camera data according to the target software decoder to generate first data in a corresponding format.
In some application scenarios, the data format of the camera data is h.264 format, and after the target software decoder is used to decode the camera data, the data format of the generated first data is YUV format.
In an alternative embodiment, if the decoding container is already registered, the step may include:
step a, judging whether a preset decoding data format in a decoding container comprises a data format of camera data.
In this embodiment, stream probing may be performed on the camera data, a part of video frames in the camera data is obtained, the video frames are analyzed, so as to determine a data format of the camera data, the data format is matched with a decoding data format preset in a decoding container, and whether the decoding data format preset in the decoding container includes the data format of the camera data is determined.
And b, if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target software decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and the software decoder.
If the preset decoding data format in the decoding container comprises the data format of the camera data, the camera data can be processed, and the corresponding relation between the preset decoding data format in the decoding container and the software decoder is searched according to the data format of the camera data, so that the target software decoder corresponding to the camera data is determined. Optionally, if there are multiple software decoders capable of processing the data format, any one of the software decoders may be randomly selected as the target software decoder.
And 104, determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format.
Optionally, before the determining the corresponding target encoder according to the data format of the first data, the method further includes:
the code container is registered.
The coding container comprises at least one preset coding data format, and the coding container can be used for representing the coding capability of a corresponding software encoder or hardware encoder. The target encoder for processing the first data can then subsequently be determined based on the encoding container.
In this disclosure, the target encoder may be a target software encoder or a target hardware encoder, and encoding parameters when encoding the first data may be preset according to an application scenario of a user, a hardware condition of the user, and the like, where the encoding parameters include but are not limited to: code rate and/or resolution.
In an optional implementation manner, if a hardware encoder and a software encoder are not present in the video gateway, a target hardware encoder capable of processing the data format of the first data is determined from the multiple hardware encoders according to the data format of the first data, and the first data is encoded according to the target hardware encoder and a preset code rate, a preset resolution ratio, and the like, so as to generate second data in a corresponding format.
In another optional implementation manner, if a hardware encoder and a software encoder are present in a video gateway, and thus a target encoder may be a target software encoder or a target hardware encoder, fig. 2 is a flowchart of a method for generating second data according to an embodiment of the present disclosure, as shown in fig. 2, the determining a corresponding target encoder according to a data format of first data, and performing encoding processing on the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format includes the following steps:
step 201, detecting whether the current hardware coding resource of the video gateway can process the first data.
That is, there are various methods for detecting whether there are enough hardware coding resources currently to process the camera data, and the following examples are illustrated:
a hardware coding threshold value can be set, the utilization rate of the current hardware coding resource is compared with the hardware coding threshold value, and if the utilization rate of the current hardware coding resource is smaller than the hardware coding threshold value, the current hardware coding resource can process first data; if the utilization rate of the current hardware coding resource is greater than or equal to the hardware coding threshold, the current hardware coding resource cannot process the first data. For example, if the hardware coding threshold is set to 90%, if the current utilization rate of the hardware coding resource is 85%, the current hardware coding resource can process the first data.
Step 202, if it is detected that the current hardware coding resource can process the first data, determining a corresponding target hardware encoder according to a data format of the first data, and performing coding processing on the first data according to the target hardware encoder and preset coding parameters to generate second data in a corresponding format.
And if the detection shows that the current hardware coding resources can process the first data, namely enough hardware coding resources currently process the first data, determining a corresponding target hardware encoder according to the data format of the first data. Further, the first data is subjected to hardware coding processing according to the target hardware encoder, and second data corresponding to the data format is generated.
In some application scenarios, the data format of the first data is a YUV format, and after the camera data is encoded, the format corresponding to the generated first data is an h.264 format.
Step 203, if it is detected that the current hardware coding resource cannot process the first data, detecting whether the current software coding resource of the video gateway can process the first data.
If it is detected that the current hardware coding resource cannot process the first data, that is, there is not enough hardware coding resource currently to process the first data, in order to determine the coding mode adopted by the first data, it is detected whether the current software coding resource of the video gateway can process the first data, that is, it is detected whether there is enough software coding resource currently to process the first data.
There are various methods for detecting whether the current software coding resource of the video gateway can process the first data, and this embodiment is not limited, and the following examples are illustrated:
a system resource threshold may be preset, where the system resource threshold is a minimum CPU utilization rate corresponding to normal operation of the system, and the system resource threshold may be set according to a CPU model and the like, and this embodiment is not limited. Calculating system usable resources in the current video gateway, wherein the system usable resources are resources which can be used for system operation in the current environment, the system usable resources can change according to the occupation condition of software codes on a CPU (central processing unit), judging whether the system usable resources are smaller than a preset system resource threshold value or not, and if the system usable resources are not smaller than the preset system resource threshold value, the current software decoding resources can process camera data; and if the available resources of the system are smaller than the preset system resource threshold value, the current software decoding resources cannot process the data of the camera. For example: the preset system resource threshold is 10%, and if the system available resource is 20%, the software decoding resource can process the camera data.
And 204, if it is detected that the current software coding resource can process the first data, determining a corresponding target software encoder according to the data format of the first data, and performing coding processing on the first data according to the target software encoder and preset coding parameters to generate second data in a corresponding format.
And if the current software coding resources can process the first data, namely enough software coding resources currently process the first data, determining a corresponding target software encoder according to the data format of the first data. And performing software coding processing on the first data according to the target software encoder to generate second data in a corresponding data format.
In some application scenarios, the data format of the first data is YUV format, and after the target software encoder is used to encode the first data, the data format of the generated second data is h.264 format.
In an optional implementation manner, if an encoding container is already registered, the determining a corresponding target encoder according to the data format of the first data may include:
step a, judging whether the preset coding data format in the coding container comprises the data format of the first data.
In this embodiment, the format of the first data may be matched with the encoded data format preset in the encoding container, and whether the encoded data format preset in the encoding container includes the data format of the first data is determined.
And b, if the preset coded data format in the coding container comprises the data format of the first data, determining a target coder corresponding to the camera data according to the corresponding relation between the preset coded data format in the coding container and the coder.
If the preset coding data format in the coding container comprises the data format of the first data, the first data can be processed, and the corresponding relation between the preset coding data format in the coding container and the coder is searched according to the data format of the first data, so that the target coder corresponding to the first data is determined. Optionally, if there are multiple encoders capable of processing the data format, any one of the encoders may be randomly selected as the target encoder. Wherein the encoder comprises a software encoder or a hardware encoder; the target encoder comprises a target software encoder or a target hardware encoder.
And 105, performing format conversion packaging processing on the second data according to a preset target format to generate target data, and sending the target data to the target equipment.
In the embodiment of the present disclosure, in order to send data to a target device, it is necessary to perform encapsulation processing on second data according to a preset target format and complete format conversion, so as to generate target data, where the target format may be determined according to a model of the target device, a data transmission mode, and the like, and this embodiment is not limited. After the target data is obtained, the target data is sent to a target device, and in some application scenarios, the target device may be a preset streaming media server.
The video data acquisition method provided by the embodiment of the disclosure acquires camera data acquired by a camera, and detects whether the current hardware decoding resource of a video gateway can process the camera data; if the current hardware decoding resource cannot process the camera data, detecting whether the current software decoding resource of the video gateway can process the camera data; if the current software decoding resource can process the camera data through detection, determining a corresponding target software decoder according to the data format of the camera data, and decoding the camera data according to the target software decoder to generate first data in a corresponding format; determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format; and performing format conversion packaging processing on the second data according to a preset target format to generate target data, and sending the target data to the target equipment. Therefore, on the basis of the current hardware resources, the utilization rate of the video gateway is improved, and meanwhile, the cost is saved, so that the number of the camera data which can be processed is increased.
Based on the foregoing embodiment, fig. 3 is a schematic flowchart of another video data processing method provided in the embodiment of the present disclosure, and as shown in fig. 3, the method further includes:
step 301, if it is detected that the current hardware decoding resource can process the camera data, determining a corresponding target hardware decoder according to the data format of the camera data, and performing decoding processing on the camera data according to the target hardware decoder to generate third data in a corresponding format.
And if the current hardware decoding resources can process the camera data, namely enough hardware decoding resources are available to process the camera data, determining a corresponding target hardware decoder according to the data format of the camera data. And carrying out hardware decoding processing on the camera data according to the target hardware decoder to generate third data in a corresponding format.
In some application scenarios, the data format of the camera data is h.264 format, and after the target hardware decoder is used to decode the camera data, the data format of the generated third data is NV12 format.
In an alternative embodiment, if the decoding container is already registered, the step may include:
step a, judging whether a preset decoding data format in a decoding container comprises a data format of camera data.
In this embodiment, stream probing may be performed on the camera data, a part of video frames in the camera data is obtained, the video frames are analyzed, so as to determine a data format of the camera data, the data format is matched with a decoding data format preset in a decoding container, and whether the decoding data format preset in the decoding container includes the data format of the camera data is determined.
And b, if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target hardware decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and the hardware decoder.
If the preset decoding data format in the decoding container comprises the data format of the camera data, the camera data can be processed, and the corresponding relation between the preset decoding data format in the decoding container and the hardware decoder is searched according to the data format of the camera data, so that the target hardware decoder corresponding to the camera data is determined. Optionally, if there are multiple hardware decoders capable of processing the data format, any one of the hardware decoders may be randomly selected as the target hardware decoder.
Step 302, detecting whether the current hardware coding resource of the video gateway can process the third data.
That is, there are various methods for detecting whether there are enough hardware coding resources currently to process the camera data, and the following examples are illustrated:
a hardware coding threshold value can be set, the utilization rate of the current hardware coding resource is compared with the hardware coding threshold value, and if the utilization rate of the current hardware coding resource is smaller than the hardware coding threshold value, the current hardware coding resource can process third data; and if the utilization rate of the current hardware coding resource is greater than or equal to the hardware coding threshold, the current hardware coding resource cannot process the third data. For example, if the hardware coding threshold is set to 90%, if the current utilization rate of the hardware coding resource is 85%, the current hardware coding resource can process the third data.
Step 303, if it is detected that the current hardware coding resource can process the third data, determining a corresponding target hardware encoder according to a data format of the third data, and performing coding processing on the third data according to the target hardware encoder and preset coding parameters to generate fourth data in a corresponding format.
Optionally, before the determining the corresponding target hardware encoder according to the data format of the third data, the method further includes:
the code container is registered.
The coding container comprises at least one preset coding data format, and the coding container can be used for representing the coding capability of a corresponding software encoder or hardware encoder. The target encoder for processing the third data can then subsequently be determined based on the encoding container.
In this disclosure, the target encoder may be a target software encoder or a target hardware encoder, and encoding parameters when encoding the first data may be preset according to an application scenario of a user, a hardware condition of the user, and the like, where the encoding parameters include but are not limited to: code rate and/or resolution.
And if the detection shows that the current hardware coding resources can process the third data, namely enough hardware coding resources are available to process the third data, determining a corresponding target hardware encoder according to the data format of the third data. Further, the third data is subjected to hardware coding processing according to the target hardware encoder, and fourth data corresponding to the data format is generated.
In an optional implementation manner, if an encoding container is already registered, the determining, according to the data format of the third data, a corresponding target hardware encoder may include:
step a, judging whether the preset coding data format in the coding container comprises the data format of the first data.
In this embodiment, the format of the third data may be matched with the preset encoded data format in the encoding container, and whether the preset encoded data format in the encoding container includes the data format of the third data is determined.
And b, if the preset coded data format in the coding container comprises the data format of the third data, determining a target hardware coder corresponding to the camera data according to the corresponding relation between the preset coded data format in the coding container and the coder.
If the preset coded data format in the coding container comprises the data format of the third data, the third data can be processed, and the corresponding relation between the preset coded data format in the coding container and the hardware encoder is retrieved according to the data format of the third data, so that the target hardware encoder corresponding to the third data is determined. Optionally, if there are multiple encoders capable of processing the data format, any one of the encoders may be randomly selected as the target hardware encoder.
In some application scenarios, the data format of the third data is NV12 format, and after the camera data is decoded, the data format corresponding to the generated fourth data is h.264 format.
Step 304, if it is detected that the current hardware coding resource cannot process the third data, detecting whether the current software coding resource of the video gateway can process the third data.
If it is detected that the current hardware coding resource cannot process the third data, that is, there is not enough hardware coding resource currently to process the third data, in order to determine the coding mode adopted by the third data, it is detected whether the current software coding resource of the video gateway can process the third data, that is, it is detected whether there is enough software coding resource currently to process the third data. There are various methods for detecting whether the current software coding resource of the video gateway can process the third data, and this embodiment is not limited.
Step 305, if it is detected that the current software coding resource can process the third data, determining a corresponding target software encoder according to the data format of the third data, and performing coding processing on the third data according to the target software encoder and preset coding parameters to generate fourth data in a corresponding format.
And if the current software coding resources can process the third data through detection, namely enough software coding resources are available to process the third data currently, determining a corresponding target software encoder according to the data format of the third data. And performing software coding processing on the third data according to the target software encoder to generate fourth data in a corresponding data format.
In some application scenarios, the data format of the third data is NV12 format, and after the third data is encoded by using the target software encoder, the data format of the generated second data is h.264 format.
In an optional implementation manner, if an encoding container is already registered, the determining, according to the data format of the third data, a corresponding target software encoder may include:
step a, judging whether the preset coding data format in the coding container comprises the data format of the third data.
In this embodiment, the format of the third data may be matched with the preset encoded data format in the encoding container, and whether the preset encoded data format in the encoding container includes the data format of the third data is determined.
And b, if the preset coded data format in the coding container comprises the data format of the first data, determining a target software encoder corresponding to the camera data according to the corresponding relation between the preset coded data format in the coding container and the software encoder.
If the preset coding data format in the coding container comprises the data format of the third data, the third data can be processed, and the corresponding relation between the preset coding data format in the coding container and the software encoder is searched according to the data format of the third data, so that the target software encoder corresponding to the third data is determined. Optionally, if there are multiple software encoders capable of processing the data format, any one of the software encoders may be randomly selected as the target software encoder.
Optionally, in this embodiment, an Application Programming Interface (API) may be further used to create a context for performing an encoding or decoding operation, and specifically, based on the foregoing embodiment, the method may further include:
calling an Application Program Interface (API) corresponding to a decoder to create decoding context information, and performing decoding processing according to the decoding context information; and calling an application program interface API corresponding to the encoder to create encoding context information, and performing encoding processing according to the encoding context information.
In this embodiment, an API corresponding to the decoder can be called to create decoding context information, so as to transmit the camera data to a corresponding target decoder according to the decoding context information, perform decoding processing on the camera data, and obtain decoded data. Similarly, the API corresponding to the encoder can be called to create the encoding context information, so that the decoded data is transmitted to the corresponding target encoder according to the encoding context information, and the data is encoded.
If the target decoder is a target hardware decoder, decoding data obtained by decoding the camera data is first data; if the target decoder is the target software decoder, the decoded data generated by decoding the camera data is the third data. The target encoder that processes the decoded data includes a target hardware encoder and a target software decoder.
Taking the creating of the decoding context information in this embodiment as an example, if the target decoder is a hardware decoder and the hardware decoder is an independent graphics card, the API provided by Nvidia may be called to create the independent decoding context information hw _ device _ ctx _ ref; if the target decoder is a hardware decoder and the hardware decoder is an integrated graphics card, an API provided by Intel can be called to create a set display decoding context information hw _ device _ ctx _ ref; if the target decoder is a software decoder, the API provided by the third-party library can be called to create software decoding context information. Wherein the third party library includes but is not limited to: FFMPEG (fast Forward Mpeg) software.
According to the video data processing method provided by the embodiment of the disclosure, on the basis of the current hardware coding resources, the utilization rate of the video gateway is improved, and meanwhile, the cost is saved, so that the number of the camera data which can be processed is increased.
Fig. 4 is a schematic structural diagram of a video data processing apparatus provided in an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 4, the video data processing apparatus 400 may include:
the first detection module 401 is configured to acquire camera data acquired by a camera, and detect whether a current hardware decoding resource of a video gateway can process the camera data;
a second detecting module 402, configured to detect whether the current software decoding resource of the video gateway can process the camera data if it is detected that the current hardware decoding resource cannot process the camera data;
a first decoding module 403, configured to determine a corresponding target software decoder according to a data format of the camera data if it is detected that the current software decoding resource can process the camera data, and perform decoding processing on the camera data according to the target software decoder to generate first data in a corresponding format;
a first processing module 404, configured to determine a corresponding target encoder according to a data format of the first data, perform encoding processing on the first data according to the target encoder and preset encoding parameters, and generate second data in a corresponding format;
the encapsulating module 405 is configured to perform format conversion on the second data according to a preset target format to generate target data, and send the target data to a target device.
In an optional implementation, the first processing module 404 includes:
a first detecting unit, configured to detect whether a current hardware coding resource of the video gateway can process the first data;
a first encoding unit, configured to determine a corresponding target hardware encoder according to a data format of the first data if it is detected that the current hardware encoding resource can process the first data, and perform encoding processing on the first data according to the target hardware encoder and preset encoding parameters to generate second data in a corresponding format;
the second detection module is used for detecting whether the current software coding resource of the video gateway can process the first data or not if the current hardware coding resource cannot process the first data is detected and known;
and the second coding module is used for determining a corresponding target software coder according to the data format of the first data if the fact that the current software coding resource can process the first data is detected, and coding the first data according to the target software coder and preset coding parameters to generate second data in a corresponding format.
Optionally, the apparatus further comprises:
the second decoding module is used for determining a corresponding target hardware decoder according to the data format of the camera data and decoding the camera data according to the target hardware decoder to generate third data in a corresponding format if the current hardware decoding resource is detected to be capable of processing the camera data;
a third detection module, configured to detect whether the current hardware coding resource of the video gateway can process the third data;
and the first coding module is used for determining a corresponding target hardware encoder according to the data format of the third data if it is detected that the current hardware coding resource can process the third data, and coding the third data according to the target hardware encoder and preset coding parameters to generate fourth data in a corresponding format.
Optionally, the apparatus further comprises:
a fourth detection module, configured to detect whether the current software coding resource of the video gateway can process the third data if it is detected that the current hardware coding resource cannot process the third data;
and the second coding module is used for determining a corresponding target software coder according to the data format of the third data if the current software coding resource is detected to be capable of processing the third data, and coding the third data according to the target software coder and preset coding parameters to generate fourth data in a corresponding format.
Optionally, the apparatus further comprises:
the first registration module is used for registering the decoding container; wherein, the decoding container comprises at least one preset decoding data format;
the first decoding module 403 is configured to:
judging whether a decoding data format preset in the decoding container comprises a data format of the camera data;
if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target software decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and the software decoder;
the second decoding module is configured to:
judging whether a decoding data format preset in the decoding container comprises a data format of the camera data;
if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target hardware decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and the hardware decoder;
the device, still include:
the second registration module is used for registering the coding container; wherein, the coding container comprises at least one preset coding data format;
the first processing module 404 is configured to:
judging whether the coded data format preset in the coding container comprises the data format of the first data or not;
and if the preset coding data format in the coding container comprises the data format of the first data, determining a target coder corresponding to the first data according to the corresponding relation between the preset coding data format in the coding container and the coder.
Optionally, the apparatus further comprises:
the first calling module is used for calling an Application Program Interface (API) corresponding to the decoder to create decoding context information and carrying out decoding processing according to the decoding context information; and
and the second calling module is used for calling an Application Program Interface (API) corresponding to the encoder to create encoding context information and carrying out encoding processing according to the encoding context information.
The video data processing device provided by the embodiment of the disclosure can execute the video data processing method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
In addition to the above method and apparatus, the present disclosure also provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is caused to implement the video data processing method according to the present disclosure.
Embodiments of the present disclosure also provide a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the computer program/instruction implements the video data processing method provided in any embodiment of the present disclosure.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Referring now specifically to fig. 5, a schematic diagram of an electronic device 500 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 500 in the disclosed embodiment may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the video data processing method of the embodiment of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: detecting whether the current hardware decoding resource of the video gateway can process the data of the camera; if the camera data can be processed, detecting whether the current software decoding resource of the video gateway can process the camera data; if the camera data can be processed, determining a corresponding target software decoder according to the data format of the camera data, and performing decoding processing on the camera data to generate first data in a corresponding format; determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format; and performing format conversion packaging processing on the second data to generate target data, and sending the target data to the target equipment. According to the embodiment of the disclosure, on the basis of the current hardware resources, the number of the camera data which can be processed is increased.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above 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 a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A video data processing method, comprising the steps of:
acquiring camera data acquired by a camera, and detecting whether current hardware decoding resources of a video gateway can process the camera data;
if the current hardware decoding resource cannot process the camera data, detecting whether the current software decoding resource of the video gateway can process the camera data;
if the current software decoding resource can process the camera data through detection, determining a corresponding target software decoder according to the data format of the camera data, and decoding the camera data according to the target software decoder to generate first data in a corresponding format;
determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format;
and performing format conversion packaging processing on the second data according to a preset target format to generate target data, and sending the target data to target equipment.
2. The method of claim 1, wherein the determining a corresponding target encoder according to the data format of the first data, and performing encoding processing on the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format comprises:
detecting whether the current hardware coding resources of the video gateway can process the first data;
if the current hardware coding resource can process the first data through detection, determining a corresponding target hardware encoder according to the data format of the first data, and performing coding processing on the first data according to the target hardware encoder and preset coding parameters to generate second data in a corresponding format;
if the current hardware coding resource cannot process the first data through detection, whether the current software coding resource of the video gateway can process the first data is detected;
and if the current software coding resource can process the first data through detection, determining a corresponding target software encoder according to the data format of the first data, and coding the first data according to the target software encoder and preset coding parameters to generate second data in a corresponding format.
3. The method of claim 1, further comprising:
if the current hardware decoding resource can process the camera data through detection, determining a corresponding target hardware decoder according to the data format of the camera data, and decoding the camera data according to the target hardware decoder to generate third data in a corresponding format;
detecting whether the current hardware coding resources of the video gateway can process the third data;
and if the current hardware coding resource is detected to be capable of processing the third data, determining a corresponding target hardware encoder according to the data format of the third data, and coding the third data according to the target hardware encoder and preset coding parameters to generate fourth data in a corresponding format.
4. The method of claim 3, further comprising:
if the current hardware coding resource cannot process the third data through detection, detecting whether the current software coding resource of the video gateway can process the third data;
and if the current software coding resource is detected to be capable of processing the third data, determining a corresponding target software encoder according to the data format of the third data, and coding the third data according to the target software encoder and preset coding parameters to generate fourth data in a corresponding format.
5. The method of claim 4, wherein prior to said detecting whether current hardware decoding resources of a video gateway are capable of processing the camera data, further comprising:
registering a decoding container; wherein, the decoding container comprises at least one preset decoding data format;
the determining of the corresponding target software decoder or target hardware encoder according to the data format of the camera data includes:
judging whether a decoding data format preset in the decoding container comprises a data format of the camera data;
if the preset decoding data format in the decoding container comprises the data format of the camera data, determining a target software decoder or a target hardware decoder corresponding to the camera data according to the corresponding relation between the preset decoding data format in the decoding container and a software decoder or a hardware decoder;
before determining the corresponding target encoder according to the data format of the first data, the method further includes:
registering the coding container; wherein, the coding container comprises at least one preset coding data format;
the determining a corresponding target encoder according to the data format of the first data includes:
judging whether the coded data format preset in the coding container comprises the data format of the first data or not;
and if the preset coding data format in the coding container comprises the data format of the first data, determining a target coder corresponding to the first data according to the corresponding relation between the preset coding data format in the coding container and the coder.
6. The method of claim 5, further comprising:
calling an Application Program Interface (API) corresponding to the decoder to create decoding context information, and performing decoding processing according to the decoding context information; and
and calling an Application Program Interface (API) corresponding to the encoder to create encoding context information, and performing encoding processing according to the encoding context information.
7. A video data processing apparatus, characterized in that the apparatus comprises:
the first detection module is used for acquiring camera data acquired by a camera and detecting whether the current hardware decoding resource of the video gateway can process the camera data;
the second detection module is used for detecting whether the current software decoding resource of the video gateway can process the camera data or not if the current hardware decoding resource cannot process the camera data is detected and known;
the first decoding module is used for determining a corresponding target software decoder according to the data format of the camera data and decoding the camera data according to the target software decoder to generate first data in a corresponding format if the current software decoding resource is detected to be capable of processing the camera data;
the first processing module is used for determining a corresponding target encoder according to the data format of the first data, and encoding the first data according to the target encoder and preset encoding parameters to generate second data in a corresponding format;
and the packaging module is used for performing packaging processing of format conversion on the second data according to a preset target format to generate target data and sending the target data to target equipment.
8. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the video data processing method of any one of the claims 1 to 6.
9. A computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to implement the video data processing method of any one of claims 1-6.
10. A computer program product, characterized in that the computer program product comprises a computer program/instructions which, when executed by a processor, implement the video data processing method according to any of claims 1-6.
CN202111388460.2A 2021-11-22 2021-11-22 Video data processing method, device, equipment and storage medium Active CN114125432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111388460.2A CN114125432B (en) 2021-11-22 2021-11-22 Video data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111388460.2A CN114125432B (en) 2021-11-22 2021-11-22 Video data processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114125432A true CN114125432A (en) 2022-03-01
CN114125432B CN114125432B (en) 2022-09-16

Family

ID=80439575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111388460.2A Active CN114125432B (en) 2021-11-22 2021-11-22 Video data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114125432B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055715A (en) * 2022-05-30 2023-05-02 荣耀终端有限公司 Scheduling method of coder and decoder and electronic equipment
WO2023236766A1 (en) * 2022-06-08 2023-12-14 中兴通讯股份有限公司 Color space conversion method, electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140146895A1 (en) * 2012-11-28 2014-05-29 Cisco Technology, Inc. Fast Switching Hybrid Video Decoder
CN104661059A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 Picture playing method and device as well as set-top box
CN104866381A (en) * 2014-02-20 2015-08-26 联想(北京)有限公司 Information processing method and first electronic equipment
CN106210726A (en) * 2016-08-08 2016-12-07 成都佳发安泰科技股份有限公司 The method that utilization rate according to CPU Yu GPU carries out adaptive decoding to video data
CN108881916A (en) * 2018-06-21 2018-11-23 深圳市斯迈龙科技有限公司 The video optimized processing method and processing device of remote desktop
US20180343460A1 (en) * 2017-05-27 2018-11-29 Mediatek Singapore Pte. Ltd. Decoder resource allocating method and associated apparatus
CN111510743A (en) * 2020-04-21 2020-08-07 广州市百果园信息技术有限公司 Method, device, system, equipment and storage medium for scheduling transcoding resources
US20210321123A1 (en) * 2018-06-01 2021-10-14 Canon Kabushiki Kaisha A load balancing method for video decoding in a system providing hardware and software decoding resources

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140146895A1 (en) * 2012-11-28 2014-05-29 Cisco Technology, Inc. Fast Switching Hybrid Video Decoder
CN104661059A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 Picture playing method and device as well as set-top box
CN104866381A (en) * 2014-02-20 2015-08-26 联想(北京)有限公司 Information processing method and first electronic equipment
CN106210726A (en) * 2016-08-08 2016-12-07 成都佳发安泰科技股份有限公司 The method that utilization rate according to CPU Yu GPU carries out adaptive decoding to video data
US20180343460A1 (en) * 2017-05-27 2018-11-29 Mediatek Singapore Pte. Ltd. Decoder resource allocating method and associated apparatus
US20210321123A1 (en) * 2018-06-01 2021-10-14 Canon Kabushiki Kaisha A load balancing method for video decoding in a system providing hardware and software decoding resources
CN108881916A (en) * 2018-06-21 2018-11-23 深圳市斯迈龙科技有限公司 The video optimized processing method and processing device of remote desktop
CN111510743A (en) * 2020-04-21 2020-08-07 广州市百果园信息技术有限公司 Method, device, system, equipment and storage medium for scheduling transcoding resources

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055715A (en) * 2022-05-30 2023-05-02 荣耀终端有限公司 Scheduling method of coder and decoder and electronic equipment
CN116055715B (en) * 2022-05-30 2023-10-20 荣耀终端有限公司 Scheduling method of coder and decoder and electronic equipment
WO2023236766A1 (en) * 2022-06-08 2023-12-14 中兴通讯股份有限公司 Color space conversion method, electronic device and storage medium

Also Published As

Publication number Publication date
CN114125432B (en) 2022-09-16

Similar Documents

Publication Publication Date Title
CN114125432B (en) Video data processing method, device, equipment and storage medium
CN110365973B (en) Video detection method and device, electronic equipment and computer readable storage medium
CN110738657B (en) Video quality evaluation method and device, electronic equipment and storage medium
CN110545472B (en) Video data processing method and device, electronic equipment and computer readable medium
CN112272226B (en) Picture loading method and device and readable storage medium
CN110991373A (en) Image processing method, image processing apparatus, electronic device, and medium
CN112954354B (en) Video transcoding method, device, equipment and medium
CN112135169A (en) Media content loading method, device, equipment and medium
CN112153415B (en) Video transcoding method, device, equipment and storage medium
CN111385576B (en) Video coding method and device, mobile terminal and storage medium
CN113259729B (en) Data switching method, server, system and storage medium
CN112053286A (en) Image processing method, image processing device, electronic equipment and readable medium
CN114495081A (en) Text recognition method and device, readable medium and electronic equipment
CN115103191A (en) Image processing method, device, equipment and storage medium
CN111581556B (en) Page data processing method, device, electronic equipment and readable medium
CN107005731B (en) Image cloud end streaming media service method, server and system using application codes
CN110290381B (en) Video quality evaluation method and device, electronic equipment and computer storage medium
CN114495112A (en) Method and device for processing text in image, readable medium and electronic equipment
CN113033680A (en) Video classification method and device, readable medium and electronic equipment
CN112162682A (en) Content display method and device, electronic equipment and computer readable storage medium
CN111680754A (en) Image classification method and device, electronic equipment and computer-readable storage medium
CN111435995B (en) Method, device and system for generating dynamic picture
CN116828180B (en) Video encoding method, apparatus, electronic device, and computer-readable medium
CN111083196B (en) Information forwarding method and device and electronic equipment
CN110838132B (en) Object segmentation method, device and equipment based on video stream and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221107

Address after: 519030 Room 103-060, 1st Floor, Building 1, No. 18, Futian Road, Xiangzhou District, Zhuhai, Guangdong Province (centralized office area)

Patentee after: Zhuhai Tianrongxin Network Security Technology Co.,Ltd.

Patentee after: Beijing Topsec Network Security Technology Co.,Ltd.

Patentee after: Topsec Technologies Inc.

Patentee after: BEIJING TOPSEC SOFTWARE Co.,Ltd.

Address before: 100000 4th floor, building 3, yard 1, Shangdi East Road, Haidian District, Beijing

Patentee before: Beijing Topsec Network Security Technology Co.,Ltd.

Patentee before: Topsec Technologies Inc.

Patentee before: BEIJING TOPSEC SOFTWARE Co.,Ltd.

TR01 Transfer of patent right