Video decoding method and device, equipment and storage medium

By using the codec library of the media processing software platform of the hardware decoding chip in video analysis applications for hardware decoding, the problem of high CPU resources occupancy by software encoding and codec is solved, and efficient video encoding and codec performance and resource release are achieved.

CN119629361APending Publication Date: 2025-03-14SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411936462.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When the prior art realizes video encoding and decoding through software in video analysis applications, the central processing unit takes up high resources, resulting in waste of computing resources and increased power consumption, which is not desirable especially on edge devices with limited computing resources.

Method used

The codec library of the media processing software platform of the hardware decoding chip provides efficient hardware decoding capabilities, uses the preset decoding interface to decode the decoded data, and performs video processing tasks based on the decoded target video.

Benefits of technology

It significantly improves the video encoding and codec performance, effectively releases computing resources, reduces chip energy consumption, and solves the problem of high CPU resources occupied by software encoding and codec.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629361A_ABST
    Figure CN119629361A_ABST
Patent Text Reader

Abstract

The invention discloses a video decoding method, device and equipment and a storage medium, and relates to the field of video analysis, and the method comprises the steps: locally installing a target component corresponding to a media processing software platform based on a coding and decoding library of the media processing software platform, adding an executable command corresponding to the media processing software platform to a preset environment variable based on the target component; receiving a data stream address of the to-be-decoded data through the video stream processing function, and calling an executable command in a preset environment variable so as to execute a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the to-be-decoded data; and decoding the to-be-decoded data by using a preset decoding interface of the media processing software platform, and executing a corresponding video processing task based on a target video obtained after decoding. The efficient hardware decoding capability is provided through the coding and decoding library of the media processing software platform of the hardware decoding chip, the computing resources can be effectively released, and the energy consumption of the chip is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video analysis, and in particular to a video decoding method, device, equipment and storage medium. Background Art

[0002] In the process of developing image processing algorithms, the acquisition of real-time camera video streams is a key link. Although OpenCV, Javav library, and FFmpeg components are commonly used in software development to perform video encoding and decoding tasks, this method often occupies a large amount of CPU (Central Processing Unit) resources and increases power consumption. For edge devices with limited computing resources, such resource consumption is not desirable. Therefore, how to achieve more efficient video encoding and decoding to reduce the CPU burden is a problem to be solved in this field. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a video decoding method, device, equipment and storage medium, which can effectively release computing resources and reduce chip energy consumption by providing efficient hardware decoding capabilities through the codec library of the media processing software platform of the hardware decoding chip. The specific scheme is as follows:

[0004] In a first aspect, the present application provides a video decoding method, applied to a target hardware device, comprising:

[0005] Based on the codec library of the media processing software platform, a target component corresponding to the media processing software platform is installed locally, and based on the target component, an executable command corresponding to the media processing software platform is added to a preset environment variable;

[0006] The data stream address of the data to be decoded is received through the video stream processing function, and the executable command in the preset environment variable is called to perform a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded;

[0007] The data to be decoded is decoded using a preset decoding interface of the media processing software platform, and a corresponding video processing task is performed based on the target video obtained after decoding.

[0008] Optionally, the video decoding method further includes:

[0009] Encapsulating the target code into a corresponding shared library file through a preset template library, and adding the shared library file to the preset environment variable, so that the streaming media server calls the shared library file in the preset environment variable according to the data stream address to perform a corresponding streaming operation;

[0010] The target code is a code constructed based on a target programming language, and the target programming language is a programming language different from the programming language corresponding to the executable command.

[0011] Optionally, receiving the data stream address of the data to be decoded through the video stream processing function, and calling the executable command in the preset environment variable to perform a corresponding stream pulling operation according to the data stream address through the streaming media server, includes:

[0012] Receiving a plurality of data stream addresses corresponding to the data to be decoded through the video stream processing function, and starting threads corresponding to the data stream addresses one by one;

[0013] The executable command in the preset environment variable is called through the thread, so as to utilize the streaming media server to perform the corresponding streaming operation according to the data stream address.

[0014] Optionally, calling the executable command in the preset environment variable to use the streaming media server to perform a corresponding stream pulling operation according to the data stream address includes:

