Decoding method based on video distribution service

By adopting a video decoding method combined with QT and ffmpeg in a multi-system environment, and using video distribution services for video decoding and playback, the problem of real-time video decoding and real-time playback under multiple systems is solved, and the efficiency and fluency of video decoding and transmission are achieved.

CN119520805APending Publication Date: 2025-02-25TIANJIN JINHANG COMP TECH RES INST
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411599309.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Under multiple systems, it is difficult for the prior art to realize real-time playback of video decoding, especially in a cross-network communication environment between sea and land.

Method used

The decoding method based on the combination of QT and ffmpeg is adopted to transmit, decode and display the remote network code stream through the video distribution service, and cross-platform video decoding and playback are realized.

Benefits of technology

This method effectively solves the problems of video decoding and transmission under multiple systems, reduces decoding time and playback delay, and ensures the smoothness of video playback.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a decoding method based on a video distribution service. The decoding method comprises the following steps: S1, formulating a video distribution service rule; s2, creating a compiling environment; s3, decoding resources are initialized; s4, acquiring video data of the video distribution service; s5, decoding the video data; s6, carrying out format conversion on the decoded image frame; s7, obtaining the image frame after format conversion and displaying the image frame in real time; and S8, releasing decoding channel resources. According to the invention, a soft decoding method is adopted, the decoding time is effectively reduced, the video stream is acquired by adopting the video distribution rule, the playing delay is effectively reduced, and the fluency of video playing is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video decoding under a cross-platform system. In an application scenario where the system is uncertain, the present invention aims at the decoding characteristics of ffmpeg and combines the QT module to design a display image solution, and designs and implements a video decoding solution design method compatible with multiple system types. The present invention is a system of uncertain types, and the application environment is a cross-network communication between sea and land. First, a video distribution service is used to transmit a remote network code stream, effectively obtain a video stream, decode the code stream according to its encoding characteristics, and display the decoded image, thereby completing the decoding, playback and display process. Background Art

[0002] Qt is a cross-platform graphical user interface application development framework that can build high-performance desktop, mobile and web application frameworks. It can also be used to develop non-GUI programs, such as console tools and servers. Qt is an object-oriented framework that uses special code generation extensions and some macros. Qt is easy to extend and allows real component programming.

[0003] Ffmpeg is an open source computer program that can be used to record, convert digital audio and video, and convert them into streams. It provides a complete solution for recording, converting and streaming audio and video. It contains a very advanced audio / video codec library.

[0004] In projects with unclear requirements, choosing a cross-platform tool for development can save development costs. The combination of Qt and ffmpeg can solve the problem of multi-platform compatibility and facilitate the transplantation of module content. In the land and sea communication environment, it is necessary to solve the problem of cross-network video transmission. Establishing a video service can effectively solve the problem of effective transmission of video streams. Summary of the invention

[0005] (I) Purpose of the invention

[0006] The purpose of the present invention is to solve the problem of real-time video decoding and playback under multiple systems, adopt a decoding method based on QT and ffmpeg, and provide a decoding method based on video distribution service.

[0007] (II) Technical solution

[0008] In order to solve the above technical problems, the present invention provides a decoding method based on video distribution service, which comprises the following steps:

[0009] S1: Formulate video distribution service rules;

[0010] S2: Create a compilation environment;

[0011] S3: Initialize decoding resources;

[0012] S4: Obtain video data of the video distribution service;

[0013] S5: Decode the video data;

[0014] S6: Convert the format of the decoded image frame;

[0015] S7: Obtain the image frame after the format conversion and display it in real time;

[0016] S8: Release the decoding channel resources.

[0017] The video distribution service rules formulated in step S1 include:

[0018] S11: Application Registration

[0019] The offshore equipment or the onshore equipment sends a registration request to the communication system service center. After successful registration, the file and message service transmission is optimized;

[0020] S12: Registration message format

[0021] It is divided into three fields: application system identification, application system entity number, and sender IP;

[0022] S13: Registration Feedback

[0023] When the transmission service software receives the application registration message, it sends it to the application system;

[0024] S14: Registration feedback message format

[0025] It is divided into three fields: application system identification, application system entity number, and feedback result;

[0026] S15: Application logout

[0027] S16: Logout message format

[0028] It is divided into three fields: application system identification, application system entity number, and sender IP;

[0029] S17: Message transmission

[0030] Message applications provide service transmission requests and carry message service data;

[0031] S18: Sending message format

