Multi-format audio and video stream pushing method and device

By decoding and processing multi-format audio and video data, the push and streaming of audio and video data of multiple formats is solved, and the problem of only one format is only supported in the prior art, reducing operational complexity and improving streaming efficiency.

CN119544680APending Publication Date: 2025-02-28广州市迪士普音响科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411633516.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art audio and video streaming technology usually can only support audio and video data in one format, and it is difficult to process audio and video data in multiple formats. In addition, traditional ffmpeg operations are complex and require professional knowledge.

Method used

By obtaining and decoding the audio and video files to be pushed, the audio and video parameter data and audio and video data are obtained, and the reading process is performed according to the preset file reading method to obtain the frame data set. Then parse the audio and video parameter data to obtain the multicast address data, and push the frame data set to the multicast address data according to the preset output file format, and calculate the time of pushing the completion of the stream.

Benefits of technology

The pushing of multi-format audio and video data is realized, reducing the difficulty and complexity of pushing streaming operations, improving the flexibility and adaptability of audio and video streaming, and improving the system pushing streaming efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544680A_ABST
    Figure CN119544680A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-format audio and video stream pushing method and device, and the method comprises the steps: decoding obtained audio and video data to be subjected to stream pushing, obtaining audio and video data and audio and video parameter data, reading the audio and video data according to a file reading mode, and obtaining a frame data set; and analyzing the audio and video parameter data to obtain multicast address data, pushing the frame data set to a multicast address according to an output file format, and calculating stream pushing completion time according to the audio and video parameter data until stream pushing of the frame data set is completed. The audio and video data are subjected to file coding, so that the security and the stability during data transmission are improved; the data in the frame data set is pushed to the multicast address, so that the step of setting up a streaming media server to distribute the stream is reduced, and the stream pushing efficiency of the system is improved; through the stream pushing method, stream pushing of the multi-format audio and video data is realized, and the difficulty and complexity of stream pushing operation are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio and video streaming, and in particular to a method and device for streaming multi-format audio and video. Background Art

[0002] With the continuous development of Internet technology, audio and video processing technology, streaming media transmission technology and multi-format conversion technology have become indispensable and important technologies in the modern information society. Audio and video processing technology mainly studies and implements the collection, editing, playback and transmission of audio and video data, while streaming media transmission technology mainly studies the real-time transmission and distribution of audio and video data in the network.

[0003] In the field of audio and video processing technology of the prior art, ffmpeg, as a very popular open source multimedia processing tool, can be used for editing, playing, transcoding and real-time streaming of audio and video data; in the field of streaming media transmission technology, the rtmp protocol, as a commonly used audio and video stream transmission protocol, can be used to realize real-time transmission and distribution of audio and video data.

[0004] However, the existing technology also has its limitations. First, traditional audio and video streaming technology usually can only support audio and video data in one format, which has certain limitations for applications that need to process audio and video data in multiple formats at the same time; secondly, traditional ffmpeg operations require users to have certain professional knowledge and technical capabilities, which may be difficult for some non-technical personnel. Summary of the invention

[0005] The present invention provides a method and device for streaming multi-format audio and video, so as to achieve the technical effect of simultaneously processing audio and video data of multiple different formats and reducing the operational complexity of streaming multi-format audio and video data.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a method for streaming multi-format audio and video, comprising the following steps:

[0007] Acquire and decode the audio and video file to be pushed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set;

[0008] Parse the audio and video parameter data to obtain multicast address data, push the frame data set to the multicast address data according to a preset output file format, and calculate and determine the push completion time based on the audio and video parameter data until the push of the frame data set is completed.

[0009] The streaming method provided by the present invention first needs to obtain and decode the audio and video data to be streamed, that is, to decode the encoded audio and video files obtained in real time, and to improve the security and stability of data transmission by encoding the audio and video data. After the file data packet is decoded to obtain the transmitted file data, it will also be divided into audio and video data that need to be streamed and streaming parameters related to the streaming process, that is, audio and video parameter data, according to different data types. After the division is determined, the system will perform data reading and processing on the determined audio and video data according to a certain file reading method to obtain a frame data set, that is, the audio and video data that needs to be streamed is divided into a number of frames of corresponding audio and video data in units of frames, and the set of the several frames of audio and video data is obtained by integration, that is, the frame data set.

