CN110392285B - Media stream processing method and device - Google Patents

Media stream processing method and device Download PDF

Info

Publication number
CN110392285B
CN110392285B CN201810366138.1A CN201810366138A CN110392285B CN 110392285 B CN110392285 B CN 110392285B CN 201810366138 A CN201810366138 A CN 201810366138A CN 110392285 B CN110392285 B CN 110392285B
Authority
CN
China
Prior art keywords
stream
media
media streams
composite
streams
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810366138.1A
Other languages
Chinese (zh)
Other versions
CN110392285A (en
Inventor
陈毓亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810366138.1A priority Critical patent/CN110392285B/en
Publication of CN110392285A publication Critical patent/CN110392285A/en
Application granted granted Critical
Publication of CN110392285B publication Critical patent/CN110392285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/236Assembling of a multiplex stream, e.g. transport stream, by combining a video stream with other content or additional data, e.g. inserting a URL [Uniform Resource Locator] into a video stream, multiplexing software data into a video stream; Remultiplexing of multiplex streams; Insertion of stuffing bits into the multiplex stream, e.g. to obtain a constant bit-rate; Assembling of a packetised elementary stream
    • H04N21/2365Multiplexing of several video streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a media stream processing method and a media stream processing device. Wherein, the method comprises the following steps: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module. The invention solves the technical problem that the multi-path backup media stream can not be rapidly and nondestructively switched in the prior art.

Description

Media stream processing method and device
Technical Field
The present invention relates to the field of streaming media processing, and in particular, to a method and an apparatus for processing a media stream.
Background
In the related art, in order to solve the problem of unstable network between a source station and a cloud, for example, how to switch a service to another backup stream when a backup stream is abnormal, a common solution in the prior art is to perform the same streaming media processing (such as transcoding, switching, etc.) on a plurality of backup streams at the cloud, that is, when a backup stream is abnormal, data processed by another backup stream is used to provide the service.
However, the scheme causes certain waste to the service resources of the cloud; for example, the switching scheme may be selected from player switching and Proxy switching depending on the location of the anomaly detection and switching. The player switching has the defects that the variety of players is various, and all players are difficult to support dynamic switching, so that the popularization cost is high; the Proxy server Proxy switching has the defects that in order to reduce the influence on user experience during switching, synchronous work needs to be carried out when a plurality of backup streams are processed at the cloud, the cost is high, and different types of service processing need to be synchronized.
Therefore, the existing solution causes certain waste to the service resources of the cloud, the cost is high, and the implementation effect is not ideal. Aiming at the problem that the multi-path backup media stream can not be rapidly and nondestructively switched in the prior art, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a media stream processing method and a media stream processing device, which at least solve the technical problem that a plurality of paths of backup media streams cannot be rapidly and losslessly switched in the prior art.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing method, including: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing method, including: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and distributing the received composite stream.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing method, including: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and playing the received composite stream.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing apparatus including: a first receiving module, configured to receive at least two media streams, where the at least two media streams are transmitted through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and the composite module is used for compositing the at least two media streams to generate a composite stream, wherein the composite stream is distributed after being processed by the stream media processing module.
According to an aspect of the embodiments of the present invention, there is provided a compositor including the media stream processing apparatus described above.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing apparatus including: a second receiving module, configured to receive a composite stream, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and the distribution module is used for distributing the received composite stream.
According to an aspect of the embodiments of the present invention, there is provided a distributor including the media stream processing apparatus described above.
According to an aspect of an embodiment of the present invention, there is provided a media stream processing apparatus including: a third receiving module, configured to receive a composite stream, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and the playing module is used for playing the received composite stream.
According to an aspect of the embodiments of the present invention, there is provided a player including the above media stream processing apparatus.
According to an aspect of the embodiments of the present invention, there is provided a storage medium including a stored program, wherein, when the program runs, a device on which the storage medium is located is controlled to perform the following functions: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
According to an aspect of the embodiments of the present invention, there is provided a processor, configured to execute a program, where the program executes to perform the following functions: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
In the embodiment of the present invention, a manner of combining multiple media streams is adopted, and at least two media streams are received, where the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; the at least two media streams are composited to generate a composite stream, wherein the composite stream is distributed after being processed by the stream media processing module, and the purpose of rapidly switching the service to other backup media streams in a lossless manner when a certain backup media stream is abnormal is achieved, so that the technical effects of effectively reducing the influence of source station fluctuation on the video cloud service and improving the system availability are achieved, and the technical problem that multiple backup media streams cannot be rapidly and nondestructively switched in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing a media stream processing method;
FIG. 2 is a flow chart of a method of media stream processing according to an embodiment of the invention;
fig. 3 is a schematic view of an implementation scenario of an alternative media stream processing method according to an embodiment of the present invention;
FIG. 4 is a flow chart of an alternative media stream processing method according to an embodiment of the invention;
FIG. 5 is a flow chart of an alternative media stream processing method according to an embodiment of the invention;
FIG. 6 is a flow chart of another method of media stream processing according to an embodiment of the invention;
fig. 7 is a flowchart of still another media stream processing method according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a media stream processing apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another media stream processing apparatus according to an embodiment of the present invention; and
fig. 10 is a schematic structural diagram of another media stream processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
video cloud is a cloud computing platform for providing a one-stop video solution for users, and comprises functions of recording, transcoding, live broadcast distribution and the like. The user only needs to upload the original video to the cloud end, and the service of the video cloud can be used.
An instant Messaging Protocol (RTMP) stream is a network Protocol for transmitting audio and video data in Real Time, a source station encapsulates the encoded audio and video data into an RTMP format and transmits the RTMP format to a video cloud service provider, and the cloud service provider performs subsequent processing and distribution.
The source station, namely a producer of audio and video data, can be a passive RTMP server or an active stream pushing server or client. The source station can inform the cloud service provider to pull data to the source station, and can also actively push the data to the cloud service provider.
Content Delivery network cdn (content Delivery network): the network media is characterized in that a user and a cloud transmit data, a source station uploads the data to a video cloud through a CDN, and the video cloud distributes processed audio and video data to the user through the CDN.
The backup stream (backup media stream) is a media stream formed by packaging an audio and video source, the source station packages the audio and video source into a plurality of RTMP streams with different names for the cloud service provider to use, and when a certain backup stream is unavailable, the cloud service provider can use other backup streams to ensure that the service is not interrupted.
Composite stream (composite media stream) refers to a more stable and better quality RTMP stream that includes multiple backup streams, and the user can use the composite stream to be consistent with the effect of the backup streams. And when a certain backup stream is abnormal, the composite stream can read the integrated data from other backup streams without influencing the data of the composite stream.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a media stream processing method, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that herein.
Before describing further details of embodiments of the present application, one suitable computer terminal that can be used to implement the principles of the present application will be described with reference to FIG. 1.
The method provided by the embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 is a hardware block diagram of a computer terminal (or mobile device) for implementing a media stream processing method, and as shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown with 102a, 102b, … …, 102n in the figure) (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication function. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the media stream processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, so as to implement the media stream processing method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
In the related field, a basic way of using a video cloud service is to encapsulate original video data into an RTMP stream, push (or notify a video cloud service provider to pull) real-time audio and video data to a cloud, and the cloud service provider performs subsequent processing and distribution work based on the acquired video stream data.
The source station and the cloud service provider generally transmit data through a public network, and are easily affected by network jitter to cause flow break in the transmission process, in order to guarantee stability and availability of the service, the source station can output a plurality of backup streams for audio and video data codes of the same content, when a certain backup stream is abnormal, the cloud service provider needs to have a mechanism to process how to switch the service to other backup streams, so that video service of a user is not affected, and service guarantee with higher availability is provided.
In the foregoing operating environment, to solve the foregoing technical problems in the prior art, an embodiment of the present application provides a media stream processing method as shown in fig. 2. Fig. 2 is a flowchart of a media stream processing method according to an embodiment of the present invention, and as shown in fig. 2, the media stream processing method provided in the embodiment of the present application may be implemented by the following method steps:
step S102, at least two media streams are received.
Specifically, the executing body of step S102 may be a video compositor, for example, an RTMP compositor. The video compositing device can be a high-definition video compositing device in a video cloud server or a client, such as Tencent cloud, gold mountain cloud, Baidu cloud, network host cloud and the like. In an optional embodiment, the media stream is an instant messaging protocol RTMP stream, and may be obtained by encoding and processing audio and video data.
In order to ensure the stability and availability of the service, the source station encodes audio and video data of the same content and outputs a plurality of media streams, that is, the source station originally transmits the same media stream, but the received media streams are different due to different transmission links.
As an alternative embodiment, the media stream data may be transmitted between the video compositor and a source station (an audio/video source station, i.e. a producer of audio/video data) through a content delivery network CDN. The video cloud service provider may receive at least two media streams pushed by the source station, or at least two media streams pulled from the source station by the video cloud service provider based on the notification of the source station.
It should be noted that, the source station serves as an RTMP server for passive service, or a server or a client for actively pushing streaming, and the source station may notify the cloud service provider to pull the media stream data from the source station, or may actively push the media stream data to the cloud service provider.
In an alternative embodiment, the at least two (at least two) media streams may be the same media stream, and the same at least two media streams may be transmitted by the same source stream through different transmission links, or may be transmitted by different source streams through different transmission links; wherein, the transmission quality of different transmission links is different, and the at least two media streams can be backup each other.
In this embodiment of the present application, the source station generates and outputs a media stream, and when the number of the media streams is two, the media stream a and the media stream b may be a media stream a and a media stream b, where the media stream a and the media stream b backup each other, when the media stream a is abnormal, the media stream b provides a service, and when the media stream b is abnormal, the media stream a provides a service, so that it is ensured that a video service provided by a cloud service provider to a user is not affected, and a service guarantee with higher availability is provided.
Fig. 3 is a schematic view of an implementation scenario of an optional media stream processing method according to an embodiment of the present invention, and as shown in fig. 3, a source station may push the media stream a and the media stream b (not shown in fig. 3) to a content delivery network CDN of a cloud service provider (the source station may also notify the CDN to pull the media stream a and the media stream b), where the media stream a and the media stream b are transmitted to the content delivery network CDN by a same source stream through different transmission links, and then the media stream a and the media stream b are transmitted to a video compositor by different transmission links.
As also shown in fig. 3, the source station transmits the media stream a to the content delivery network CDN via the transmission link 1; the source station transmits the media stream b to a Content Delivery Network (CDN) through a transmission link 2, and the CDN transmits the media stream a to a video combiner through a transmission link 3; the CDN transmits the above media stream b to the video compositor over the transmission link 4. Moreover, the transmission qualities of the transmission link 1 and the transmission link 2 are different, and the transmission qualities of the transmission link 3 and the transmission link 4 are also different.
It should be noted that, compared with the prior art in which the switching process is placed in the distribution link of the composite stream, the data processing scheme provided in the embodiments of the present application provides an embodiment with a significant technical effect, and by performing the switching process on the exception of the media stream before the streaming media processing link, it is possible to implement that the user does not perceive the subsequent streaming media processing and distribution links after performing the switching process, and the player does not need to perform the switching process, thereby reducing the cost of being compatible with different players. Moreover, when the streaming media processing module processes, it is not necessary to consider synchronizing a plurality of backup streams, and the streaming media processing module only needs to process one path of composite stream, thereby reducing the resource consumption of the system.
It should still be noted that by building the Proxy server Proxy, the abnormal switching processing of the backup media stream in the embodiment of the present application may also be implemented in the distribution link of the composite stream, and may also be implemented at the consuming end (player), and the implementation manner may be, but is not limited to, the same as or similar to the media stream processing method provided in the embodiment of the present application except that the Proxy server Proxy needs to be built, and is not described in detail herein.
And step S104, compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
In step S104, the present embodiment may combine at least two (multiple/multiple) media streams through the RTMP compositor to generate a composite stream.
Alternatively, the composite stream (composite media stream) may be a more stable and better quality RTMP stream including multiple media streams (which are composed of multiple media streams). It should be noted that the user can use the composite stream to conform to the effect of the media stream. And when a certain media stream is abnormal, the composite stream can read the integrated data from other media streams, and the data of the composite stream is not influenced.
As shown in fig. 3, in an optional embodiment, the RTMP compositor may push the generated composite stream to a subsequent streaming media processing module (or may notify the streaming media processing module to pull the composite stream), and then the streaming media processing module distributes the processed data to a user side video player, and the video player plays the received composite stream.
As an optional embodiment, the streaming media processing module may process the composite stream, for example, slice, transcode, and then distribute the composite stream data processed by the streaming media processing module to the user through the content delivery network CDN.
In an alternative embodiment, when the quality of the multiple media streams is poor (for example, the hiton rate is high, frame loss occurs, etc.), the RTMP recombiner can improve the quality of the finally output composite stream by integrating the data of the multiple media streams, thereby achieving the technical effect that other schemes in the prior art cannot achieve. And the RTMP recombiner can realize seamless and lossless switching of media streams, has shorter service recovery time and basically has no influence on users.
Based on the solution defined in the foregoing embodiment, it can be known that, by receiving at least two media streams, where the at least two media streams are transmitted through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backup to each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
According to the scheme provided by the embodiment of the application, the aim of quickly switching the service to other backup media streams in a lossless manner when a certain backup media stream is abnormal is achieved, so that the technical effects of effectively reducing the influence of source station fluctuation on the video cloud service and improving the system availability are achieved, and the technical problem that multiple backup media streams cannot be quickly and nondestructively switched in the prior art is solved.
In an alternative embodiment, fig. 4 is a flowchart of an alternative media stream processing method according to an embodiment of the present invention, and as shown in fig. 4, the step S104, which compounds the at least two media streams to generate a composite stream, may be implemented by the following method steps:
step S202, detecting frame rates of the at least two media streams.
In the step S202, the frame rate is a measure for measuring the number of display frames of at least two media streams, and the measuring unit may be, but is not limited to, the number of display frames per second or hertz.
Step S204, according to the detected frame rates of the at least two media streams, compositing the at least two media streams.
In this application, as an alternative embodiment, in step S204, the at least two media streams are composited according to the detected frame rates of the at least two media streams, and the method may include the following steps:
in step S2041, when the detected frame rates of the at least two media streams include a frame rate satisfying a frame rate condition, the media stream corresponding to the frame rate is regarded as the composite stream.
In the step S2041, the frame rate condition is that the frame rate reaches a predetermined frame rate and continues to reach a predetermined time.
As an alternative embodiment, the predetermined frame rate may be, but not limited to, 16, and may also be a frame rate higher than 16; the unit of the predetermined time period may be, but is not limited to, a second, and the predetermined time period may be, but is not limited to, 3 to 5 seconds, and the like, so that the embodiment of the present application may be implemented.
It should be noted that due to the special physiological structure of the human glasses, when the frame rate of the viewed pictures is higher than 16, the viewed pictures are considered to be consecutive, for example, the frame rate of the movie is 23.976fps, and the frame rate of the television (PAL) is 25fps, but the frame rate of the game (e.g., shooting game) is higher than the frame rate, and generally not lower than 30 fps.
As an alternative embodiment, in step S2041, when the detected frame rates of the at least two media streams include a frame rate that satisfies a frame rate condition, the media stream corresponding to the frame rate is used as the composite stream, and the method includes the following steps:
step S20410, detecting that the frame rate of the first media stream of the at least two media streams satisfies the frame rate condition, and using the first media stream as the composite stream.
Step S20412 is executed to detect that the first media stream does not satisfy the frame rate condition, and detect that the frame rate of a second media stream of the at least two media streams satisfies the frame rate condition, and adjust the first media stream as the composite stream to use the second media stream as the composite stream.
The first media stream and the second media stream are backup streams.
In the above optional embodiment, by detecting whether the frame rates of the at least two media streams include a frame rate that satisfies a frame rate condition, when it is detected that a first media stream of the at least two media streams is abnormal, for example, when it is detected that the first media stream does not satisfy the frame rate condition, and it is detected that a frame rate of a second media stream of the at least two media streams satisfies the frame rate condition, the first media stream may be adjusted as the composite stream to be the second media stream as the composite stream.
Based on the optional embodiments provided in steps S20410 to S20412, the quality of the composite stream can be effectively prevented from being affected by the abnormal media stream, so that the subsequent service distribution and consumption link is unaware of the abnormality of the source station, and the stability of the streaming media service is effectively improved.
In an optional embodiment, fig. 5 is a flowchart of an optional media stream processing method according to an embodiment of the present invention, and as shown in fig. 5, after the step S104, that is, after the at least two media streams are composited to generate a composite stream, the media stream processing method further includes the following method steps:
step S106, sending the composite stream to the streaming media processing module when the composite stream meets a predetermined media stream quality condition.
In step S106, the predetermined media stream quality condition is a condition of a source stream that reproduces the composite stream to a predetermined degree, and the source stream is a media stream transmitted from a source station.
It should be noted that the predetermined degree may be, but is not limited to: the degree of higher media stream quality, such as lower pause rate, lower frame loss rate, etc.
Through the optional embodiment, when the quality of the multi-path media stream is poor (for example, the hiton rate is high, frame loss occurs, and the like), the RTMP recombiner can improve the quality of the finally output composite stream by integrating the data of the multi-path media stream, and achieve the technical effect that other schemes in the prior art cannot achieve.
As an alternative embodiment, the step S106 of sending the composite stream to the streaming media processing module includes:
step S1061, pushing the composite stream to the streaming media processing module.
As another optional embodiment, sending the composite stream to the streaming media processing module includes:
step S1063, sending a notification message to the streaming media processing module, where the notification message is used to notify the streaming media module to pull the composite stream.
As an alternative embodiment, the composite stream may be transmitted between the compositor (video compositor) and the streaming media processing module via a content delivery network CDN. The streaming media processing module can receive the composite stream pushed by the compositor, or the streaming media processing module pulls the composite stream from the compositor based on the notification message of the compositor.
It should be noted that the compositor may be a passive RTMP compositor or an active stream pushing compositor, and the compositor may send a notification message to notify the streaming media processing module to pull the composite stream data from the compositor, and may also actively push the composite stream data to the streaming media processing module, so that the streaming media processing module processes the composite stream data, thereby reducing resource consumption of the system.
In another optional embodiment, after the step S104, after the at least two media streams are composited into a composite stream, the method further includes:
step S108, sending out prompt information when the composite stream does not satisfy the preset media stream quality condition, wherein the prompt information is used for prompting that the composite stream can not be reproduced to the preset degree.
In step S108, as an optional implementation manner, if the composite stream does not satisfy the predetermined media stream quality condition, the compositor may send a prompt message to the source station through the content distribution network, so as to prompt the source station that the media stream quality condition of the currently transmitted media stream is low, and the source stream cannot be reproduced to a predetermined degree according to that the composite stream obtained by compositing the currently transmitted media streams cannot satisfy the predetermined media stream quality condition.
In the above embodiment, after receiving the hint information, the source station may retransmit at least two media streams to the compositor, and then the compositor may further composite a plurality of media streams to improve the quality of the finally output composite stream.
Through the optional embodiment, when the quality of the multi-path media stream is poor (for example, the situations of high pause rate, frame loss and the like occur), the RTMP recombiner can output prompt information for prompting the source station so as to improve the quality of the finally output composite stream, and achieve the technical effect which cannot be achieved by other schemes in the prior art.
The media stream processing method provided by the embodiment of the application can compound a plurality of independent media streams (or called as backup RTMP streams) into a compound stream with better and more stable quality, and then perform subsequent streaming media processing and distribution based on the compound stream.
It should be noted that any optional or preferred media stream processing method in the embodiments of the present application may be executed or implemented in the media stream processing apparatus provided in the embodiments of the present application.
Example 2
There is also provided, in accordance with an embodiment of the present invention, another method embodiment of a method for media stream processing, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that presented herein.
It should be noted that the method embodiment provided in embodiment 2 of the present application may be executed in the computer terminal 10 (or the mobile device 10) shown in fig. 1 or a similar computing device. Fig. 6 is a flowchart of another media stream processing method according to an embodiment of the present invention, and as shown in fig. 6, the media stream processing method provided in the embodiment of the present application may be implemented by the following method steps:
step S602, a composite stream is received, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other.
The executing main body of the step S602 may be a streaming media processing module, and may be a streaming media processing module in a video cloud server or a client, such as a Tencent cloud, a Jinshan cloud, a Baidu cloud, a network hosting cloud, and the like, where the streaming media processing module may be a processor. The video compositor may be an RTMP compositor. The source station is an audio and video source station, namely a producer of audio and video data.
In an optional embodiment, the media stream is an instant messaging protocol RTMP stream, and may be obtained by encoding and processing audio and video data.
In order to ensure the stability and availability of the service, the source station encodes audio and video data of the same content and outputs a plurality of media streams, that is, the source station originally transmits the same media stream, but the received media streams are different due to different transmission links.
Optionally, the composite stream may be a more stable and better quality RTMP stream including (or composed of) a plurality of backup streams. It should be noted that the user can use the composite stream to be consistent with the effect of the backup stream. And when a certain backup stream is abnormal, the composite stream can read the integrated data from other backup streams without influencing the data of the composite stream.
In an alternative embodiment, the at least two (at least two) media streams may be the same media stream, and the same at least two media streams may be transmitted by the same source stream through different transmission links, or may be transmitted by different source streams through different transmission links; wherein, the transmission quality of different transmission links is different, and the at least two media streams can be backup each other.
As an alternative embodiment, the media stream data may be transmitted between the video compositor and the source station through a content delivery network CDN. The video cloud facilitator may receive at least two media streams pushed by the source station, or at least two media streams pulled from the source station by the video cloud facilitator based on the notification of the source station.
As an alternative embodiment, a composite stream may be transmitted between the compositor (RTMP compositor) and the streaming media processing module through the content delivery network CDN. The streaming media processing module can receive the composite stream pushed by the compositor, or the streaming media processing module pulls the composite stream from the compositor based on the notification message of the compositor.
In the above embodiments, the present application may combine at least two (multiple/multiple) media streams by the combiner to generate one composite stream.
In an optional embodiment, the compositor may push the generated composite stream to a streaming media processing module in this embodiment (or may notify the streaming media processing module to pull the composite stream), and then the streaming media processing module distributes the processed data to a video player at a user side, and the video player plays the received composite stream.
In this application, as an optional embodiment, in a case that the composite stream meets a predetermined media stream quality condition, the composite stream is sent to the streaming media processing module. The predetermined media stream quality condition is a condition of a source stream that reproduces the composite stream to a predetermined degree, and the source stream is a media stream transmitted from a source station.
It should be noted that, compared with the prior art in which the switching process is implemented in the distribution link of the composite stream, the data processing scheme provided in the embodiments of the present application provides an embodiment with a significant technical effect, and by performing the switching process on the exception of the media stream before the streaming media processing link, it is possible to implement that the user does not perceive the subsequent streaming media processing and distribution links after performing the switching process, and the player does not need to perform the switching process, thereby reducing the cost of being compatible with different players.
In addition, when the streaming media processing module processes, the synchronization of a plurality of backup streams is not needed to be considered, and the streaming media processing module only needs to process one path of composite stream, thereby reducing the resource consumption of the system.
It should still be noted that by building the Proxy server Proxy, the abnormal switching processing of the backup media stream in the embodiment of the present application may also be implemented in the distribution link of the composite stream, and may also be implemented at the consuming end (player), and the implementation manner may be, but is not limited to, the same as or similar to the media stream processing method provided in the embodiment of the present application except that the Proxy server Proxy needs to be built, and is not described in detail herein.
Step S604, distributing the received composite stream.
As an optional embodiment, the streaming media processing module may process the composite stream, for example, slice, transcode, and then the streaming media processing module distributes the processed composite stream data to a user-side device through the content delivery network CDN, for example, may distribute the processed composite stream data to a video player on the user side.
In an optional embodiment, when the quality of the multiple media streams is poor (for example, the hiton rate is high, frame loss occurs, etc.), the data of the multiple media streams may be integrated by the RTMP compositor to improve the quality of the finally output composite stream, thereby achieving the technical effect that cannot be achieved by other schemes in the prior art. And further, seamless and lossless switching of media streams can be realized, the service recovery time is shorter, and the influence on users is basically avoided.
Based on the solution defined in the foregoing embodiment, it can be known that a composite stream is received, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backup for each other; and distributing the received composite stream.
According to the scheme provided by the embodiment of the application, the purpose of integrating the data of the multiple paths of media streams through the compositor to improve the quality of the finally output composite stream is achieved, the technical effects of effectively reducing the influence of source station fluctuation on the video cloud service and improving the system availability are achieved, and the technical problem that the multiple paths of backup media streams cannot be rapidly and nondestructively switched in the prior art is solved.
It should be noted that, reference may be made to the relevant description in embodiment 1 for a preferred implementation of this embodiment, and details are not described here again.
Example 3
There is also provided, in accordance with an embodiment of the present invention, yet another method embodiment of a method for media stream processing, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
It should be noted that the method embodiment provided in embodiment 3 of the present application may be executed in the computer terminal 10 (or the mobile device 10) shown in fig. 1 or a similar computing device. Fig. 7 is a flowchart of another media stream processing method according to an embodiment of the present invention, and as shown in fig. 7, the media stream processing method provided in the embodiment of the present application may be implemented by the following method steps:
step S702, receiving a composite stream, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other;
step S704, playing the received composite stream.
The main body of the step S702 may be a user-side device, such as, but not limited to, a video player, a display (e.g., a player or a display in a displayable terminal such as a large display screen, a mobile terminal, a computer terminal, etc.); the above-mentioned recombiner is a video recombiner, for example, an RTMP recombiner; the source station is an audio and video source station, namely a producer of audio and video data.
Alternatively, the composite stream (composite media stream) may be a more stable and better quality RTMP stream including (or composed of) a plurality of backup streams. It should be noted that the user can use the composite stream to be consistent with the effect of the backup stream. And when a certain backup stream is abnormal, the composite stream can read the integrated data from other backup streams without influencing the data of the composite stream.
As an alternative embodiment, the media stream data may be transmitted between the video compositor and the source station through a content delivery network CDN. The video cloud facilitator may receive at least two media streams pushed by the source station, or at least two media streams pulled from the source station by the video cloud facilitator based on the notification of the source station.
In an alternative embodiment, the at least two (at least two) media streams may be the same media stream, and the same at least two media streams may be transmitted by the same source stream through different transmission links, or may be transmitted by different source streams through different transmission links; wherein, the transmission quality of different transmission links is different, and the at least two media streams can be backup each other.
In an optional embodiment, the media stream is an instant messaging protocol RTMP stream, and may be obtained by encoding and processing audio and video data.
In order to ensure the stability and availability of the service, the source station encodes audio and video data of the same content and outputs a plurality of media streams, that is, the source station originally transmits the same media stream, but the received media streams are different due to different transmission links.
As an alternative embodiment, the composite stream may be transmitted between the compositor and the streaming media processing module through a content delivery network CDN. The streaming media processing module can receive the composite stream pushed by the compositor, or the streaming media processing module pulls the composite stream from the compositor based on the notification message of the compositor.
In the foregoing embodiment, in the embodiment of the present application, a compositor may composite at least two (multiple/multiple) media streams to generate a composite stream, and the compositor may push the generated composite stream to a streaming media processing module in the embodiment of the present application (or may notify the streaming media processing module to pull the composite stream), so that the streaming media processing module distributes processed data to a user side device.
As an optional embodiment, the streaming media processing module may process the composite stream, for example, slice, transcode, and the like, and then the streaming media processing module distributes the processed composite stream data to a user side device through the content delivery network CDN, for example, the processed composite stream data may be distributed to a video player on the user side, and then the video player plays the received composite stream data, and the video player does not need to perform switching processing, thereby reducing the cost of being compatible with different players.
In an optional embodiment, when the quality of the multiple media streams is poor (for example, the hiton rate is high, frame loss occurs, etc.), the data of the multiple media streams may be integrated by the RTMP compositor to improve the quality of the finally output composite stream, thereby achieving the technical effect that cannot be achieved by other schemes in the prior art. And further, seamless and lossless switching of media streams can be realized, the service recovery time is shorter, and the influence on users is basically avoided.
It should be noted that, compared with the prior art in which the switching processing is implemented in the distribution link of the composite stream, the data processing scheme provided in the embodiments of the present application provides an embodiment with a significant technical effect, and by performing the switching processing on the exception of the media stream before the streaming media processing link, it is possible to implement that the user has no perception on the subsequent streaming media processing and distribution links after performing the switching processing, and when the streaming media processing module performs the processing, it is not necessary to consider synchronizing a plurality of backup streams, only one composite stream needs to be processed, and resource consumption of the system is also reduced.
It should still be noted that by building the Proxy server Proxy, the abnormal switching processing of the backup media stream in the embodiment of the present application may also be implemented in the distribution link of the composite stream, and may also be implemented at the consuming end (player), and the implementation manner may be, but is not limited to, the same as or similar to the media stream processing method provided in the embodiment of the present application except that the Proxy server Proxy needs to be built, and is not described in detail herein.
Based on the solution defined in the foregoing embodiment, it can be known that, by receiving a composite stream, where the composite stream is obtained by compositing at least two media streams, where the at least two media streams are obtained by transmitting through different transmission links, and the transmission qualities of the different transmission links are different, the at least two media streams are backup for each other; and playing the received composite stream.
According to the scheme provided by the embodiment of the application, when the video player plays the composite stream, switching processing is not needed, and the cost of being compatible with different players is reduced, so that the technical effects of effectively reducing the influence of source station fluctuation on video cloud service and improving the availability of a system are achieved, and the technical problem that in the prior art, multi-path backup media streams cannot be switched rapidly and nondestructively is solved.
It should be noted that, reference may be made to the relevant description in embodiment 1 for a preferred implementation of this embodiment, and details are not described here again.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 4
According to an embodiment of the present invention, there is further provided a media stream processing apparatus for implementing the media stream processing method in embodiment 1, and fig. 8 is a schematic structural diagram of the media stream processing apparatus according to an embodiment of the present invention, and as shown in fig. 8, the apparatus includes: a receiving module 80 and a compounding module 82.
A receiving module 80, configured to receive at least two media streams, where the at least two media streams are transmitted through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backup for each other; and a composition module 82, configured to composite the at least two media streams to generate a composite stream, where the composite stream is distributed after being processed by the stream media processing module.
It should be noted here that the receiving module 80 and the combining module 82 correspond to steps S102 to S104 in embodiment 1, and the two modules are the same as the corresponding steps in the example and application scenarios, but are not limited to the disclosure of embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
According to an aspect of the embodiments of the present invention, there is also provided a compositor, including the above media stream processing apparatus, wherein the apparatus includes: a receiving module 80 and a compounding module 82.
It should be noted that, reference may be made to the relevant description in embodiments 1, 2 and 3 for a preferred implementation of this embodiment, and details are not described here again.
Example 5
According to an embodiment of the present invention, there is further provided a media stream processing apparatus for implementing the media stream processing method in embodiment 2, and fig. 9 is a schematic structural diagram of another media stream processing apparatus according to an embodiment of the present invention, as shown in fig. 9, the apparatus includes: a second receiving module 90 and a distributing module 92.
A second receiving module 90, configured to receive a composite stream, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backup for each other; and a distributing module 92, configured to distribute the received composite stream.
It should be noted here that the second receiving module 90 and the distributing module 92 correspond to steps S602 to S604 in embodiment 2, and the two modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 2. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
According to an aspect of the embodiments of the present invention, there is also provided a distributor including the above media stream processing apparatus, wherein the apparatus includes: a second receiving module 90 and a distributing module 92.
It should be noted that, reference may be made to the relevant description in embodiments 1, 2 and 3 for a preferred implementation of this embodiment, and details are not described here again.
Example 6
According to an embodiment of the present invention, there is further provided a media stream processing apparatus for implementing the media stream processing method in embodiment 3, and fig. 10 is a schematic structural diagram of another media stream processing apparatus according to an embodiment of the present invention, as shown in fig. 10, the apparatus includes: a third receiving module 100 and a playing module 120.
A third receiving module 100, configured to receive a composite stream, where the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; the playing module 120 is configured to play the received composite stream.
It should be noted here that the third receiving module 100 and the playing module 120 correspond to steps S702 to S704 in embodiment 23, and the two modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 3. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
According to an aspect of the embodiments of the present invention, there is also provided a player including the above media stream processing apparatus, wherein the apparatus includes: a third receiving module 100 and a playing module 120.
It should be noted that, reference may be made to the relevant description in embodiments 1, 2 and 3 for a preferred implementation of this embodiment, and details are not described here again.
Example 7
The embodiment of the invention can provide a computer terminal which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute program codes of the following steps in the media stream processing method of the application program: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
Alternatively, as also shown in fig. 1, the computer terminal 10 may include: one or more processors, memory, and display devices, among others.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
Optionally, the processor may further execute the program code of the following steps: detecting frame rates of the at least two media streams; and compositing the at least two media streams according to the detected frame rates of the at least two media streams.
Optionally, the processor may further execute the program code of the following steps: and under the condition that the detected frame rates of the at least two media streams include a frame rate meeting a frame rate condition, taking the media stream corresponding to the frame rate as the composite stream, wherein the frame rate condition is that the frame rate reaches a preset frame rate and continues to reach a preset time length.
Optionally, the processor may further execute the program code of the following steps: detecting that the frame rate of a first media stream of the at least two media streams satisfies the frame rate condition, and taking the first media stream as the composite stream; and adjusting the first media stream as the composite stream to the second media stream as the composite stream when detecting that the first media stream does not satisfy the frame rate condition and detecting that the frame rate of the second media stream of the at least two media streams satisfies the frame rate condition.
Optionally, the processor may further execute the program code of the following steps: and transmitting the composite stream to the streaming media processing module when the composite stream satisfies a predetermined media stream quality condition, wherein the predetermined media stream quality condition is a condition for a source stream that reproduces the composite stream to a predetermined degree, and the source stream is a media stream transmitted from a source station.
Optionally, the processor may further execute the program code of the following steps: and pushing the composite stream to the streaming media processing module.
Optionally, the processor may further execute the program code of the following steps: and sending a notification message to the streaming media processing module, wherein the notification message is used for notifying the streaming media module to pull the composite stream.
Optionally, the processor may further execute the program code of the following steps: and sending prompt information when the composite stream does not meet the preset media stream quality condition, wherein the prompt information is used for prompting that the composite stream cannot be reproduced to the preset degree.
Optionally, the processor may further execute the program code of the following steps: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and distributing the received composite stream.
Optionally, the processor may further execute the program code of the following steps: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and playing the received composite stream.
The embodiment of the invention provides a data processing scheme. Receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; the at least two media streams are composited to generate a composite stream, wherein the composite stream is distributed after being processed by the stream media processing module, so that the purpose of rapidly switching the service to other backup media streams in a lossless manner when a certain backup media stream is abnormal is achieved, the technical effects of effectively reducing the influence of source station fluctuation on the video cloud service and improving the system availability are achieved, and the technical problem that multiple backup media streams cannot be rapidly and nondestructively switched in the prior art is solved.
It can be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 1 is a diagram illustrating a structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 8
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store program codes executed by the media stream processing methods provided in embodiments 1, 2, and 3.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by the stream media processing module.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: detecting frame rates of the at least two media streams; and compositing the at least two media streams according to the detected frame rates of the at least two media streams.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and under the condition that the detected frame rates of the at least two media streams include a frame rate meeting a frame rate condition, taking the media stream corresponding to the frame rate as the composite stream, wherein the frame rate condition is that the frame rate reaches a preset frame rate and continues to reach a preset time length.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: detecting that the frame rate of a first media stream of the at least two media streams satisfies the frame rate condition, and taking the first media stream as the composite stream; and adjusting the first media stream as the composite stream to the second media stream as the composite stream when detecting that the first media stream does not satisfy the frame rate condition and detecting that the frame rate of the second media stream of the at least two media streams satisfies the frame rate condition.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and pushing the composite stream to the streaming media processing module.
Optionally, the processor may further execute the program code of the following steps: and sending a notification message to the streaming media processing module, wherein the notification message is used for notifying the streaming media module to pull the composite stream.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and sending prompt information when the composite stream does not meet the preset media stream quality condition, wherein the prompt information is used for prompting that the composite stream cannot be reproduced to the preset degree.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and distributing the received composite stream.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a composite stream, wherein the composite stream is obtained by compositing at least two media streams, the at least two media streams are obtained by transmitting through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other; and playing the received composite stream.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for processing a media stream, comprising:
receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other;
compounding the at least two media streams to generate a compound stream, wherein the compound stream is distributed after being processed by a stream media processing module;
wherein the at least two media streams are composited by a compositor to generate one composite stream.
2. The method of claim 1, wherein compositing the at least two media streams, generating a composite stream comprises:
detecting frame rates of the at least two media streams;
and compositing the at least two media streams according to the detected frame rates of the at least two media streams.
3. The method of claim 2, wherein compositing the at least two media streams according to the detected frame rates of the at least two media streams comprises:
and under the condition that the detected frame rates of the at least two media streams include a frame rate meeting a frame rate condition, taking the media stream corresponding to the frame rate as the composite stream, wherein the frame rate condition is that the frame rate reaches a preset frame rate and continues to reach a preset time length.
4. The method according to claim 3, wherein in a case that the detected frame rates of the at least two media streams include a frame rate that satisfies a frame rate condition, taking the media stream corresponding to the frame rate as the composite stream includes:
detecting that the frame rate of a first media stream of the at least two media streams meets the frame rate condition, and taking the first media stream as the composite stream;
and adjusting the first media stream as the composite stream to the second media stream as the composite stream when the first media stream is detected not to meet the frame rate condition and the frame rate of the second media stream of the at least two media streams is detected to meet the frame rate condition.
5. The method of claim 1, further comprising, after compositing the at least two media streams, generating a composite stream:
and sending the composite stream to the streaming media processing module when the composite stream meets a preset media stream quality condition, wherein the preset media stream quality condition is a condition of a source stream which reproduces the composite stream to a preset degree, and the source stream is a media stream sent from a source station.
6. The method of claim 5, wherein sending the composite stream to the streaming media processing module comprises:
and pushing the composite stream to the streaming media processing module.
7. The method of claim 5, wherein sending the composite stream to the streaming media processing module comprises:
sending a notification message to the streaming media processing module, wherein the notification message is used for notifying the streaming media processing module to pull the composite stream.
8. The method of claim 5, further comprising, after compositing the at least two media streams into one composite stream:
and sending prompt information under the condition that the composite stream does not meet the preset media stream quality condition, wherein the prompt information is used for prompting that the composite stream cannot be reproduced to the preset degree.
9. The method according to any of claims 1 to 8, wherein the media stream is an instant messaging protocol, RTMP, stream.
10. A media stream processing apparatus, comprising:
the receiving module is used for receiving at least two media streams, wherein the at least two media streams are transmitted through different transmission links, the transmission qualities of the different transmission links are different, and the at least two media streams are backups of each other;
the composite module is used for compositing the at least two media streams to generate a composite stream, wherein the composite stream is distributed after being processed by the stream media processing module;
wherein the at least two media streams are composited by a compositor to generate one composite stream.
CN201810366138.1A 2018-04-23 2018-04-23 Media stream processing method and device Active CN110392285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810366138.1A CN110392285B (en) 2018-04-23 2018-04-23 Media stream processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810366138.1A CN110392285B (en) 2018-04-23 2018-04-23 Media stream processing method and device

Publications (2)

Publication Number Publication Date
CN110392285A CN110392285A (en) 2019-10-29
CN110392285B true CN110392285B (en) 2022-04-19

Family

ID=68284358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810366138.1A Active CN110392285B (en) 2018-04-23 2018-04-23 Media stream processing method and device

Country Status (1)

Country Link
CN (1) CN110392285B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404882B (en) * 2020-03-02 2022-03-25 广州华多网络科技有限公司 Media stream processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106341622A (en) * 2015-07-06 2017-01-18 阿里巴巴集团控股有限公司 Multi-channel video stream coding method and device
CN107209948A (en) * 2015-01-21 2017-09-26 谷歌公司 Create the technology of combination picture

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8830293B2 (en) * 2009-05-26 2014-09-09 Cisco Technology, Inc. Video superposition for continuous presence

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107209948A (en) * 2015-01-21 2017-09-26 谷歌公司 Create the technology of combination picture
CN106341622A (en) * 2015-07-06 2017-01-18 阿里巴巴集团控股有限公司 Multi-channel video stream coding method and device

Also Published As

Publication number Publication date
CN110392285A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN107846633B (en) Live broadcast method and system
CN111225230B (en) Management method and related device for network live broadcast data
US10277865B2 (en) Data transmission method and system, and related devices
US8813160B2 (en) Method, system and user device for obtaining a key frame in a streaming media service
CN112399190B (en) Audio and video data acquisition method and device
CN114546308B (en) Method, device, equipment and storage medium for screen projection of application interface
CN109218759A (en) Push method, apparatus, server and the storage medium of Media Stream
US20230045876A1 (en) Video Playing Method, Apparatus, and System, and Computer Storage Medium
CN113114688B (en) Multimedia conference management method and device, storage medium and electronic equipment
CN110062268A (en) A kind of audio-video sends and receives processing method and processing device with what screen played
CN202759552U (en) Multi-terminal video synchronous playing system based on IP network
WO2016008131A1 (en) Techniques for separately playing audio and video data in local networks
CN114554277B (en) Multimedia processing method, device, server and computer readable storage medium
US20240196024A1 (en) Live Video Playback
CN112073543A (en) Cloud video recording method and system and readable storage medium
CN110943977A (en) Multimedia service data transmission method, server, equipment and storage medium
CN108513159A (en) Multiple terminals synchronous broadcast controlling method, main equipment, apparatus and system
CN109756744B (en) Data processing method, electronic device and computer storage medium
CN106658065B (en) Audio and video synchronization method, device and system
CN111193936B (en) Video streaming transmission method and device, electronic equipment and computer readable storage medium
CN110392285B (en) Media stream processing method and device
WO2016169482A1 (en) Message transmission method, code stream processing method and device
CN104469248A (en) Video session method and device, server and terminal
Marfil et al. IDMS solution for hybrid broadcast broadband delivery within the context of HbbTV standard
CN108632681B (en) Method, server and terminal for playing media stream

Legal Events

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