[0032] It is divided into the following fields: unified business identification, message transmission type, sender's application system identification, sender's application entity identification, number of receivers, receiver information, business information type, reliability, priority, timeout, data size, and data content;

[0033] S19: The receiving message format is the same as the sending message format.

[0034] In step S2, the process of creating a compilation environment is:

[0035] S21: Get the dynamic library files libacodec.lib, libavformat.lib, libavutil.lib and libswscale.lib in ffmpeg and copy them to the working directory lib;

[0036] S22: Copy the included header file of ffmpeg to the include of the project directory;

[0037] S23: Add the environment variable FFMPEGLIBPATH to the system and set the environment variable to the lib in the project directory;

[0038] S24: Add an external library to the qt project file, add the library file of step S21, and select the path indicated by step S23.

[0039] In step S3, a new thread class decode is created in the qt project directory. The steps of implementing decoding initialization resources in the thread class decode are as follows:

[0040] S31: Use the library function av_packet_alloc to create a data packet object pkt. If the creation is successful, proceed to the next step, otherwise exit the process;

[0041] S32: Use the library function avcodec_find_decoder to create a decoder codec. If the creation is successful, proceed to the next step, otherwise exit the process;

[0042] S33: Use the library function av_parser_init to create a data packet analysis object parser. If the creation is successful, proceed to the next step, otherwise exit the process;

[0043] S34: Use the library function avcodec_alloc_context3 to create a decoding environment context object. If the creation is successful, proceed to the next step, otherwise exit the process;

[0044] S35: Use the library function avcodec_oepn2 to open the decoder. If it fails, exit the process, otherwise proceed to the next step;

[0045] S36: Use the library function av_frame_alloc to create an image frame object frame. If it fails, exit the process, otherwise proceed to the next step.

[0046] In step S4, the process of obtaining video data of the video distribution service is as follows:

[0047] S41: Create a new network receiving thread netrecv;

[0048] S42: extracting the message content of the video transmission according to the protocol message identifier;

[0049] S43: lock the semaphore;

[0050] S44: storing the video data in a data queue;

[0051] S45: unlock the semaphore;

[0052] S46: Create a thread for obtaining video data;

[0053] S47: Enter the process of cyclically reading the data queue;

[0054] S48: Determine whether the data queue is empty, if so, delay 10us, otherwise proceed to the next step;

[0055] S49: lock the semaphore;

[0056] S410: Check whether the length of the queue is less than the maximum data length. If so, set the length len to be taken this time to the queue length; otherwise, set the length len to the maximum length;

[0057] S411: Take out data of length len from the queue in sequence and store them in the array inbuf;

[0058] S412: unlock the semaphore;

[0059] S413: Set the length of the data packet data_size to len;

[0060] S414: Assign the pointer of array inbuf to data;

[0061] S415: performing a process of analyzing the data packet;

[0062] S416: Determine whether data_size is greater than 0, if so, proceed to the next step, otherwise exit the analysis process;

[0063] S417: Use the library function av_parser_parser2 to analyze the data data and convert it into a data packet packet. The length of the converted data packet is stored in ret. If the conversion is successful, proceed to the next step. Otherwise, print an error message and exit the process.

[0064] S418: Move the pointer of array data by the length of ret, which is the length of array data_size minus the length of ret;

[0065] S419: Determine whether the size of the converted data packet is greater than zero, if so, proceed to the next decoding process, if not, jump to step S415.

[0066] In step S5, the process of decoding the video data is as follows:

[0067] S51: Use the library function avcode_send_packet to send the video stream data packet object packet obtained in process S3 to the decoder. If the sending fails, an error is reported and the process is exited, otherwise proceed to the next step;

[0068] S52: Entering the process of looping to obtain decoded image frames;

[0069] S53: determining whether the result ret of acquiring the image frame is greater than or equal to zero, if so, proceeding to another step, otherwise exiting the loop process of acquiring the image frame;

[0070] S54: using the library function avcodec_receive_frame to obtain the video frame where the context object dec_ctx is located, if the acquisition is successful, it is stored in the image frame object frame and the next step is performed, if it fails, an error message is printed and the process is exited;

[0071] S55: Use the system function fflush to force the decoder to output the image frame.

[0072] In step S6, the process of format conversion of the decoded image frame is as follows:

[0073] S61: Use library function av_frame_alloc to create rgb image frame rgbFrame;

[0074] S62: Use the library function avpicture_get_size to calculate the data size numBytes required for conversion into rgb24 format;