[0015] Calling a preset decoder initialization command in the preset environment variable to initialize the decoder of the media processing software platform, and obtaining a default configuration of the decoder through the media processing software platform and based on a preset decoder configuration acquisition command in the preset environment variable;

[0016] The decoder is configured according to the preset decoder configuration command in the preset environment variable and based on the default configuration, so that the corresponding streaming operation is performed by the streaming media server using the configured decoder.

[0017] Optionally, the decoding of the to-be-decoded data by using a preset decoding interface of the media processing software platform, and performing a corresponding video processing task based on a target video obtained after decoding, includes:

[0018] If the video processing task is a video playback task, determining a video format that supports the streaming media server to perform video recognition;

[0019] The preset decoding interface of the media processing software platform is used to decode the data to be decoded based on the video format, and a corresponding video processing task is performed based on the target video that meets the video format obtained after decoding.

[0020] Optionally, after decoding the to-be-decoded data based on the video format by using the preset decoding interface of the media processing software platform, the method further includes:

[0021] Determine target frame data currently obtained by decoding the data to be decoded, and determine the amount of the current target frame data;

[0022] If the number reaches a preset threshold, the target frame data is converted into a target image using a preset callback function in a preset buffer, so as to perform a corresponding image recognition task based on the target image.

[0023] Optionally, the determining target frame data currently obtained by decoding the data to be decoded includes:

[0024] Acquire a frame data pointer and a timestamp corresponding to the data to be decoded based on a preset pseudo code;

[0025] The data to be decoded is decoded using a decoder of the media processing software platform according to the frame data pointer and the timestamp to obtain the target frame data.

[0026] In a second aspect, the present application provides a video decoding apparatus, applied to a target hardware device, comprising:

[0027] A command adding module, used to locally install a target component corresponding to the media processing software platform based on the codec library of the media processing software platform, and add an executable command corresponding to the media processing software platform to a preset environment variable based on the target component;

[0028] A data acquisition module, used to receive the data stream address of the data to be decoded through the video stream processing function, and call the executable command in the preset environment variable to perform a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded;

[0029] The video decoding module is used to decode the data to be decoded using a preset decoding interface of the media processing software platform, and to perform corresponding video processing tasks based on the target video obtained after decoding.

[0030] In a third aspect, the present application provides an electronic device, comprising a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned video decoding method.

[0031] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned video decoding method when executed by a processor.

[0032] In this application, firstly, the corresponding target component of the media processing software platform can be installed locally based on the codec library of the media processing software platform, and the executable command corresponding to the media processing software platform can be added to the preset environment variable based on the target component, and then the data stream address of the data to be decoded is received through the video stream processing function, and then the executable command in the preset environment variable is called to perform the corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded, so as to use the preset decoding interface of the media processing software platform to decode the data to be decoded, and perform the corresponding video processing task based on the target video obtained after decoding. In this way, the codec library of the media processing software platform of the hardware decoding chip provides efficient hardware decoding capabilities, so that the video codec performance has been greatly improved, which helps to solve the problem of high CPU resources occupied by video codecs implemented by software when developing video analysis applications, and can effectively release computing resources and reduce chip energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0034] Figure 1 A flow chart of a video decoding method provided by this application;

[0035] Figure 2 A schematic diagram of a media processing software platform architecture provided for this application;

[0036] Figure 3 A specific video analysis method flow chart provided for this application;

[0037] Figure 4 A schematic diagram of the structure of a video decoding device provided by this application;

[0038] Figure 5 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

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

[0040] In the process of developing image processing algorithms, the acquisition of real-time camera video stream is a key link. Currently, when performing video encoding and decoding tasks, a large amount of CPU resources are often occupied. For edge devices with limited computing resources, such resource consumption is not desirable. The present application can provide efficient hardware decoding capabilities through the codec library of the media processing software platform of the hardware decoding chip, which greatly improves the video encoding and decoding performance, effectively releases computing resources, and reduces chip energy consumption.

[0041] See also Figure 1 As shown, an embodiment of the present invention discloses a video decoding method, comprising:

