RTMP Video Streaming Pushing Method, Device and Medium Based on MSDK Technology
Through the RTMP video streaming method based on MSDK technology, the problem of difficulty in stably pushing drone videos is solved, and the need for multiple people to view videos at the same time is realized, avoiding the limitations of traditional upload methods.
Patent Information
- Application Number
- CN202411709469.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-11-27
AI Technical Summary
At this stage, it is difficult to directly and stably broadcast the videos collected by drones, especially when multiple people view videos, the traditional uploading method has spatial and time limitations.
The RTMP video streaming method based on MSDK technology is adopted. The target drone collects original video data, sets the stream streaming parameters, encapsulates the encoded video, and uses the live streaming device to perform H.264 decoding based on the MSDK decoder. Finally, the streaming method is pushed to the live streaming platform through the RTMP protocol to realize the need for multiple points and multiple people to view videos at the same time.
It realizes stable streaming of drone videos, meets the need for multiple people to view videos at the same time, and avoids the spatial and time limitations of traditional upload methods.
Smart Images

Figure CN119211591B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric communication technology, and in particular to an RTMP video streaming method, device and medium based on the MSDK technology. Background Art
[0002] In recent years, with the popularization of mobile Internet and the explosion of the live broadcast industry, more and more users have begun to watch and share audio and video content through live broadcast platforms. As one of the core technologies in the live broadcast industry, the RTMP video streaming technology has been widely applied and developed rapidly. With the diversification of intelligent devices, users' demand for cross-platform and cross-device audio and video communication has increased day by day. The RTMP protocol supports multiple operating systems and platforms, enabling the RTMP video streaming technology to meet this demand. After years of optimization and accumulation, the MSDK technology provides stable and reliable audio and video processing and network transmission functions, enabling the RTMP video streaming technology to maintain high-efficiency and stable transmission performance in complex network environments.
[0003] At present, it is difficult to directly perform stable live streaming on the videos collected by drones. When there is a need for multiple people to view the videos, the optional method is to push the videos to others by uploading them. This method has limitations in terms of space and time. Therefore, the present invention proposes an RTMP video streaming method, device and medium based on the MSDK technology. Summary of the Invention
[0004] The purpose of the present invention is to propose an RTMP video streaming method, device and medium based on the MSDK technology to solve the problem of difficult stable streaming of drone videos proposed in the above background art.
[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0006] An RTMP video streaming method based on the MSDK technology includes:
[0007] Step S1, collecting original video data through a target drone and setting bitstream Stream parameters for the original video data;
[0008] Step S2, encapsulating the original video data in combination with the Stream parameters of the original video data to obtain an encapsulated and encoded video;
[0009] Step S3, the live streaming device performs H.264 decoding on the encapsulated and encoded video based on the MSDK decoder to obtain a decoded streaming video corresponding to the encapsulated and encoded video;
[0010] Step S4, the live streaming device obtains the decoded streaming video and pushes the decoded streaming video to the live broadcast platform through the RTMP protocol;
[0011] In step S5, the user searches for and watches the decoded and streamed video through the live streaming platform, meeting the requirement of multiple points and multiple people to view the video images collected by the drone simultaneously.
[0012] Further, the step S2 includes the following sub-steps:
[0013] In step S21, the original video data is obtained and divided into multiple original video frames;
[0014] In step S22, the pixel difference value between adjacent video frames is calculated;
[0015] In step S23, the pixel difference value between adjacent video frames is compared with the pixel difference threshold;
[0016] In step S24, if the pixel difference value is less than or equal to the pixel difference threshold, the corresponding adjacent video frames are recorded as the initial video frame group;
[0017] If the pixel difference value is greater than the pixel difference threshold, the subsequent video frame is recorded as another initial video frame group; thus, multiple initial video frame groups corresponding to the original video data are obtained.
[0018] Further, the step S2 also includes the following sub-steps:
[0019] In step S25, for any initial video frame group, the first initial video frame is recorded as the feature frame, and the remaining initial video frames are processed in the order of forward reference frame - forward reference frame - bidirectional reference frame to obtain the processed video frame group;
[0020] Forward reference frame: Compressed based on the previous video frame of the current video frame, and only the difference information from the previous frame is stored;
[0021] Bidirectional reference frame: Compressed based on the previous video frame and the subsequent video frame of the current video frame, and the difference information between the previous video frame and the subsequent video frame is stored;
[0022] In step S26, the processed video frame groups are spliced to obtain the encapsulated and encoded video, and the encapsulated and encoded video is sent to the live streaming device.
[0023] Further, the calculation process of the pixel difference value in the step S22 is specifically as follows:
[0024] In step S221, the pixel values of each pixel point between two adjacent video frames are obtained. The pixel value of the pixel point in the previous video frame is denoted as XSqi, and the pixel value of the pixel point in the subsequent video frame is denoted as XShi;
[0025] Among them, i represents the number of the pixel point, i = 1, 2, ……, n, where n is the upper limit value of the pixel point number; since adjacent video frames are segmented from the same video, the number of pixel points corresponding to all video frames is the same;
[0026] Step S222, calculate the pixel difference value XSC between adjacent video frames through the formula. The specific formula is:
[0027] 。
[0028] Furthermore, the step S3 includes the following sub-steps:
[0029] Step S31, obtain the encapsulated encoded video to get multiple processed video frame groups corresponding to the encapsulated encoded video;
[0030] Step S32, obtain the MSDK decoder and import multiple processed video frame groups into the MSDK decoder in chronological order;
[0031] Step S33, for the feature frame, directly read the image corresponding to the feature frame and record it as the first reference frame;
[0032] Step S34, for the first forward reference frame after the feature frame, read the first forward reference frame, and then superimpose the forward reference frame and the first reference frame to obtain the second reference frame;
[0033] Step S35, for the second forward reference frame after the feature frame, read the second forward reference frame, and then superimpose the second forward reference frame and the second reference frame to obtain the third reference frame;
[0034] Step S36, for the bidirectional reference frame, read the bidirectional reference frame and the first forward reference frame after the bidirectional reference frame; superimpose the bidirectional reference frame, the third reference frame, and the first forward reference frame after the bidirectional reference frame to obtain the fourth reference frame;
[0035] Step S37, and so on until the decoding of a processed video frame group is completed, and then read the next processed video frame group;
[0036] Step S38, complete the decoding of all processed video frame groups, and splice all reference frames in chronological order to obtain the decoded push stream video.
[0037] Furthermore, the step S4 includes the following sub-steps:
[0038] Step S41, the live push stream device establishes a handshake connection with the live platform;
[0039] Step S42, the live push stream device establishes a network connection with the live platform;
[0040] Step S43: The live streaming device sends a "create network stream" command to the live streaming platform. After receiving the "create network stream" command, the live streaming platform responds to the result of the "create network stream" command.
[0041] Step S44: The live streaming device obtains the length of the network stream from the live streaming platform and creates the network stream; wherein, the network stream is used to transmit video or audio between the live streaming device and the live streaming platform.
[0042] Step S45: The live streaming device sends a "play" command to the live streaming platform. After receiving the "play" command, the platform sends the ID corresponding to the network stream to the live streaming device.
[0043] Step S46: After receiving the ID corresponding to the network stream, the live streaming device locates the corresponding network stream through the ID and transmits the decoded push stream video to the live streaming platform through the network stream.
[0044] Step S47: After receiving the decoded push stream video, the live streaming platform performs push stream playback on the decoded push stream video to achieve live streaming.
[0045] Furthermore, the handshake connection process in step S41 is specifically as follows:
[0046] Step S411: The live streaming device sends a first push stream signal and a second push stream signal to the live streaming platform.
[0047] Step S412: If the live streaming platform receives either the first push stream signal or the second push stream signal first, it sends a first live signal and a second live signal to the live streaming device.
[0048] Step S413: After receiving the first live signal and the second live signal, the live streaming device sends a third push stream signal to the live streaming platform.
[0049] Step S414: If the live streaming platform receives the other signal among the first push stream signal and the second push stream signal, it sends a third live signal to the live streaming device.
[0050] Step S415: The live streaming device receives the third live signal, and the live streaming platform receives the third push stream signal, and the handshake connection is established.
[0051] Furthermore, the network connection process in step S42 is specifically as follows:
[0052] Step S421: The live streaming device sends a network connection request to the live streaming platform.
[0053] Step S422: The live streaming platform receives the network connection request, and then the live streaming platform sets the sending bandwidth size of the live streaming device and the size of the data block received by the live streaming platform.
[0054] Step S423, the live streaming device sets the size of the data block to be sent and completes the establishment of the network connection.
[0055] A computer device, the computer device includes:
[0056] A memory storing a computer program;
[0057] A processor communicatively connected to the memory, and when the computer program is executed by the processor, the above method is implemented.
[0058] A computer-readable storage medium storing a computer program, and the program is executed by the processor to implement the above method.
[0059] In summary, due to the adoption of the above technical solutions, the beneficial effects of the present invention are:
[0060] The present invention first collects the original video data through the target unmanned aerial vehicle (UAV), sets the bitstream Stream parameters for the original video data, then encapsulates the original video data in combination with the Stream parameters of the original video data to obtain the encapsulated and encoded video, and then uses the live streaming device to perform H.264 decoding on the encapsulated and encoded video based on the MSDK decoder to obtain the decoded and pushed video corresponding to the encapsulated and encoded video, and pushes the decoded and pushed video to the live streaming platform through the RTMP protocol. Finally, the user searches and views the decoded and pushed video through the live streaming platform, realizing the need for multiple points and multiple people to view the video images collected by the UAV at the same time, and the present invention realizes stable pushing of the UAV video. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] For the convenience of those skilled in the art to understand, the present invention will be further described below with reference to the accompanying drawings.
[0062] Figure 1 It is the flowchart of the method of the present invention;
[0063] Figure 2 It is the schematic diagram of the composition of the video frame group in the present invention;
[0064] Figure 3 It is the schematic diagram of the process of establishing a handshake connection between the live streaming device and the live streaming platform in the present invention;
[0065] Figure 4 It is the schematic diagram of the structure of the computer device in the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0066] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work belong to the protection scope of the present invention.
[0067] Embodiment 1: Please refer to Figures 1 - 3 , the technical solution provided by the present invention is: an RTMP video streaming method based on the MSDK technology, where the MSDK technology is composed of the abbreviations of M30 (product model), DJI RC (remote controller), and Android SDK (software development kit), and RTMP is the abbreviation of the Real-Time Messaging Protocol, which is a protocol for real-time transmission of audio, video, and data streams on the Internet;
[0068] This method includes a target unmanned aerial vehicle (UAV) for collecting original video data and a live streaming device for live streaming. The method is as follows:
[0069] Step S1, collect original video data through the target UAV and set the bitstream Stream parameters for the original video data; where the bitstream Steam parameters specifically include resolution, bit rate, encoding format, and color depth, etc.;
[0070] The resolution represents the number of pixel points contained in a unit length. The higher the resolution, the more detailed the encapsulated and encoded video; the bit rate refers to the data traffic used by the encapsulated and encoded video per unit time. The higher the bit rate, the better the video quality, but at the same time it occupies more bandwidth and storage space; the encoding format refers to the compression format of the encapsulated and encoded video. The preferred encoding format in this embodiment is H.264; the color depth refers to the number of bits used to store the color of 1 pixel in the encapsulated and encoded video. The higher the color depth, the richer the color performance of the image.
[0071] Step S2, encapsulate the original video data in combination with the Stream parameters of the original video data to obtain an encapsulated and encoded video;
[0072] In this embodiment, the step S2 includes the following sub-steps:
[0073] Step S21, obtain the original video data and divide the original video data into multiple original video frames;
[0074] Step S22, calculate the pixel difference value between adjacent video frames. The calculation process is as follows:
[0075] Step S221, obtain the pixel values of each pixel point between two adjacent video frames, record the pixel value of the pixel point in the previous video frame as XSqi, and record the pixel value of the pixel point in the subsequent video frame as XShi;
[0076] Among them, i represents the number of the pixel point, i = 1, 2, ……, n, where n is the upper limit value of the pixel point number; since adjacent video frames are segmented from the same video, the number of pixel points corresponding to all video frames is the same;
[0077] Step S222, calculate the pixel difference value XSC between adjacent video frames through the formula, and the specific formula is:
[0078] ;
[0079] Step S23, compare the pixel difference value between adjacent video frames with the pixel difference threshold;
[0080] Step S24, if the pixel difference value is less than or equal to the pixel difference threshold, mark the corresponding adjacent video frames as the initial video frame group;
[0081] If the pixel difference value is greater than the pixel difference threshold, mark the subsequent video frame as another initial video frame group; thus, multiple initial video frame groups corresponding to the original video data are obtained, and each initial video frame group is denoted as SPZs, where s represents the number of the initial video frame group;
[0082] Step S25, please refer to Figure 2 As shown, for any initial video frame group, mark the first initial video frame as the feature frame, and process the remaining initial video frames in the order of forward reference frame - forward reference frame - bidirectional reference frame to obtain the processed video frame group;
[0083] Forward reference frame: Compress based on the previous video frame of the current video frame, and only store the difference information from the previous frame;
[0084] Bidirectional reference frame: Compress based on the previous video frame and the subsequent video frame of the current video frame, and store the difference information between the previous video frame and the subsequent video frame;
[0085] Step S26, splice the processed video frame groups to obtain the encapsulated encoded video, and send the encapsulated encoded video to the live streaming device.
[0086] Step S3, the live streaming device performs H.264 decoding on the encapsulated encoded video based on the MSDK decoder to obtain the decoded streaming video corresponding to the encapsulated encoded video; among them, the MSDK decoder is installed on the live streaming device;
[0087] In this embodiment, step S3 includes the following sub - steps:
[0088] Step S31, obtain the encapsulated encoded video to obtain multiple processed video frame groups corresponding to the encapsulated encoded video;
[0089] Step S32: Obtain the MSDK decoder and import multiple processed video frame groups into the MSDK decoder in chronological order;
[0090] Step S33: For the feature frame, directly read the image corresponding to the feature frame and record it as the first reference frame;
[0091] Step S34: For the first forward reference frame after the feature frame, read the first forward reference frame, and then superimpose the forward reference frame on the first reference frame to obtain the second reference frame;
[0092] Step S35: For the second forward reference frame after the feature frame, read the second forward reference frame, and then superimpose the second forward reference frame on the second reference frame to obtain the third reference frame;
[0093] Step S36: For the bidirectional reference frame, read the bidirectional reference frame and the first forward reference frame after the bidirectional reference frame; superimpose the bidirectional reference frame on the third reference frame and the first forward reference frame after the bidirectional reference frame to obtain the fourth reference frame;
[0094] Step S37: And so on until the decoding of one processed video frame group is completed, and then read the next processed video frame group;
[0095] Step S38: Complete the decoding of all processed video frame groups, and splice all reference frames in chronological order to obtain the decoded push stream video.
[0096] Step S4: The live push stream device obtains the decoded push stream video and pushes the decoded push stream video to the live platform through the RTMP protocol;
[0097] In this embodiment, step S4 includes the following sub-steps:
[0098] Step S41, as Figure 3 shown, the live push stream device establishes a handshake connection with the live platform; among them, the handshake connection can be used for the live push stream device and the live platform to verify each other's identities, so as to ensure the smooth progress of subsequent data transmission;
[0099] The handshake connection process in step S41 is specifically as follows:
[0100] Step S411: The live push stream device sends the first push stream signal and the second push stream signal to the live platform;
[0101] Step S412: If the live platform receives any one of the first push stream signal or the second push stream signal first, it sends the first live signal and the second live signal to the live push stream device;
[0102] Step S413: After the live streaming device receives the first live signal and the second live signal, it sends a third streaming signal to the live streaming platform;
[0103] Step S414: If the live streaming platform receives the other signal among the first streaming signal and the second streaming signal, it sends a third live signal to the live streaming device;
[0104] Step S415: After the live streaming device receives the third live signal and the live streaming platform receives the third streaming signal, the handshake connection is established;
[0105] Step S42: The live streaming device establishes a network connection with the live streaming platform;
[0106] The said Step S42 includes the following sub-steps:
[0107] Step S421: The live streaming device sends a network connection request to the live streaming platform;
[0108] Step S422: The live streaming platform receives the network connection request, and then the live streaming platform sets the sending bandwidth size of the live streaming device and the size of the data blocks received by the live streaming platform;
[0109] Step S423: The live streaming device sets the size of the data blocks to be sent, and the network connection is established;
[0110] Step S43: The live streaming device sends a "Create Network Stream" command to the live streaming platform. After receiving the "Create Network Stream" command, the live streaming platform responds to the result of the "Create Network Stream" command;
[0111] Step S44: The live streaming device obtains the length of the network stream from the live streaming platform and creates the network stream; wherein, the network stream is used to transmit video or audio between the live streaming device and the live streaming platform;
[0112] Step S45: The live streaming device sends a "Play" command to the live streaming platform. After receiving the "Play" command, the platform sends the ID corresponding to the network stream to the live streaming device;
[0113] Step S46: After receiving the ID corresponding to the network stream, the live streaming device locates the corresponding network stream through the ID and transmits the decoded streaming video to the live streaming platform through the network stream;
[0114] Step S47: After receiving the decoded streaming video, the live streaming platform performs streaming playback on the decoded streaming video to realize live streaming.
[0115] Step S5: The user searches for and watches the decoded streaming video through the live streaming platform, meeting the requirement of multiple points and multiple people to view the video images collected by the drone simultaneously.
[0116] In this application, if there are corresponding calculation formulas, the above calculation formulas are all dimensionless and take their numerical values for calculation. Coefficients such as weight coefficients and proportionality coefficients in the formulas are set to obtain a result value by quantifying each parameter. Regarding the magnitudes of the weight coefficients and proportionality coefficients, as long as the proportional relationship between the parameters and the result value is not affected, it is fine.
[0117] Embodiment 2: Figure 4 Illustrated is a schematic structural diagram of a computer device, which may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus. The processor can call the logical instructions in the memory to execute the RTMP video streaming method based on the msdk technology. The method includes: collecting original video data through a target unmanned aerial vehicle (UAV), setting the bitstream Stream parameters for the original video data; encapsulating the original video data in combination with the Stream parameters of the original video data to obtain an encapsulated and encoded video; the live streaming device performs H.264 decoding on the encapsulated and encoded video based on the MSDK decoder to obtain a decoded streaming video corresponding to the encapsulated and encoded video; the live streaming device obtains the decoded streaming video and pushes the decoded streaming video to the live streaming platform through the RTMP protocol; users search and view the decoded streaming video through the live streaming platform, meeting the requirement of multiple points and multiple people to view the video images collected by the UAV simultaneously.
[0118] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0119] Embodiment 3: The present application further provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the RTMP video streaming method based on the msdk technology provided by the above-mentioned various methods. The method includes: collecting original video data through a target unmanned aerial vehicle (UAV), and setting a bitrate Stream parameter for the original video data; encapsulating the original video data in combination with the Stream parameter of the original video data to obtain an encapsulated and encoded video; the live streaming device performs H.264 decoding on the encapsulated and encoded video based on the MSDK decoder to obtain a decoded streaming video corresponding to the encapsulated and encoded video; the live streaming device acquires the decoded streaming video and streams the decoded streaming video to a live streaming platform through the RTMP protocol; users search for and watch the decoded streaming video through the live streaming platform, so as to meet the requirement of multiple points and multiple people to view the video images collected by the UAV simultaneously.
[0120] Embodiment 4: The present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the RTMP video streaming method based on the msdk technology provided by the above-mentioned various methods. The method includes: collecting original video data through a target UAV, and setting a bitrate Stream parameter for the original video data; encapsulating the original video data in combination with the Stream parameter of the original video data to obtain an encapsulated and encoded video; the live streaming device performs H.264 decoding on the encapsulated and encoded video based on the MSDK decoder to obtain a decoded streaming video corresponding to the encapsulated and encoded video; the live streaming device acquires the decoded streaming video and streams the decoded streaming video to a live streaming platform through the RTMP protocol; users search for and watch the decoded streaming video through the live streaming platform, so as to meet the requirement of multiple points and multiple people to view the video images collected by the UAV simultaneously.
[0121] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0122] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. The rtmp video streaming method based on msdk technology is characterized by: include: Step S1, collecting raw video data through the target drone and setting stream parameters for the raw video data; Step S2, encapsulating the original video data in combination with the Stream parameter of the original video data to obtain an encapsulated encoded video; Wherein, the step S2 includes the following sub-steps: Step S21, obtaining original video data, and dividing the original video data into a plurality of original video frames; Step S22, calculating pixel difference values between adjacent video frames; Step S23, comparing the pixel difference value between adjacent video frames with the pixel difference threshold; Step S24, if the pixel difference value is less than or equal to the pixel difference threshold, the corresponding adjacent video frames are recorded as an initial video frame group; If the pixel difference value is greater than the pixel difference threshold, the next video frame is recorded as another initial video frame group; and then multiple initial video frame groups corresponding to the original video data are obtained; Step S25, for any initial video frame group, record the first initial video frame as a feature frame, and process the remaining initial video frames in the order of forward reference frame-forward reference frame-bidirectional reference frame to obtain a processed video frame group; Forward reference frame: Compresses the previous video frame based on the current video frame, and only stores the difference information with the previous frame; Bidirectional reference frame: compresses the previous video frame and the next video frame based on the current video frame, and stores the difference information between the previous video frame and the next video frame; Step S26, splicing the processed video frame groups to obtain a packaged coded video, and sending the packaged coded video to a live streaming device; Step S3, the live streaming device performs H.264 decoding on the encapsulated coded video based on the MSDK decoder to obtain a decoded streaming video corresponding to the encapsulated coded video; Step S4, the live streaming device obtains the decoded streaming video, and streams the decoded streaming video to the live streaming platform through the RTMP protocol; Step S5: The user searches and watches the decoded streaming video through the live broadcast platform, so that multiple people can simultaneously view the video images captured by the drone at multiple locations.
2. The rtmp video streaming method based on msdk technology according to claim 1 is characterized in that: The calculation process of the pixel difference value in step S22 is specifically as follows: Step S221, obtaining the pixel value of each pixel between two adjacent video frames, recording the pixel value of the pixel in the previous video frame as XSqi, and recording the pixel value of the pixel in the next video frame as XShi; Wherein, i represents the number of the pixel point, i=1, 2, ..., n, and n is the upper limit of the pixel point number; since adjacent video frames are segmented from the same video, the number of pixels corresponding to all video frames is the same; Step S222, calculating the pixel difference value XSC between adjacent video frames by a formula, the specific formula is:
3. The rtmp video streaming method based on msdk technology according to claim 1 is characterized in that: The step S3 includes the following sub-steps: Step S31, obtaining the encapsulated encoded video, and obtaining a plurality of processed video frame groups corresponding to the encapsulated encoded video; Step S32, obtaining an MSDK decoder, and importing a plurality of processed video frame groups into the MSDK decoder in chronological order; Step S33, for the feature frame, directly read the image corresponding to the feature frame and record it as the first reference frame; Step S34, for the first forward reference frame after the feature frame, read the first forward reference frame, and then superimpose the forward reference frame with the first reference frame to obtain a second reference frame; Step S35: for the second forward reference frame after the feature frame, read the second forward reference frame, and then superimpose the second forward reference frame with the second reference frame to obtain a third reference frame; Step S36, for the bidirectional reference frame, read the bidirectional reference frame and the first forward reference frame after the bidirectional reference frame; superimpose the bidirectional reference frame with the third reference frame and the first forward reference frame after the bidirectional reference frame to obtain a fourth reference frame; Step S37, and so on until the decoding of one processed video frame group is completed, and then the next processed video frame group is read; Step S38, complete the decoding of all processed video frame groups, and splice all reference frames in chronological order to obtain decoded streaming video.
4. The rtmp video streaming method based on msdk technology according to claim 3 is characterized in that: The step S4 includes the following sub-steps: Step S41, the live streaming device establishes a handshake connection with the live streaming platform; Step S42, the live streaming device establishes a network connection with the live streaming platform; Step S43, the live streaming device sends a "create network stream" command to the live streaming platform, and after receiving the "create network stream" command, the live streaming platform responds with the result of the "create network stream" command; Step S44, the live streaming device obtains the length of the network stream from the live streaming platform and creates the network stream; wherein the network stream is used to transmit video or audio between the live streaming device and the live streaming platform; Step S45, the live streaming device sends a "play" command to the live streaming platform, and after receiving the "play" command, the platform sends the ID corresponding to the network stream to the live streaming device; Step S46, after receiving the ID corresponding to the network stream, the live streaming device searches for the corresponding network stream through the ID and transmits the decoded streaming video to the live streaming platform through the network stream; Step S47, after receiving the decoded push streaming video, the live streaming platform pushes and plays the decoded push streaming video to realize live streaming.
5. The rtmp video streaming method based on msdk technology according to claim 4 is characterized in that: The handshake connection process in step S41 is specifically as follows: Step S411, the live streaming device sends a first streaming signal and a second streaming signal to the live streaming platform; Step S412: If the live streaming platform first receives the first streaming signal or the second streaming signal, the first live streaming signal and the second live streaming signal are sent to the live streaming device; Step S413: After receiving the first live broadcast signal and the second live broadcast signal, the live broadcast streaming device sends a third streaming signal to the live broadcast platform; Step S414: If the live streaming platform receives the other signal of the first streaming signal and the second streaming signal, a third live streaming signal is sent to the live streaming device; Step S415: the live streaming device receives the third live streaming signal, the live streaming platform receives the third streaming signal, and the handshake connection is established.
6. The rtmp video streaming method based on msdk technology according to claim 4 is characterized in that: The network connection process in step S42 is specifically as follows: Step S421, the live streaming device sends a network connection request to the live streaming platform; Step S422, the live broadcast platform receives the network connection request, and then the live broadcast platform sets the sending bandwidth size of the live broadcast streaming device and the size of the data block received by the live broadcast platform; Step S423: The live streaming device sets the size of the data block to be sent and completes the establishment of the network connection.
7. A computer device, characterized in that: The computer device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and when the computer program is executed by the processor, the method described in any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Video decoding method and device
CN111246214A
Online unmanned aerial vehicle live broadcast method and device, storage medium and electronic equipment
CN113973212A