[0075] S63: Use the library function av_malloc to dynamically apply for the array rgbBuffer for storing rgb image data, the size of which is numBytes*sizeof(uint8_t);

[0076] S64: Use the library function avpicture_fill to index the array of rgb image frame rgbFrame into rgbBuffer;

[0077] S65: Determine whether the conversion context object image_convert_ctx is empty, if not, use the library function sws_freeContext to release the object, otherwise proceed to the next step;

[0078] S66: Use the library function sws_getContext to create the conversion context pair image_convert_ctx;

[0079] S67: Determine whether the context pair image_convert_ctx for format conversion is empty, if so, exit the process, otherwise proceed to the next step;

[0080] S68: Use the library function sws_scale to convert the image frame frame, and store the data in rgbFrame, and store the conversion result in result;

[0081] S69: Determine whether the conversion result is successful, if yes, proceed to the next step, otherwise exit the process;

[0082] S610: Send the converted image frame rgbBuffer to the interface.

[0083] The implementation steps of step S7 are as follows:

[0084] S71: Determine whether the image frame object pointer is null, if so, exit the process, otherwise proceed to the next step;

[0085] S72: Create an image display object image, the object type is QImage;

[0086] S73: Create a pixel map object pix, the object type is QPixmap;

[0087] S74: Get the display image object pointer image_display of the QLabel class;

[0088] S75: Use the system function setPixmap to set the image object pointer image_display to display the image, and the parameter content is the return object of the pix executing the fromImage function.

[0089] The implementation steps of step S8 are as follows:

[0090] S81: Use the library function av_parser_close to close the data packet analysis object parser;

[0091] S82: Use the library function avcodec_free_context to release the decoding context object context;

[0092] S83: Use the library function av_packet_free to release the data packet object packet;

[0093] S84: Use library function av_frame_free to release the image frame object frame;

[0094] S85: Use the library function av_free to release the converted rgb array rgbBuffer.

[0095] (III) Beneficial effects

[0096] The decoding method based on video distribution service provided by the above technical solution can solve the problem of video decoding and transmission under multiple systems. The method has been verified by algorithms and experimentally tested. The results show that the solution can solve the problem of image decoding by using a soft decoding method to effectively reduce the decoding time. At the same time, it uses visual distribution rules to obtain video streams, effectively reducing playback delays and ensuring the smoothness of video playback. DETAILED DESCRIPTION

[0097] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with embodiments.

[0098] The decoding method based on the video distribution service of this embodiment includes the following steps:

[0099] S1: Formulate video distribution service rules

[0100] S11: Application registration. The offshore device or the onshore device sends a registration request to the communication system service center. The timing of sending is when the application system is turned on or a new software module is online. The application registers to the transmission service through this interface. After successful registration, the transmission of files, messages and other services can be optimized.

[0101] S12: Registration message format. It is divided into four fields: application system identifier, application system entity number, and sender IP.

[0102] S13: Registration feedback. The transmission service software sends the application system when receiving the application registration message;

[0103] S14: Registration feedback message format. It is divided into three fields: application system identifier, application system entity number, and feedback result.

[0104] S15: Application deregistration. The application deregisters through this interface.

[0105] S16: Logout message format. It is divided into three fields: application system ID, system entity number, and sender IP.

[0106] S17: Message transmission: Message applications provide service transmission requests and carry message service data.

[0107] S18: Sending message format. It is divided into the following fields: business unified identifier (used to indicate a message task), message transmission type (divided into point-to-point and point-to-multipoint), sender's application system identifier, sender's application entity identifier, number of receivers, receiver information (receiver application 1 system identifier, receiver application 1 entity identifier...receiver application N system identifier, receiver application N entity identifier), business information type, reliability, priority, timeout, data size, and data content.

[0108] S19: The receiving message format is the same as the sending message format.

[0109] S2: Create a compilation environment

[0110] S21: First, obtain the dynamic library files libacodec.lib, libavformat.lib, libavutil.lib, libswscale.lib in ffmpeg (dynamic library files of different systems have different suffixes, adjust according to the specific situation) and copy them to the working directory lib.

[0111] S22: Copy the included header file of ffmpeg to the include of the project directory;

[0112] S23: Add the environment variable FFMPEGLIBPATH to the system and set the environment variable to the lib in the project directory.

[0113] S24: Add an external library to the qt project file, add the library file of step S21, and select the path indicated by step S23.

[0114] S3: Initialize decoding resources

[0115] Create a new thread class decode in the QT project directory, which inherits QThread.