[0042] Step S11: locally install a target component corresponding to the media processing software platform based on the codec library of the media processing software platform, and add an executable command corresponding to the media processing software platform to a preset environment variable based on the target component.

[0043] It should be pointed out that this embodiment is mainly based on the RK3588 model application processor chip with a variety of high-performance processing units. RK3588 adopts the ARM (Advanced RISC Machines, Advanced Reduced Instruction Set Machine) architecture, mainly for ARM PC (Personal Computer, Personal Computer), edge computing, personal mobile Internet devices and other multimedia product applications, and because Rockchip is officially equipped with a dedicated hardware decoding chip and provides efficient hardware decoding capabilities through the MPP library, the video encoding and decoding performance has been greatly improved. Therefore, in this embodiment, firstly, the target component corresponding to the media processing software platform can be installed locally on the target hardware device based on the encoding and decoding library (MPP library) of the media processing software platform (MPP), and the executable command corresponding to the media processing software platform is added to the preset environment variable based on the target component. That is to say, in the process of encapsulating and improving the video encoding and decoding capabilities of the RK3588 chip hardware in this embodiment, the main basic hardware devices used are development boards or edge computing boxes based on RK3588 chips, operating systems such as ubuntu and Debian, and ARM architecture. In addition, this embodiment can compile and install MPP-related components according to the information provided by the RK official MPP library address, and strictly follow the version information in the official document description to ensure that the MPP components are installed normally, so as to add the directory where the compiled executable command is located to the system PATH. The specific architecture of MPP in the system can be found in Figure 2 The MPP hierarchy in the system architecture is shown.

[0044] Step S12: receiving the data stream address of the data to be decoded through the video stream processing function, and calling the executable command in the preset environment variable to perform a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded.

[0045] In this embodiment, after the MPP component of the basic hardware device is installed, the data stream address and data stream type of the data to be decoded sent by the server can be received, and the streaming media server (ZLMediaKit) calls the executable command in the preset environment variable according to the data stream address to perform the corresponding stream pulling operation to obtain the data to be decoded. And it should be pointed out that since the C++ sample code officially provided by the RK3588 chip may be difficult to use for developers with non-C++ backgrounds, this embodiment integrates ZLMediaKit to achieve smooth stream pulling function, and encapsulates it into a general .so dynamic library with the help of Pybind11 (a lightweight C++ library that only contains a set of header files, and C++ types can be used in Python), so that developers are no longer limited to a specific programming language, whether it is Python, C++, Java, or other languages ​​that support calling C-style dynamic libraries, can easily achieve efficient stream pulling and encoding and decoding operations for multiple real-time video streams. Specifically, the target code can be encapsulated into a corresponding shared library file through the preset template library Pybind11, and the shared library file is added to the preset environment variable, so that the streaming media server calls the shared library file in the preset environment variable according to the data stream address to perform the corresponding streaming operation; wherein, the above-mentioned target code is a code built based on the target programming language, and the target programming language is a programming language different from the programming language corresponding to the executable command. It can be understood that in a specific embodiment, the above-mentioned target programming language is C++. That is to say, in this embodiment, the library functions and structures in C++ can be encapsulated into Python modules through Pybind11, which specifically include structure definitions, function bindings, and calls on the Python side. By encapsulating the C++ code into a so library and exporting it to the PATH, and providing an interface description document, it can be called by other programming language codes. In this way, the C++ code is encapsulated into a so library through Pybind11, and the use of the original command line of the media processing software platform is encapsulated and improved, and the method name familiar to developers is changed to a calling method with parameters passed in, and the application software is shielded from the complex underlying processing related to the chip, so that developers are no longer restricted by the programming language.