[0010] After obtaining the frame data set, the system will parse the determined audio and video parameter data, that is, the parameter data used to adjust the parameters of the push streaming process, and determine the multicast address data therein, that is, the address data of the destination terminal for the push streaming. After determining the address data, all the data in the frame data set will be pushed to the multicast address according to the determined output file format, that is, the frame data will be pushed according to the address of the determined destination terminal, realizing the push streaming application of multi-format audio and video data, and improving the flexibility and adaptability of audio and video push streaming. At the same time, the system directly pushes the data in the frame data set to the multicast address, reducing the steps of setting up the streaming media server distribution stream and improving the system push streaming efficiency.

[0011] After the push is completed, the system will also calculate the push completion time according to the audio and video parameter data, that is, the completion time of the current frame push, so as to determine the start time of the next frame push until all the data in the frame data set are pushed. The above push method can realize the push of multi-format audio and video data, reducing the difficulty and complexity of the push operation.

[0012] As a preferred example, the acquiring and decoding of the audio and video file to be pushed to obtain audio and video parameter data and audio and video data specifically includes:

[0013] Receive and obtain the stream audio and video file to be pushed according to a preset input file path, decode the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data;

[0014] The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

[0015] The system receives the audio and video data to be pushed through the determined input file path, which improves the data file transmission efficiency. It also avoids abnormal file data or virus file data caused by receiving data from multiple channels, which improves the system operation efficiency and stability. The file duration data, file frame rate and multicast address data obtained by decoding the received audio and video files are the audio and video parameter data, and the audio and video data are the data to be pushed.

[0016] The multicast address data in the audio and video parameter data determines the address of the destination terminal for streaming, and based on the file length data and the file frame rate, the start time of streaming each frame of audio and video data, that is, the completion time of streaming each frame of audio and video data, can be calculated.

[0017] As a preferred example, the reading and processing of the audio and video data according to a preset file reading method to obtain a frame data set specifically includes:

[0018] The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

[0019] Before reading the frame data of the audio and video data, the system will also copy the decoded audio and video data, and store the copied new data as the copy data of the decoded audio and video data, so as to ensure that the corresponding copy data exists in the system every time the decoded audio and video data is received, so that after the subsequent system pushes the stream abnormally, the user can re-push the abnormal push stream data. The user can also trace the original data of the abnormal push stream data, which improves the efficiency of maintenance personnel in tracing the abnormality.

[0020] As a preferred example, the frame data set is pushed to the multicast address data according to a preset output file format, specifically:

[0021] Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the end frame in the frame data set;

[0022] If it is determined that the current frame is the end frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed;

[0023] If it is determined that the current frame is not the end frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

[0024] In order to improve the streaming efficiency and streaming integrity of the system, when the system streams the data in the frame data set according to the determined output file format, before streaming each frame of data, it is necessary to first determine whether the data to be streamed, that is, the current frame, is the last frame of data in the frame data set, that is, determine whether the current frame is the end frame in the frame data set.

[0025] When it is determined that the current frame is the last frame in the frame data set, that is, the end frame, the system will push the current frame to the determined multicast address, trigger the push end instruction and close the multicast address, so as to avoid the push error triggering and causing the wrong data to be pushed to the multicast address, affecting the normal operation of the destination terminal. When it is determined that the current frame is not the last frame in the frame data set, that is, the end frame, the system will send the current frame normally, and after sending it, it will calculate the push completion time of the current frame normally, that is, the push start time of the next frame.

[0026] In addition, the system directly converts the data format according to the determined output file format before streaming the data, which not only reduces the complexity of the format conversion operation, but also improves the efficiency of data format conversion and avoids the data transmission delay problem caused by format conversion.

[0027] As a preferred example, after parsing the audio and video parameter data to obtain the multicast address data, the method further includes:

[0028] In response to the streaming progress instruction, parsing the streaming progress instruction to obtain a key frame identifier;

[0029] Performing identification processing on the frame data set according to the key frame identifier to determine a corresponding key frame in the frame data set;

[0030] The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction.