[0116] The specific steps to implement decoding initialization resources in this class are as follows:

[0117] S31: Use the library function av_packet_alloc to create a data packet object pkt. If the creation is successful, proceed to the next step, otherwise exit the process;

[0118] S32: Use the library function avcodec_find_decoder to create a decoder codec. If the creation is successful, proceed to the next step, otherwise exit the process;

[0119] S33: Use the library function av_parser_init to create a data packet analysis object parser. If the creation is successful, proceed to the next step, otherwise exit the process;

[0120] S34: Use the library function avcodec_alloc_context3 to create a decoding environment context object. If the creation is successful, proceed to the next step, otherwise exit the process;

[0121] S35: Use the library function avcodec_oepn2 to open the decoder. If it fails, exit the process, otherwise proceed to the next step;

[0122] S36: Use the library function av_frame_alloc to create an image frame object frame. If it fails, exit the process, otherwise proceed to the next step;

[0123] S4: Obtaining video data from the video distribution service

[0124] S41: Create a new network receiving thread netrecv;

[0125] S42: extracting the message content of the video transmission according to the protocol message identifier;

[0126] S43: lock the semaphore;

[0127] S44: storing the video data in a data queue;

[0128] S45: unlock the semaphore;

[0129] S46: Create a thread for obtaining video data;

[0130] S47: Enter the process of cyclically reading the data queue;

[0131] S48: Determine whether the data queue is empty, if so, delay 10us, otherwise proceed to the next step;

[0132] S49: lock the semaphore;

[0133] S410: Check whether the length of the queue is less than the maximum data length. If so, set the length len to be taken this time to the queue length; otherwise, set the length len to the maximum length;

[0134] S411: Take out data of length len from the queue in sequence and store them in the array inbuf;

[0135] S412: unlock the semaphore;

[0136] S413: Set the length of the data packet data_size to len;

[0137] S414: Assign the pointer of array inbuf to data;

[0138] S415: performing a process of analyzing the data packet;

[0139] S416: Determine whether data_size is greater than 0, if so, proceed to the next step, otherwise exit the analysis process;

[0140] S417: Use the library function av_parser_parser2 to analyze the data data and convert it into a data packet packet. The length of the converted data packet is stored in ret. If the conversion is successful, proceed to the next step. Otherwise, print an error message and exit the process.

[0141] S418: Move the pointer of array data by the length of ret, which is the length of array data_size minus the length of ret;

[0142] S419: Determine whether the size of the converted data packet is greater than zero, if so, proceed to the next decoding process, if not, jump to step S415;

[0143] S5: Decoding video data

[0144] The specific steps are as follows:

[0145] S51: Use the library function avcode_send_packet to send the video stream data packet object packet obtained in process 3 to the decoder. If the sending fails, an error is reported and the process is exited, otherwise proceed to the next step;

[0146] S52: Entering the process of looping to obtain decoded image frames;

[0147] S53: determining whether the result ret of acquiring the image frame is greater than or equal to zero, if so, proceeding to another step, otherwise exiting the loop process of acquiring the image frame;

[0148] S54: using the library function avcodec_receive_frame to obtain the video frame where the context object dec_ctx is located, if the acquisition is successful, it is stored in the image frame object frame and the next step is performed, if it fails, an error message is printed and the process is exited;

[0149] S55: Use the system function fflush to force the decoder to output the image frame;

[0150] S6: Convert the decoded image frame into a new format

[0151] The decoded image is in YUV format and cannot be directly displayed in the QT interface. The YUV format needs to be converted into RGB format. The specific steps are as follows:

[0152] S61: Use library function av_frame_alloc to create rgb image frame rgbFrame;

[0153] S62: Use the library function avpicture_get_size to calculate the data size numBytes required for conversion into rgb24 format;

[0154] S63: Use the library function av_malloc to dynamically apply for an array rgbBuffer for storing RGB image data, the size of which is numBytes*sizeof(uint8_t) (i.e., one byte multiplied by the required data size, converted into bits);

[0155] S64: Use the library function avpicture_fill to index the array of rgb image frame rgbFrame into rgbBuffer;

[0156] S65: Determine whether the conversion context object image_convert_ctx is empty, if not, use the library function sws_freeContext to release the object, otherwise proceed to the next step;

[0157] S66: Use the library function sws_getContext to create the conversion context pair image_convert_ctx;

[0158] S67: Determine whether the context pair image_convert_ctx for format conversion is empty, if so, exit the process, otherwise proceed to the next step;