[0046] And in this embodiment, when calling the executable command to perform the stream pulling operation, the video stream processing function can be used to receive several data stream addresses corresponding to the data to be decoded, and the thread corresponding to the data stream address can be started, and then the executable command in the preset environment variable can be called through the thread to use the streaming media server to perform the corresponding stream pulling operation according to the data stream address. In a specific embodiment, the video stream processing function can be used to receive several data stream addresses corresponding to the data to be decoded from multiple camera devices to obtain the video data collected by the camera device. And when performing the stream pulling operation, the preset decoder initialization command in the preset environment variable can be specifically called to initialize the decoder of the media processing software platform, and the default configuration of the decoder can be obtained by the media processing software platform based on the preset decoder configuration acquisition command in the preset environment variable, and then the decoder is configured according to the preset decoder configuration command in the preset environment variable and based on the default configuration, so that the corresponding stream pulling operation can be performed by the streaming media server using the configured decoder. That is to say, when using the MPP library to create a context, control and process video streams, multiple RTSP (Real Time Streaming Protocol) data stream addresses and stream types can be received through the video stream processing function, and a thread is started for each stream address to perform stream decoding operations. After that, the code calls mpp_dec_cfg_init(&cfg) to initialize the decoder configuration, and then uses the MPP_DEC_GET_CFG command to get the default configuration from the decoder context, and sets the MPP_DEC_SET_CFG command to apply the configuration. At the same time, the code also creates a data structure that includes input and output data, as well as pointers to the decoder context and the MPP API (Application Programming Interface) so that the code can use threads to perform decoding operations. Among them, the pseudo code for the environment initialization in the above steps is shown in the following code:

[0047] {

[0048] MppDecoder* decoder = new MppDecoder();

[0049] decoder->Init(video_type, 30, &app_ctx, camera_id);

[0050] decoder->SetCallback(mpp_decoder_frame_callback);

[0051] app_ctx.decoder = decoder.

[0052] In this way, based on the dedicated hardware decoding chip that Rockchip officially equipped for the development board, this embodiment provides efficient hardware decoding capabilities through the MPP library, and the video decoding performance is greatly improved. In addition to the official C++ sample code, ZLMediaKit is integrated to achieve smooth streaming function, and with the help of the powerful function of Pybind11, it is encapsulated as a general .so dynamic library, so that developers are no longer restricted to specific programming languages. Whether it is Python, C++, Java, or other languages ​​that support calling C-style dynamic libraries, they can easily achieve efficient streaming and hardware decoding operations for multiple real-time video streams.

[0053] Step S13: Decode the data to be decoded using a preset decoding interface of the media processing software platform, and execute a corresponding video processing task based on the target video obtained after decoding.

[0054] In this embodiment, the executable command in the preset environment variable is called to perform the corresponding stream pulling operation to obtain the data to be decoded, and the preset decoding interface of the media processing software platform can be used to decode the data to be decoded, and the corresponding video processing task is performed based on the target video obtained after decoding.

[0055] Through the above technical solution, in this embodiment, the corresponding target component of the media processing software platform can be installed on the target hardware device based on the codec library of the media processing software platform, and the executable command corresponding to the media processing software platform can be added to the preset environment variable based on the target component. In the above process, Pybind11 can also be used to encapsulate the C++ code into a so library to solve the problem that developers are limited by C++ code, so that developers are no longer limited to a specific programming language. Then the data stream address of the data to be decoded sent by the target device can be received, and the streaming media server can call the executable command in the preset environment variable according to the data stream address to perform the corresponding stream pulling operation to obtain the data to be decoded, and then use the preset decoding interface of the media processing software platform to decode the data to be decoded, and perform the corresponding video processing task based on the target video obtained after decoding. Specifically, before the streaming media server calls the executable command in the preset environment variable according to the data stream address to perform the corresponding streaming operation, the relevant functional interface of MPI (Message Passing Interface) can also be used to initialize the environment of the multi-channel camera video stream, and the interface provided by MPP can be called to protect the decoding process, which can specifically include implementing the corresponding operation through pseudo code, and is not limited to the implementation of any programming language modified according to the pseudo code. In this way, the hardware video encoding and decoding capabilities of the chip can be fully utilized to solve the problem of high CPU resource occupation for video encoding and decoding in video analysis applications for video image analysis application software, release computing resources, reduce energy consumption, and encapsulate and improve the original interface so that developers are no longer restricted by programming languages. With the help of Pybind11 to encapsulate the general .so dynamic library, developers are no longer restricted by specific programming languages, and can easily achieve efficient streaming and encoding and decoding operations for multiple real-time video streams.

[0056] Based on the previous embodiment, it can be seen that the present application can improve the video encoding and decoding performance through the hardware decoding capability of the encoding and decoding library of the media processing software platform of the hardware decoding chip. Next, the present embodiment will elaborate on the process of implementing video analysis related tasks through the media processing software platform. Figure 3 As shown, the embodiment of the present application discloses a specific video analysis method, including:

[0057] Step S21: locally install a target component corresponding to the media processing software platform based on the codec library of the media processing software platform, and add an executable command corresponding to the media processing software platform to a preset environment variable based on the target component.

[0058] Step S22, receiving the data stream address of the data to be decoded through the video stream processing function, and calling the executable command in the preset environment variable to perform the corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded.

[0059] Step S23: Decode the data to be decoded using a preset decoding interface of the media processing software platform, and execute a corresponding video processing task based on the target video obtained after decoding.

[0060] In this embodiment, when the preset decoding interface of the media processing software platform is used to decode the data to be decoded, and the corresponding video processing task is performed based on the target video obtained after decoding, if the video processing task is a video playback task, the video format that supports the streaming media server for video recognition is determined, and the preset decoding interface of the media processing software platform is used to decode the data to be decoded based on the video format, and then the corresponding video processing task is performed based on the target video that meets the video format obtained after decoding. That is to say, if the video analysis task corresponding to the currently acquired data stream is only video playback, the video_rtsp_handler function is called to use ZLMediaKit to perform a stream pull operation, so that the data of the camera device is handed over to the ZLM streaming media server for processing, and the obtained data stream is converted into data that can be recognized by ZLMediaKit, and the video decoded during the processing can be played and paused.

[0061] And after decoding the data to be decoded, the target frame data obtained by decoding the data to be decoded can also be determined, and the number of current target frame data can be determined. If the number reaches the preset threshold, the preset callback function is used in the preset buffer to convert the target frame data into a target image, so as to perform the corresponding image recognition task based on the target image. In other words, if it is necessary to perform frame extraction image recognition processing on the video stream, the callback function mppdecode_framehandler can be triggered after decoding a frame of data to process the frame data, create a buffer in YUV (a color encoding method) format, and take out data of size 30 and put it into the buffer during the data decoding process. When the data is full of 25 frames (due to 25 frames per second for conventional video data), it is batch processed and converted into images. At this time, the format is RGB (Red, Green, Blue).

[0062] Specifically, when determining the target frame data obtained by decoding the data to be decoded, that is, when extracting the frame of the decoded data, the frame data pointer and timestamp corresponding to the data to be decoded can be obtained based on the preset pseudo code, and the decoder of the media processing software platform can be used to decode the data to be decoded according to the frame data pointer and timestamp to obtain the target frame data. The pseudo code for the above frame extraction process is as follows:

[0063] const char *data = mk_frame_get_data(frame); / / Get the frame data pointer;

[0064] ctx->dts = mk_frame_get_dts(frame); / / Get decoding timestamp in milliseconds;

[0065] ctx->pts = mk_frame_get_pts(frame); / / Get display timestamp in milliseconds;

[0066] size_t size = mk_frame_get_data_size(frame); / / Get the frame data pointer length;

[0067] / / printf("decoder=%p\n", ctx->decoder);

[0068] ctx->decoder->Decode((uint8_t *)data, size, 0); / / Call the decoder to decode.

[0069] For more specific processing procedures of the above steps S21 and S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described again here.

[0070] Through the above technical solution, in this embodiment, after obtaining the camera video stream, the video can be played and framed, and in this process, the hardware encoding and decoding capabilities provided by the chip itself can be directly used to process the video data. Specifically, the MPP API structure can be used to encapsulate the external API interface of the MPP for encoding and decoding, so as to maximize the use of the hardware computing power and reduce the consumption of CPU resources by software encoding and decoding. In this way, not only the flexibility and convenience of development are greatly improved, but also the powerful performance of Rockchip hardware decoding chip is fully utilized, which provides solid technical support for cross-language and cross-platform video processing applications, and is suitable for the use of video analysis related functions on resource-constrained edge devices.

[0071] See also Figure 4As shown, the embodiment of the present application also discloses a video decoding device, which is applied to a target hardware device, including:

[0072] A command adding module 11 is used to locally install a target component corresponding to the media processing software platform based on the codec library of the media processing software platform, and to add an executable command corresponding to the media processing software platform to a preset environment variable based on the target component;

[0073] The data acquisition module 12 is used to receive the data stream address of the data to be decoded through the video stream processing function, and call the executable command in the preset environment variable to perform the corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded;

[0074] The video decoding module 13 is used to decode the data to be decoded using a preset decoding interface of the media processing software platform, and perform corresponding video processing tasks based on the target video obtained after decoding.

[0075] This embodiment can first install the corresponding target component of the media processing software platform locally based on the codec library of the media processing software platform, and add the executable command corresponding to the media processing software platform to the preset environment variable based on the target component, and then receive the data stream address of the data to be decoded through the video stream processing function, and then call the executable command in the preset environment variable to perform the corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded, so as to use the preset decoding interface of the media processing software platform to decode the data to be decoded, and perform the corresponding video processing task based on the target video obtained after decoding. Through the above technical solution, the codec library of the media processing software platform of the hardware decoding chip provides efficient hardware decoding capabilities, so that the video codec performance is greatly improved, which helps to solve the problem of high CPU resources occupied by video codecs implemented by software when developing video analysis applications, and can effectively release computing resources and reduce chip energy consumption.

[0076] In some specific embodiments, the video decoding device further includes:

[0077] A code encapsulation module is used to encapsulate the target code into a corresponding shared library file through a preset template library, and add the shared library file to the preset environment variable, so that the streaming media server calls the shared library file in the preset environment variable according to the data stream address to perform the corresponding streaming operation;

[0078] The target code is a code constructed based on a target programming language, and the target programming language is a programming language different from the programming language corresponding to the executable command.

[0079] In some specific embodiments, the data acquisition module 12 specifically includes:

[0080] A data receiving unit, used for receiving a plurality of data stream addresses corresponding to the data to be decoded through the video stream processing function, and starting threads corresponding to the data stream addresses one by one;

[0081] The operation execution submodule is used to call the executable command in the preset environment variable through the thread, so as to utilize the streaming media server to perform the corresponding streaming operation according to the data stream address.

[0082] In some specific embodiments, the operation execution submodule specifically includes:

[0083] A configuration acquisition unit, configured to call a preset decoder initialization command in the preset environment variable to initialize the decoder of the media processing software platform, and acquire a default configuration of the decoder through the media processing software platform and based on the preset decoder configuration acquisition command in the preset environment variable;

[0084] A decoder configuration unit is used to configure the decoder according to the preset decoder configuration command in the preset environment variable and based on the default configuration, so as to perform corresponding streaming operations using the configured decoder through the streaming media server.

[0085] In some specific embodiments, the video decoding module 13 specifically includes:

[0086] a format determination unit, configured to determine a video format that supports video recognition by the streaming media server if the video processing task is a video playback task;

[0087] The first data decoding unit is used to decode the data to be decoded based on the video format using the preset decoding interface of the media processing software platform, and perform corresponding video processing tasks based on the target video that meets the video format obtained after decoding.

[0088] In some specific embodiments, the video decoding device further includes:

[0089] A quantity decoding module, used to determine the target frame data currently obtained by decoding the data to be decoded, and determine the quantity of the current target frame data;

[0090] The data conversion module is used to convert the target frame data into a target image using a preset callback function in a preset buffer if the number reaches a preset threshold, so as to perform a corresponding image recognition task based on the target image.

[0091] In some specific embodiments, the quantity determination module specifically includes:

[0092] A parameter acquisition unit, used for acquiring a frame data pointer and a timestamp corresponding to the data to be decoded based on a preset pseudo code;

[0093] The second data decoding unit is used to decode the data to be decoded using the decoder of the media processing software platform according to the frame data pointer and the timestamp to obtain the target frame data.

[0094] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be considered as any limitation on the scope of use of the present application.

[0095] Figure 5 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the video decoding method disclosed in any of the above embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0096] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0097] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0098] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the video decoding method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0099] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the video decoding method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0100] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0101] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0102] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0103] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0104] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A video decoding method, characterized in that: Applied to target hardware devices, including: Based on the codec library of the media processing software platform, a target component corresponding to the media processing software platform is installed locally, and based on the target component, an executable command corresponding to the media processing software platform is added to a preset environment variable; The data stream address of the data to be decoded is received through the video stream processing function, and the executable command in the preset environment variable is called to perform a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded; The data to be decoded is decoded using a preset decoding interface of the media processing software platform, and a corresponding video processing task is performed based on the target video obtained after decoding.