[0031] In order to improve the flexibility of controlling the progress of data streaming, after obtaining the multicast address data, the system will also respond to the streaming progress instruction triggered by the user, and parse the streaming progress instruction to determine the key frame identifier corresponding to the key frame that needs to be controlled. After determination, all frames in the data frame set to be streamed are identified and processed according to the key frame identifier to determine the key frame therein. After determining the key frame, the system will identify each frame when streaming each frame in the data frame set to determine whether the current frame is a key frame. If the current frame is determined to be a key frame, the system will trigger a streaming pause instruction, that is, the key frame will no longer be streamed, thereby achieving control over the streaming progress, facilitating users to cut and insert streaming data, facilitating users to control the propagation and playback of audio and video data, and improving user experience.

[0032] Correspondingly, the present invention also provides a multi-format audio and video streaming device, the streaming device comprising an audio and video data acquisition module and an audio and video data streaming module; wherein:

[0033] The audio and video data acquisition module is used to acquire and decode the audio and video file to be pushed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set;

[0034] The audio and video data streaming module is used to parse the audio and video parameter data to obtain multicast address data, stream the frame data set to the multicast address data according to a preset output file format, and calculate and determine the streaming completion time based on the audio and video parameter data until the streaming of the frame data set is completed.

[0035] As a preferred example, the audio and video data acquisition module acquires and decodes the audio and video file to be pushed, and obtains audio and video parameter data and audio and video data, specifically including:

[0036] Receive and obtain the stream audio and video file to be pushed according to a preset input file path, parse the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data;

[0037] The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

[0038] As a preferred example, the audio and video data acquisition module reads and processes the audio and video data according to a preset file reading method to obtain a frame data set, specifically including:

[0039] The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

[0040] As a preferred example, the audio and video data streaming module streams the frame data set to the multicast address data according to a preset output file format, specifically:

[0041] Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the last frame in the frame data set;

[0042] If it is determined that the current frame is the last frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed;

[0043] If it is determined that the current frame is not the last frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

[0044] As a preferred example, the streaming device further includes a streaming progress control module; wherein:

[0045] The streaming progress control module is used to respond to the streaming progress instruction, parse the streaming progress instruction, and obtain the key frame identifier;

[0046] Performing identification processing on the frame data set according to the key frame identifier to determine a corresponding key frame in the frame data set;

[0047] The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 : A flow chart of an embodiment of a method for streaming multi-format audio and video provided by the present invention;

[0049] Figure 2 : A structural diagram of an embodiment of a multi-format audio and video streaming device provided by the present invention;

[0050] Figure 3 : A flowchart of another embodiment of the multi-format audio and video streaming method provided by the present invention. DETAILED DESCRIPTION

[0051] 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.

[0052] Embodiment 1

[0053] Please refer to Figure 1 , which is a flow chart of an embodiment of a multi-format audio and video streaming method provided by the present invention, including steps 101 to 102, each of which is specifically as follows:

[0054] Step 101: Acquire and decode the audio and video file to be streamed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set.

[0055] The streaming method provided in the embodiment of the present invention first needs to obtain and decode the audio and video data to be streamed, that is, to decode the encoded audio and video files obtained in real time, and to improve the security and stability of data transmission by encoding the audio and video data. After the file data packet is decoded to obtain the transmitted file data, it will be divided into audio and video data that need to be streamed and streaming parameters related to the streaming process, that is, audio and video parameter data, according to different data types. After the division is determined, the system will perform data reading and processing on the determined audio and video data in a certain file reading method to obtain a frame data set, that is, the audio and video data that needs to be streamed is divided into several frames of corresponding audio and video data in units of frames, and the set of the several frames of audio and video data is obtained by integration, that is, the frame data set.

[0056] In this embodiment, the system preferably receives and decodes audio and video files through the API of the ffmpeg software program. This embodiment uses the powerful multimedia processing tool ffmpeg to realize real-time streaming of audio and video data in various formats, thereby improving the flexibility and adaptability of audio and video streaming.

[0057] Specifically, the method of acquiring and decoding the audio and video file to be pushed and obtaining audio and video parameter data and audio and video data described in this embodiment specifically includes:

[0058] Receive and obtain the stream audio and video file to be pushed according to a preset input file path, decode the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data;

[0059] The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

[0060] The system receives the audio and video data to be pushed through the determined input file path, which improves the data file transmission efficiency. It also avoids abnormal file data or virus file data caused by receiving data from multiple channels, which improves the system operation efficiency and stability. The file duration data, file frame rate and multicast address data obtained by decoding the received audio and video files are the audio and video parameter data, and the audio and video data are the data to be pushed.