[0159] S68: Use the library function sws_scale to convert the image frame frame, and store the data in rgbFrame, and store the conversion result in result;

[0160] S69: Determine whether the conversion result is successful, if yes, proceed to the next step, otherwise exit the process;

[0161] S610: Send the converted image frame rgbBuffer to the interface;

[0162] S7: Get the converted image frame and display it in real time

[0163] The specific steps are as follows:

[0164] S71: Determine whether the image frame object pointer is null, if so, exit the process, otherwise proceed to the next step;

[0165] S72: Create an image display object image, the object type is QImage;

[0166] S73: Create a pixel map object pix, the object type is QPixmap;

[0167] S74: Get the display image object pointer image_display of the QLabel class;

[0168] S75: Use the system function setPixmap to set the image object pointer image_display to display the image, and the parameter content is the return object of the pix execution fromImage function;

[0169] S8: Release the decoding channel resources

[0170] The specific steps are as follows:

[0171] S81: Use the library function av_parser_close to close the data packet analysis object parser;

[0172] S82: Use the library function avcodec_free_context to release the decoding context object context;

[0173] S83: Use the library function av_packet_free to release the data packet object packet;

[0174] S84: Use library function av_frame_free to release the image frame object frame;

[0175] S85: Use the library function av_free to release the converted rgb array rgbBuffer.

[0176] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A decoding method based on video distribution service, characterized in that: The following steps are involved: S1: Formulate video distribution service rules; S2: Create a compilation environment; S3: Initialize decoding resources; S4: Obtain video data of the video distribution service; S5: Decode the video data; S6: Convert the format of the decoded image frame; S7: Obtain the image frame after the format conversion and display it in real time; S8: Release the decoding channel resources.

2. The decoding method based on video distribution service according to claim 1, characterized in that: The video distribution service rules formulated in step S1 include: S11: Application Registration The offshore equipment or the onshore equipment sends a registration request to the communication system service center. After successful registration, the file and message service transmission is optimized; S12: Registration message format It is divided into three fields: application system identification, application system entity number, and sender IP; S13: Registration Feedback When the transmission service software receives the application registration message, it sends it to the application system; S14: Registration feedback message format It is divided into three fields: application system identification, application system entity number, and feedback result; S15: Application logout S16: Logout message format It is divided into three fields: application system identification, application system entity number, and sender IP; S17: Message transmission Message applications provide service transmission requests and carry message service data; S18: Sending message format It is divided into the following fields: unified business identification, message transmission type, sender's application system identification, sender's application entity identification, number of receivers, receiver information, business information type, reliability, priority, timeout, data size, and data content; S19: The receiving message format is the same as the sending message format.

3. The decoding method based on video distribution service according to claim 2, characterized in that: In step S2, the process of creating a compilation environment is: S21: Get the dynamic library files libacodec.lib, libavformat.lib, libavutil.lib and libswscale.lib in ffmpeg and copy them to the working directory lib; S22: Copy the included header file of ffmpeg to the include of the project directory; S23: Add the environment variable FFMPEGLIBPATH to the system and set the environment variable to the lib in the project directory; S24: Add an external library to the qt project file, add the library file of step S21, and select the path indicated by step S23.

4. The decoding method based on video distribution service as claimed in claim 3, characterized in that: In step S3, a new thread class decode is created in the qt project directory. The steps of implementing decoding initialization resources in the thread class decode are as follows: S31: Use the library function av_packet_alloc to create a data packet object pkt. If the creation is successful, proceed to the next step, otherwise exit the process; S32: Use the library function avcodec_find_decoder to create a decoder codec. If the creation is successful, proceed to the next step, otherwise exit the process; S33: Use the library function av_parser_init to create a data packet analysis object parser. If the creation is successful, proceed to the next step, otherwise exit the process; S34: Use the library function avcodec_alloc_context3 to create a decoding environment context object. If the creation is successful, proceed to the next step, otherwise exit the process; S35: Use the library function avcodec_oepn2 to open the decoder. If it fails, exit the process, otherwise proceed to the next step; S36: Use the library function av_frame_alloc to create an image frame object frame. If it fails, exit the process, otherwise proceed to the next step.