2. The video decoding method according to claim 1, characterized in that: Also includes: Encapsulating the target code into a corresponding shared library file through a preset template library, and adding the shared library file to the preset environment variable, so that the streaming media server calls the shared library file in the preset environment variable according to the data stream address to perform a corresponding streaming operation; The target code is a code constructed based on a target programming language, and the target programming language is a programming language different from the programming language corresponding to the executable command.

3. The video decoding method according to claim 1, characterized in that: The step of receiving the data stream address of the data to be decoded through the video stream processing function and calling the executable command in the preset environment variable to perform the corresponding stream pulling operation according to the data stream address through the streaming media server includes: Receiving a plurality of data stream addresses corresponding to the data to be decoded through the video stream processing function, and starting threads corresponding to the data stream addresses one by one; The executable command in the preset environment variable is called through the thread, so as to utilize the streaming media server to perform the corresponding streaming operation according to the data stream address.

4. The video decoding method according to claim 3, characterized in that: The calling of the executable command in the preset environment variable to use the streaming media server to perform a corresponding stream pulling operation according to the data stream address includes: Calling a preset decoder initialization command in the preset environment variable to initialize the decoder of the media processing software platform, and obtaining a default configuration of the decoder through the media processing software platform and based on a preset decoder configuration acquisition command in the preset environment variable; The decoder is configured according to the preset decoder configuration command in the preset environment variable and based on the default configuration, so that the corresponding streaming operation is performed by the streaming media server using the configured decoder.