[0061] The multicast address data in the audio and video parameter data determines the address of the destination terminal for streaming, and based on the file length data and the file frame rate, the start time of streaming each frame of audio and video data, that is, the completion time of streaming each frame of audio and video data, can be calculated.

[0062] Furthermore, in this embodiment, the audio and video data is read and processed according to a preset file reading method to obtain a frame data set, which specifically includes:

[0063] The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

[0064] Before reading the frame data of the audio and video data, the system will also copy the decoded audio and video data, and store the copied new data as the copy data of the decoded audio and video data, so as to ensure that the corresponding copy data exists in the system every time the decoded audio and video data is received, so that after the subsequent system pushes the stream abnormally, the user can re-push the abnormal push stream data. The user can also trace the original data of the abnormal push stream data, which improves the efficiency of maintenance personnel in tracing the abnormality.

[0065] Step 102: parse the audio and video parameter data to obtain multicast address data, push the frame data set to the multicast address data according to a preset output file format, and calculate and determine the push completion time based on the audio and video parameter data until the push of the frame data set is completed.

[0066] After obtaining the frame data set, the system will parse the determined audio and video parameter data, that is, the parameter data used to adjust the parameters of the push streaming process, and determine the multicast address data therein, that is, the address data of the destination terminal for the push streaming. After determining the address data, all the data in the frame data set will be pushed to the multicast address according to the determined output file format, that is, the frame data will be pushed according to the address of the determined destination terminal, realizing the push streaming application of multi-format audio and video data, and improving the flexibility and adaptability of audio and video push streaming. At the same time, the system directly pushes the data in the frame data set to the multicast address, reducing the steps of setting up the streaming media server distribution stream and improving the system push streaming efficiency.

[0067] After the push is completed, the system will also calculate the push completion time according to the audio and video parameter data, that is, the completion time of the current frame push, so as to determine the start time of the next frame push until all the data in the frame data set are pushed. The above push method can realize the push of multi-format audio and video data, reducing the difficulty and complexity of the push operation.

[0068] In this embodiment, the system preferably converts audio files of various formats directly into MP3 format through ffmpeg, which reduces the complexity of data format conversion processing and the delay problem that may be caused, and improves the processing efficiency of the system. Specifically, the system can specify the path of the input audio file through the "-i" parameter of the ffmpeg command, that is, the input file path described in this embodiment, and specify the format of the output audio file (such as MP3 format) through the "-f" parameter, that is, the output file format described in this embodiment, thereby realizing the conversion of the audio format.

[0069] Specifically, in this embodiment, the frame data set is pushed to the multicast address data according to a preset output file format, specifically:

[0070] Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the end frame in the frame data set;

[0071] If it is determined that the current frame is the end frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed;

[0072] If it is determined that the current frame is not the end frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

[0073] In order to improve the streaming efficiency and streaming integrity of the system, when the system streams the data in the frame data set according to the determined output file format, before streaming each frame of data, it is necessary to first determine whether the data to be streamed, that is, the current frame, is the last frame of data in the frame data set, that is, determine whether the current frame is the end frame in the frame data set.

[0074] When it is determined that the current frame is the last frame in the frame data set, that is, the end frame, the system will push the current frame to the determined multicast address, trigger the push end instruction and close the multicast address, so as to avoid the push error triggering and causing the wrong data to be pushed to the multicast address, affecting the normal operation of the destination terminal. When it is determined that the current frame is not the last frame in the frame data set, that is, the end frame, the system will send the current frame normally, and after sending it, it will calculate the push completion time of the current frame normally, that is, the push start time of the next frame.

[0075] In addition, the system directly converts the data format according to the determined output file format before streaming the data, which not only reduces the complexity of the format conversion operation, but also improves the efficiency of data format conversion and avoids the data transmission delay problem caused by format conversion.

[0076] Embodiment 2

[0077] In order to enrich the streaming method provided by the present invention, see Figure 3 , Figure 3 This is a flow chart of another embodiment of the multi-format audio and video streaming method provided by the present invention. Figure 3 As shown, compared with the streaming method provided in Example 1, Figure 3 The streaming method shown adds a step of determining key frames. By determining the key frames, the system can achieve precise and flexible control of the streaming process.