5. The decoding method based on video distribution service according to claim 4, characterized in that: In step S4, the process of obtaining video data of the video distribution service is as follows: S41: Create a new network receiving thread netrecv; S42: extracting the message content of the video transmission according to the protocol message identifier; S43: lock the semaphore; S44: storing the video data in a data queue; S45: unlock the semaphore; S46: Create a thread for obtaining video data; S47: Enter the process of cyclically reading the data queue; S48: Determine whether the data queue is empty, if so, delay 10us, otherwise proceed to the next step; S49: lock the semaphore; S410: Check whether the length of the queue is less than the maximum data length. If so, set the length len to be taken this time to the queue length; otherwise, set the length len to the maximum length; S411: Take out data of length len from the queue in sequence and store them in the array inbuf; S412: unlock the semaphore; S413: Set the length of the data packet data_size to len; S414: Assign the pointer of array inbuf to data; S415: performing a process of analyzing the data packet; S416: Determine whether data_size is greater than 0, if so, proceed to the next step, otherwise exit the analysis process; S417: Use the library function av_parser_parser2 to analyze the data data and convert it into a data packet packet. The length of the converted data packet is stored in ret. If the conversion is successful, proceed to the next step. Otherwise, print an error message and exit the process. S418: Move the pointer of array data by the length of ret, which is the length of array data_size minus the length of ret; S419: Determine whether the size of the converted data packet is greater than zero, if so, proceed to the next decoding process, if not, jump to step S415.

6. The decoding method based on video distribution service according to claim 5, characterized in that: In step S5, the process of decoding the video data is as follows: S51: Use the library function avcode_send_packet to send the video stream data packet object packet obtained in process S3 to the decoder. If the sending fails, an error is reported and the process is exited, otherwise proceed to the next step; S52: Entering the process of looping to obtain decoded image frames; S53: determining whether the result ret of acquiring the image frame is greater than or equal to zero, if so, proceeding to another step, otherwise exiting the loop process of acquiring the image frame; S54: using the library function avcodec_receive_frame to obtain the video frame where the context object dec_ctx is located, if the acquisition is successful, it is stored in the image frame object frame and the next step is performed, if it fails, an error message is printed and the process is exited; S55: Use the system function fflush to force the decoder to output the image frame.

7. The decoding method based on video distribution service according to claim 6, characterized in that: In step S6, the process of format conversion of the decoded image frame is as follows: S61: Use library function av_frame_alloc to create rgb image frame rgbFrame; S62: Use the library function avpicture_get_size to calculate the data size numBytes required for conversion into rgb24 format; S63: Use the library function av_malloc to dynamically apply for the array rgbBuffer for storing rgb image data, the size of which is numBytes*sizeof(uint8_t); S64: Use the library function avpicture_fill to index the array of rgb image frame rgbFrame into rgbBuffer; S65: Determine whether the conversion context object image_convert_ctx is empty, if not, use the library function sws_freeContext to release the object, otherwise proceed to the next step; S66: Use the library function sws_getContext to create the conversion context pair image_convert_ctx; S67: Determine whether the context pair image_convert_ctx for format conversion is empty, if so, exit the process, otherwise proceed to the next step; S68: Use the library function sws_scale to convert the image frame frame, and store the data in rgbFrame, and store the conversion result in result; S69: Determine whether the conversion result is successful, if yes, proceed to the next step, otherwise exit the process; S610: Send the converted image frame rgbBuffer to the interface.

8. The decoding method based on video distribution service according to claim 7, characterized in that: The implementation steps of step S7 are as follows: S71: Determine whether the image frame object pointer is null, if so, exit the process, otherwise proceed to the next step; S72: Create an image display object image, the object type is QImage; S73: Create a pixel map object pix, the object type is QPixmap; S74: Get the display image object pointer image_display of the QLabel class; S75: Use the system function setPixmap to set the image object pointer image_display to display the image, and the parameter content is the return object of the pix executing the fromImage function.

9. The decoding method based on video distribution service according to claim 8, characterized in that: The implementation steps of step S8 are as follows: S81: Use the library function av_parser_close to close the data packet analysis object parser; S82: Use the library function avcodec_free_context to release the decoding context object context; S83: Use the library function av_packet_free to release the data packet object packet; S84: Use library function av_frame_free to release the image frame object frame; S85: Use the library function av_free to release the converted rgb array rgbBuffer.

10. An application of a decoding method based on a video distribution service according to any one of claims 1 to 9 in the field of video decoding technology in a cross-platform system.

Citation Information

Patent Citations

  • Cloud computing based digital campus audio / video distribution system and method

    CN102355491A

  • Video decoding optimization method

    CN105100803A

  • Video distribution method and base station

    CN110418194A

  • Rapid development method based on SoC NVR display system

    CN112486487A

  • Source decoding method for reducing video transmission delay

    CN115776580A