5. The video decoding method according to any one of claims 1 to 4, characterized in that: The method of decoding the data to be decoded by using the preset decoding interface of the media processing software platform and performing corresponding video processing tasks based on the target video obtained after decoding includes: If the video processing task is a video playback task, determining a video format that supports the streaming media server to perform video recognition; The preset decoding interface of the media processing software platform is used to decode the data to be decoded based on the video format, and a corresponding video processing task is performed based on the target video that meets the video format obtained after decoding.

6. The video decoding method according to claim 5, characterized in that: After the preset decoding interface of the media processing software platform is used to decode the data to be decoded based on the video format, the method further includes: Determine target frame data currently obtained by decoding the data to be decoded, and determine the amount of the current target frame data; If the number reaches a preset threshold, the target frame data is converted into a target image using a preset callback function in a preset buffer, so as to perform a corresponding image recognition task based on the target image.

7. The video decoding method according to claim 6, characterized in that: The determining target frame data currently obtained by decoding the data to be decoded includes: Acquire a frame data pointer and a timestamp corresponding to the data to be decoded based on a preset pseudo code; The data to be decoded is decoded using a decoder of the media processing software platform according to the frame data pointer and the timestamp to obtain the target frame data.

8. A video decoding device, characterized in that: Applied to target hardware devices, including: A command adding module, used to locally install a target component corresponding to the media processing software platform based on the codec library of the media processing software platform, and add an executable command corresponding to the media processing software platform to a preset environment variable based on the target component; A data acquisition module, used for receiving the data stream address of the data to be decoded through the video stream processing function, and calling the executable command in the preset environment variable to perform a corresponding stream pulling operation according to the data stream address through the streaming media server to obtain the data to be decoded; The video decoding module is used to decode the data to be decoded using a preset decoding interface of the media processing software platform, and to perform corresponding video processing tasks based on the target video obtained after decoding.

9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the video decoding method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the video decoding method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Video processing method and device, video processing equipment and storage medium

    CN116847100A

  • Video stream playing method, device and equipment and readable storage medium

    CN117692681A

  • Video monitoring method and device, electronic equipment and storage medium

    CN118573808A

  • Algorithm SDK compiling and packaging method and device and storage medium

    CN118963768A

Cited By

  • Multi-version FFmpeg switching method and device and medium

    CN119865664A