[0078] like Figure 3 As shown, the system first acquires and decodes the audio and video file to be pushed, obtains audio and video parameter data and audio and video data, reads and processes the audio and video data according to a preset file reading method, obtains a frame data set, and parses the audio and video parameter data to obtain multicast address data.

[0079] After determining the multicast address, the system will respond to the streaming progress instruction, parse the streaming progress instruction, and obtain the key frame identifier;

[0080] Performing identification processing on the frame data set according to the key frame identifier to determine a corresponding key frame in the frame data set;

[0081] The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction.

[0082] In order to improve the flexibility of controlling the progress of data streaming, after obtaining the multicast address data, the system will also respond to the streaming progress instruction triggered by the user, and parse the streaming progress instruction to determine the key frame identifier corresponding to the key frame that needs to be controlled. After determination, all frames in the data frame set to be streamed are identified and processed according to the key frame identifier to determine the key frame therein. After determining the key frame, the system will identify each frame when streaming each frame in the data frame set to determine whether the current frame is a key frame. If the current frame is determined to be a key frame, the system will trigger a streaming pause instruction, that is, the key frame will no longer be streamed, thereby achieving control over the streaming progress, facilitating users to cut and insert streaming data, facilitating users to control the propagation and playback of audio and video data, and improving user experience.

[0083] In this embodiment, when the system responds to the streaming progress instruction sent by the user through the web client, the server in the system parses and executes the above steps, including: parsing the streaming progress instruction, obtaining the key frame identifier, identifying and processing the frame data set according to the key frame identifier, determining the corresponding key frame in the frame data set, and then streaming the frame data set to the multicast address data according to the output file format until the streaming of the frame data set before the key frame is completed, triggering the streaming pause instruction. In this embodiment, the system controls the setting of the streaming progress through the API of ffmpeg, so that the user can better control the transmission and playback of audio and video data, thereby improving the user experience.

[0084] In this embodiment, the system preferably locates the key frame through av_seek_framed.

[0085] In order to better illustrate the working principle and step flow of a multi-format audio and video streaming method and device of the present invention, it is possible but not limited to refer to the relevant records above.

[0086] Accordingly, see Figure 2 , Figure 2 This is a structural diagram of an embodiment of a multi-format audio and video streaming device provided by the present invention. Figure 2 As shown, the streaming device includes an audio and video data acquisition module 201, an audio and video data streaming module 202, and a streaming progress control module 203; wherein:

[0087] The audio and video data acquisition module 201 is used to acquire and decode the audio and video file to be pushed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set.

[0088] Furthermore, the audio and video data acquisition module 201 acquires and decodes the audio and video file to be pushed, and obtains audio and video parameter data and audio and video data, specifically including:

[0089] Receive and obtain the stream audio and video file to be pushed according to a preset input file path, parse the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data;

[0090] The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

[0091] Furthermore, the audio and video data acquisition module 201 reads and processes the audio and video data according to a preset file reading method to obtain a frame data set, which specifically includes:

[0092] The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

[0093] The audio and video data streaming module 202 is used to parse the audio and video parameter data to obtain multicast address data, stream the frame data set to the multicast address data according to a preset output file format, and calculate and determine the streaming completion time based on the audio and video parameter data until the streaming of the frame data set is completed.

[0094] Furthermore, the audio and video data streaming module 202 streams the frame data set to the multicast address data according to a preset output file format, specifically:

[0095] Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the last frame in the frame data set;

[0096] If it is determined that the current frame is the last frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed;

[0097] If it is determined that the current frame is not the last frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

[0098] The streaming progress control module 203 is used to respond to the streaming progress instruction, parse the streaming progress instruction, and obtain the key frame identifier; identify the frame data set according to the key frame identifier, and determine the corresponding key frame in the frame data set;

[0099] The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction.

[0100] In summary, the embodiments of the present invention provide a method and device for streaming multi-format audio and video, which decodes the acquired audio and video data to be streamed to obtain audio and video data and audio and video parameter data, reads the audio and video data in a file reading manner, and obtains a frame data set; parses the audio and video parameter data to obtain multicast address data, streams the frame data set to the multicast address in an output file format, and calculates the streaming completion time based on the audio and video parameter data until the streaming of the frame data set is completed. By encoding the audio and video data in a file, the security and stability of data transmission are improved; by streaming the data in the frame data set to the multicast address, the steps of setting up a streaming media server distribution stream are reduced, and the streaming efficiency of the system is improved; the streaming method described above is used to achieve streaming of multi-format audio and video data, which reduces the difficulty and complexity of streaming operations.

[0101] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for streaming multi-format audio and video, characterized in that: The following steps are involved: Acquire and decode the audio and video file to be pushed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set; Parse the audio and video parameter data to obtain multicast address data, push the frame data set to the multicast address data according to a preset output file format, and calculate and determine the push completion time based on the audio and video parameter data until the push of the frame data set is completed.

2. A method for streaming multi-format audio and video according to claim 1, characterized in that: The step of acquiring and decoding the audio and video file to be pushed, and obtaining audio and video parameter data and audio and video data specifically includes: Receive and obtain the stream audio and video file to be pushed according to a preset input file path, decode the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data; The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

3. The method for streaming multi-format audio and video according to claim 1, characterized in that: The step of reading and processing the audio and video data according to a preset file reading method to obtain a frame data set specifically includes: The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

4. The method for streaming multi-format audio and video according to claim 1, characterized in that: The step of streaming the frame data set to the multicast address data according to a preset output file format is specifically as follows: Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the end frame in the frame data set; If it is determined that the current frame is the end frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed; If it is determined that the current frame is not the end frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

5. The method for streaming multi-format audio and video according to claim 1, characterized in that: After parsing the audio and video parameter data to obtain the multicast address data, the method further includes: In response to the streaming progress instruction, parsing the streaming progress instruction to obtain a key frame identifier; Performing identification processing on the frame data set according to the key frame identifier to determine a corresponding key frame in the frame data set; The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction.

6. A multi-format audio and video streaming device, characterized in that: The streaming device comprises an audio and video data acquisition module and an audio and video data streaming module; wherein: The audio and video data acquisition module is used to acquire and decode the audio and video file to be pushed, obtain audio and video parameter data and audio and video data, read and process the audio and video data according to a preset file reading method, and obtain a frame data set; The audio and video data streaming module is used to parse the audio and video parameter data to obtain multicast address data, stream the frame data set to the multicast address data according to a preset output file format, and calculate and determine the streaming completion time based on the audio and video parameter data until the streaming of the frame data set is completed.

7. The multi-format audio and video streaming device according to claim 6, characterized in that: The audio and video data acquisition module acquires and decodes the audio and video file to be pushed, and obtains audio and video parameter data and audio and video data, specifically including: Receive and obtain the stream audio and video file to be pushed according to a preset input file path, parse the stream audio and video file to be pushed, and obtain file duration data, file frame rate, the multicast address data, and the audio and video data; The file duration data, the file frame rate and the multicast address data are integrated into the audio and video parameter data, and the audio and video parameter data and the audio and video data are output.

8. The multi-format audio and video streaming device according to claim 6, characterized in that: The audio and video data acquisition module reads and processes the audio and video data according to a preset file reading method to obtain a frame data set, specifically including: The audio and video data are copied to obtain first audio and video data, the first audio and video data are stored as original copy data, and the audio and video data are read and processed in units of frames according to a frame reading method to obtain the frame data set.

9. The multi-format audio and video streaming device according to claim 6, characterized in that: The audio and video data streaming module streams the frame data set to the multicast address data according to a preset output file format, specifically: Performing format conversion and reading processing on the frame data set frame by frame according to the output file format, and determining whether the current frame is the last frame in the frame data set; If it is determined that the current frame is the last frame in the frame data set, the current frame is pushed to the multicast address data, a push end instruction is triggered and the corresponding multicast address is closed; If it is determined that the current frame is not the last frame in the frame data set, the current frame is pushed to the multicast address data, and the push completion time is calculated and determined according to the audio and video parameter data.

10. The multi-format audio and video streaming device according to claim 6, characterized in that: The streaming device also includes a streaming progress control module; wherein: The streaming progress control module is used to respond to the streaming progress instruction, parse the streaming progress instruction, and obtain the key frame identifier; Performing identification processing on the frame data set according to the key frame identifier to determine a corresponding key frame in the frame data set; The frame data set is pushed to the multicast address data according to the output file format until the push of the frame data set before the key frame is completed, triggering a push pause instruction.