CN108377243B - Live streaming transmission method and device - Google Patents

Live streaming transmission method and device Download PDF

Info

Publication number
CN108377243B
CN108377243B CN201810157039.2A CN201810157039A CN108377243B CN 108377243 B CN108377243 B CN 108377243B CN 201810157039 A CN201810157039 A CN 201810157039A CN 108377243 B CN108377243 B CN 108377243B
Authority
CN
China
Prior art keywords
live stream
stream
message data
live
anchor terminal
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
CN201810157039.2A
Other languages
Chinese (zh)
Other versions
CN108377243A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810157039.2A priority Critical patent/CN108377243B/en
Publication of CN108377243A publication Critical patent/CN108377243A/en
Application granted granted Critical
Publication of CN108377243B publication Critical patent/CN108377243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream

Abstract

The embodiment of the invention provides a method and a device for transmitting a live stream, wherein the method comprises the following steps: establishing communication connection between the anchor terminal and the streaming server; generating a first direct-broadcasting stream; responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream; and pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream. The method solves the technical problem of high system overhead in the existing live stream transmission method.

Description

Live streaming transmission method and device
Technical Field
The invention relates to the technical field of live video, in particular to a live stream transmission method and device.
Background
With the development of the live broadcast technology, a lot of convenience is brought to the work and life of people.
Currently, a main broadcast end and a user end generally perform live stream transmission through a stream server, in the live stream transmission, the main broadcast end and the user end generally need to perform data communication, for example, live room information, user information, and the like are transmitted. Then, in this way, a separate TCP server needs to be erected to realize the communication between the anchor terminal and the user terminal, so that the system overhead is large, and meanwhile, the construction and maintenance work of the server is increased.
Therefore, the technical problem of high system overhead exists in the existing live stream transmission method.
Disclosure of Invention
The embodiment of the invention provides a live stream transmission method and a live stream transmission device, which are used for solving or at least partially solving the technical problem of high system overhead in the existing live stream transmission method.
In a first aspect, the present invention provides a method for transmitting a live stream, where the method includes:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream;
and pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream.
Optionally, in response to a trigger operation on the anchor terminal, adding message data to the first live stream to obtain a second live stream, where the method includes:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection;
and adding the message data to the first live stream through the preset processing method to obtain the second live stream.
Optionally, the pushing the second live stream to the streaming server based on the communication connection includes:
establishing a streaming connection based on the communication connection;
associating a camera of the anchor with the stream connection;
pushing the second live stream to the streaming server based on the association.
Based on the same inventive concept, a second aspect of the present invention provides a method for transmitting a live stream, where the method includes:
establishing communication connection between the streaming server and the anchor terminal;
receiving a second live stream pushed by the anchor terminal based on the communication connection, wherein the second live stream is obtained by responding to a trigger operation of the anchor terminal after the anchor terminal generates a first live stream and adding message data into the first live stream;
and transmitting the second live stream to a user side so that the user side executes logic operation responding to the message data when playing the second live stream.
Based on the same inventive concept, a third aspect of the present invention provides a live stream transmission method, including:
receiving a second live stream transmitted by a stream server, wherein the second live stream is pushed to the stream server by an anchor terminal based on communication connection between the stream server and the anchor terminal, and the second live stream is obtained after adding message data in the first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
and playing the second live stream and executing logic operation responding to the message data.
Based on the same inventive concept, a fourth aspect of the present invention provides a device for transmitting a live stream, where the device is a main broadcast end, and the device includes:
the establishing module is used for establishing communication connection between the anchor terminal and the streaming server;
the generating module is used for generating a first direct-current stream;
the adding module is used for responding to the triggering operation of the anchor terminal and adding message data in the first live stream to obtain a second live stream;
and the pushing module is used for pushing the second live stream to the stream server based on the communication connection and transmitting the second live stream to the user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream.
Based on the same inventive concept, a fifth aspect of the present invention provides a live stream transmission apparatus, where the apparatus is a server, and the apparatus includes:
the establishing module is used for establishing communication connection between the streaming server and the anchor terminal;
a receiving module, configured to receive a second live stream pushed by the anchor terminal based on the communication connection, where the second live stream is obtained after message data is added to a first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
and the transmission module is used for transmitting the second live stream to a user side so that the user side executes logic operation responding to the message data when playing the second live stream.
Based on the same inventive concept, a sixth aspect of the present invention provides a live stream transmission apparatus, where the apparatus is a user side, and the apparatus includes:
the receiving module is used for receiving a second live stream transmitted by a stream server, wherein the second live stream is pushed to the stream server by an anchor terminal based on communication connection between the stream server and the anchor terminal, and the second live stream is obtained by responding to triggering operation of the anchor terminal and adding message data into a first live stream after the first live stream is generated by the anchor terminal;
and the playing module is used for playing the second live stream and executing the logic operation responding to the message data.
Based on the same inventive concept, a seventh aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method provided by the first aspect.
Based on the same inventive concept, an eighth aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method provided by the first aspect when executing the program.
One or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
in the method provided by the invention, after the anchor terminal generates the first live stream, the message data is added in the first live stream to obtain the second live stream in response to the trigger operation of the anchor terminal, then the second live stream is pushed to the stream server, and the second live stream is transmitted to the user terminal through the stream server, and the second live stream carries the message data of the anchor terminal, so that the user terminal can execute the logic operation responding to the message data, thereby realizing the data communication between the user terminal and the anchor terminal. That is, in the process of live stream transmission by the anchor terminal through the stream server, data communication can be performed with the user terminal by adding message data to the first live stream without erecting an additional TCP server to transmit messages, so that the anchor terminal communicates with the user terminal, thereby reducing the system overhead and the construction and maintenance costs of the server. The technical problem that the existing live stream transmission method is high in system overhead is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a live stream transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart of another live stream transmission method according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for transmitting a live stream according to another embodiment of the present invention;
fig. 4 is a block diagram of a live streaming transmission apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of another apparatus for transmitting a live stream according to an embodiment of the present invention;
fig. 6 is a block diagram of a transmission apparatus for live streaming according to another embodiment of the present invention;
FIG. 7 is a block diagram of a computer-readable storage medium according to an embodiment of the present invention;
fig. 8 is a block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a live stream transmission method and a live stream transmission device, which are used for solving the technical problem of high system overhead in the existing live stream transmission method.
The technical scheme in the embodiment of the application has the following general idea:
after the anchor end generates the first direct broadcast stream, the anchor end responds to the trigger operation of the outside on the anchor end, message data is added into the first direct broadcast stream to obtain a second direct broadcast stream, the second direct broadcast stream is pushed to the stream server, so that the second direct broadcast stream is transmitted to the user end through the stream server, and the user end can execute logic operation responding to the message data because the second direct broadcast stream received by the user end contains the message data, so that data communication between the user end and the anchor end is realized, and the message data does not need to be transmitted by constructing an additional TCP server, so that the system overhead is reduced, and the construction and maintenance cost of the server is also reduced. The technical problem that the existing live stream transmission method is high in system overhead is solved.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Example one
The present embodiment provides a method for transmitting a live stream, as shown in fig. 1, the method includes:
step S101 is first executed: a communication connection is established between the anchor and the streaming server.
Specifically, when the anchor needs to transmit the live stream to the user, the live stream is usually transmitted through the streaming server, and first, the anchor transmits the content packaged in the acquisition stage to the streaming server, and then, the client pulls the corresponding live stream from the streaming server. Then, before the anchor transmits the live stream to the streaming Server, a communication connection needs to be established between the anchor and the streaming Server, in a specific implementation process, a bidirectional channel nc of the streaming Server is established first, where nc is new NetConnection (), and then a connection with a stream pushing address url, that is, nc.connect (url), is established through nc, so as to establish a communication connection between the anchor and the streaming Server, it should be noted that Actionscript is a script language, where NetStream classes are provided by a NetConnection object, and a streaming connection between a Flash Player and a Server (for example, Macromedia Flash Media Server 2 or Adobe Flex of Adobe) or between the Flash Player and a local file system can be opened. The NetStream object is similar to a channel in the NetConnection object, and audio and/or video data can be published using NetStream.
Then, step S102 is executed: a first direct broadcast stream is generated.
Specifically, the first live stream is generated by a camera of the anchor device, and may be a PC, a tablet, or a mobile phone, and the first live stream includes data for playing live broadcast, and may include pictures, characters, audio, video, and the like.
Step S103 is performed next: and responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream.
Specifically, the trigger operation on the anchor terminal may be an operation of clicking a keyboard, clicking a mouse, touching, and the like, and may be sent by an anchor terminal user. The message data is special data different from a first direct broadcast stream for broadcasting live broadcast, and is data for real-time communication between the anchor terminal and the client terminal, and the client terminal can generate corresponding logic operation based on the message, so that communication with the anchor terminal is realized.
In one embodiment, in response to a trigger operation on the anchor terminal, adding message data to the first live stream to obtain a second live stream may be implemented by:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection;
and adding the message data to the first live stream through the preset processing method to obtain the second live stream.
In a specific implementation process, whether a trigger operation exists at a host is detected by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, such as clicking a mouse, tapping a keyboard, touching a screen, and the like, the handle is a processing method preset by the global listening event, that is, the handle method is executed when the host receives a special trigger operation, the handle method is used for calling a library function send of an Actionscript, and is used for adding message data to a first live stream when the trigger operation is detected, and the Actionscript is a script language based on flash and can be applied to a Windows system, an Android system, and the like. Specifically, firstly, a communication connection ns1 between the anchor and the stream server is acquired in a handle method, and then a sending method of ns1 is called: send method, ns1.send (handlerName, type, data), where handlerName represents the name of an ActionScript processing function for receiving a message, type is the type of the message, and may include onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData, and data is the carried message data. And then, the carried message data is fused with the first live stream, so that a second live stream is obtained.
And step S104 is executed again: and pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream.
Specifically, after the anchor terminal establishes communication connection with the stream server, the corresponding live stream can be pushed to the server, and similarly, after the user terminal establishes communication connection with the stream server, the live stream can also be transmitted to the user terminal through the stream server, so that the transmission of the live stream between the live stream terminal and the user terminal is realized, and the second live stream contains message data, so that after receiving the second live stream sent by the anchor terminal, the user terminal can execute logic operations corresponding to the message data, such as popping up an advertisement frame, playing special sound effects, page skipping and the like, so that the data communication between the anchor terminal and the user terminal can be realized without constructing a TCP server, the overhead of the system is reduced, and the efficiency of the data communication is improved.
In an alternative embodiment, pushing the second live stream to the streaming server based on the communication connection may be implemented by:
establishing a streaming connection based on the communication connection;
associating a camera of the anchor with the stream connection;
pushing the second live stream to the streaming server based on the association.
In a specific implementation process, on the basis of step S101, a stream connection ns1 may be established through the established stream server bidirectional channel nc: and ns1 is new NetStream (nc), and then the camera at the anchor end is bound with the established stream connection ns1 so as to perform association, so that the pictures collected by the camera are pushed to the stream server through ns1 stream connection through the association, and the camera is the local camera at the anchor end. The specific implementation code is as follows:
camera, getcamera (); // obtain local Camera
Attaachcamera (Cam); // stream connection binding with local Camera
(xxv) ns1. public ("XX", "live"); and/pushing the second live stream to a stream server, wherein XX is the name of the second live stream, and "live" indicates that the playing mode is live.
Similarly, the second live stream is transmitted to the user side through the stream server, and a communication connection needs to be established between the stream server and the user side, and in a specific implementation process, a stream server bidirectional channel nc may be established first: nc ═ new netconnection (), then a connection is established with the push flow address url through nc: nc, connect (url), thereby realizing communication connection between the user side and the stream server.
After the user side receives the second live stream, the implementation mode of playing the second live stream is as follows: first, a second stream connection ns2 is established through nc, ns2 is new NetStream (nc), then a stream player container Video (Video is new Video (640,480)) is created, next, the second broadcast stream is placed in Video for playing (ns2)), the stream is played by using a playing method of stream connection, and finally the stream playing container Video is added to a stage (stage).
In this embodiment, a specific implementation manner in which the user side executes a logic operation in response to the message data when playing the second live stream is as follows:
the user side first acquires the second stream connection ns2 established through the nc channel (ns2 is new NetStream (nc)), and then calls a callback method through ns2 to process the second live stream pushed by the anchor: and (2) acquiring message data in the second live stream by monitoring methods of onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, onXMPData and the like of the objectClient, and executing corresponding logic operation if the second live stream contains the message data. For example, when the message data is a picture type message data, the specific implementation is as follows:
client ═ custom mclient; and/or the user side calls a corresponding callback method, namely, onsImageDataDataHandler after receiving the second live stream, monitors the picture type message, defines a response method, namely, onsImageDataHandleroneImageDataHandler, (data) and/or calls the response method, analyzes the data and executes related logic operation.
Through the steps, the user side can monitor the message data in the second live stream, respond and execute the relevant logic operation.
Based on the same inventive concept, the embodiment of the invention also provides another live stream transmission method, which is detailed in embodiment two.
Example two
The present embodiment provides a live stream transmission method, which is applied to a server, and as shown in fig. 2, the method includes:
step S201: establishing communication connection between the streaming server and the anchor terminal;
since the specific process of establishing the communication connection between the anchor terminal and the streaming server has been described in detail in the first embodiment, it is not described herein again.
Step S202: receiving a second live stream pushed by the anchor terminal based on the communication connection, wherein the second live stream is obtained by responding to a trigger operation of the anchor terminal after the anchor terminal generates a first live stream and adding message data into the first live stream;
in the first embodiment, a process of adding message data to the first live stream to obtain the second live stream after the anchor terminal receives the trigger operation, and a specific process of transmitting the second live stream to the stream server based on the communication connection have been described in detail, so details are not described herein again.
Step S203: and transmitting the second live stream to a user side so that the user side executes logic operation responding to the message data when playing the second live stream.
Since the specific implementation process of the user side playing the second live stream and executing the logic operation responding to the message data in the second live stream has been described in detail in the first embodiment, it is not described herein again.
Since the method described in the second embodiment of the present invention has the same concept as that adopted in the method of the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, those skilled in the art can understand the specific implementation manner and its modifications of the method in the present embodiment, and thus the details are not described herein again. All embodiments and variations of the method according to the first embodiment of the present invention are within the scope of the present invention.
Based on the same inventive concept, the embodiment of the present invention further provides another live stream transmission method, which is described in detail in the third embodiment.
EXAMPLE III
This embodiment provides a method for transmitting a live stream, which is applied to a user side, and as shown in fig. 3, the method includes:
step S301: receiving a second live stream transmitted by a stream server, wherein the second live stream is pushed to the stream server by an anchor terminal based on communication connection between the stream server and the anchor terminal, and the second live stream is obtained after adding message data in the first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
in the first embodiment, a specific process of establishing a communication connection between the anchor terminal and the streaming server, a process of adding message data to the first live stream to obtain a second live stream after the anchor terminal receives the trigger operation, and a specific process of transmitting the second live stream to the streaming server based on the communication connection have been described in detail, so that details are not repeated herein.
Step S302: playing the second live stream and performing a logical operation in response to the message data;
since the specific implementation process of the user side playing the second live stream and executing the logic operation responding to the message data in the second live stream has been described in detail in the first embodiment, it is not described herein again.
Since the method described in the third embodiment of the present invention is the same as the method described in the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, those skilled in the art can understand the specific implementation manner and its modifications of the method in the present embodiment, and thus the details are not described herein again. All embodiments and variations of the method according to the first embodiment of the present invention are within the scope of the present invention.
Based on the same inventive concept, the application also provides a device corresponding to the live stream transmission method in the embodiment, which is detailed in the fourth embodiment.
Example four
This embodiment provides a transmission apparatus of a live stream, where the apparatus is a main broadcasting end, and as shown in fig. 4, the apparatus includes:
an establishing module 401, which establishes a communication connection between the anchor terminal and the streaming server;
a generating module 402, configured to generate a first direct current stream;
an adding module 403, configured to add message data to the first live stream to obtain a second live stream in response to a trigger operation on the anchor terminal;
a pushing module 404, configured to push the second live stream to the streaming server based on the communication connection, and transmit the second live stream to a user end through the streaming server, so that the user end executes a logic operation responding to the message data when playing the second live stream.
As an optional implementation manner of this embodiment, the adding module 403 is further configured to:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection;
and adding the message data to the first live stream through the preset processing method to obtain the second live stream.
As an optional implementation manner of this embodiment, the pushing module 404 is further configured to:
establishing a streaming connection based on the communication connection;
associating a camera of the anchor with the stream connection;
pushing the second live stream to the streaming server based on the association.
Since the device described in the fourth embodiment of the present invention is a device used for implementing the live stream transmission method in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the modification of the device based on the method described in the first embodiment of the present invention, and thus details are not described herein again. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
Based on the same inventive concept, the application also provides a device corresponding to the live stream transmission method in the embodiment, which is detailed in the fifth embodiment.
EXAMPLE five
This embodiment provides a live streaming transmission apparatus, where the apparatus is a server, and as shown in fig. 5, the apparatus includes:
an establishing module 501, configured to establish a communication connection between a streaming server and a host;
a receiving module 502, configured to receive a second live stream pushed by the anchor terminal based on the communication connection, where the second live stream is obtained after message data is added to a first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
a transmission module 503, configured to transmit the second live stream to a user side, so that the user side executes a logic operation responding to the message data when playing the second live stream.
Since the apparatus described in the fifth embodiment of the present invention is an apparatus used for implementing the live stream transmission method in the second embodiment of the present invention, a person skilled in the art can understand the specific structure and the modification of the apparatus based on the method described in the second embodiment of the present invention, and thus details are not described herein. All the devices adopted by the method of the second embodiment of the invention belong to the protection scope of the invention.
Based on the same inventive concept, the application also provides three devices corresponding to the transmission method of the live stream in the embodiment, which is detailed in the sixth embodiment.
EXAMPLE six
This embodiment provides a live streaming transmission apparatus, where the apparatus is a user side, and as shown in fig. 6, the apparatus includes:
a receiving module 601, configured to receive a second live stream transmitted by a stream server, where the second live stream is pushed to the stream server by an anchor based on a communication connection between the stream server and the anchor, and after the second live stream is generated into a first live stream by the anchor, the second live stream is obtained by adding message data to the first live stream in response to a trigger operation on the anchor;
a playing module 602, configured to play the second live stream and execute a logic operation in response to the message data.
Since the device described in the sixth embodiment of the present invention is a device used for implementing the live stream transmission method in the third embodiment of the present invention, a person skilled in the art can understand the specific structure and the modification of the device based on the method described in the third embodiment of the present invention, and thus details are not described here. All the devices adopted by the method of the third embodiment of the invention belong to the protection scope of the invention.
EXAMPLE seven
Based on the same inventive concept, the present application also provides a computer-readable storage medium 700, on which a computer program 711 is stored, which when executed by a processor implements a method in one implementation.
Specifically, the above program is configured to be able to execute the following steps:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream;
and pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream.
Example eight
Based on the same inventive concept, the present application further provides a computer device, please refer to fig. 8, which includes a storage 801, a processor 802, and a computer program 803 stored in the storage and running on the processor, wherein the processor 802 implements the method in one embodiment when executing the program.
Specifically, the processor is configured to perform the following steps:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream;
and pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream.
Similarly, the second embodiment and the third embodiment of the present invention also have corresponding computer-readable storage media and computer devices, which are used for implementing the methods in the second embodiment and the third embodiment.
One or more technical solutions in the embodiments of the present application have at least one or more of the following technical effects:
in the method provided by the invention, after the anchor terminal generates the first live stream, the trigger operation of the anchor terminal by the outside world is responded, the message data is added in the first live stream to obtain the second live stream, then the second live stream is pushed to the stream server, and the second live stream is transmitted to the user terminal through the stream server, and the second live stream carries the message data of the anchor terminal, so that the user terminal executes the logic operation responding to the message data when playing the second live stream, thereby realizing the data communication between the user terminal and the anchor terminal. That is, in the process of live stream transmission by the anchor terminal through the stream server, data communication can be performed with the user terminal by adding message data to the first live stream without erecting an additional TCP server to transmit messages, so that the anchor terminal communicates with the user terminal, thereby reducing the system overhead and the construction and maintenance costs of the server. The technical problem that the existing live stream transmission method is high in system overhead is solved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (9)

1.A method for transmitting a live stream, comprising:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream; the message data is data for real-time communication between the anchor terminal and a client terminal, and the client terminal can perform logic operation based on the message data, so that communication between the client terminal and the anchor terminal is realized;
pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
2. The method of claim 1, wherein the pushing the second live stream to the streaming server based on the communication connection comprises:
establishing a streaming connection based on the communication connection;
associating a camera of the anchor with the stream connection;
pushing the second live stream to the streaming server based on the association.
3. A method for transmitting a live stream, comprising:
establishing communication connection between the streaming server and the anchor terminal;
receiving a second live stream pushed by the anchor terminal based on the communication connection, wherein the second live stream is obtained by responding to a trigger operation of the anchor terminal after the anchor terminal generates a first live stream and adding message data into the first live stream;
transmitting the second live stream to a user side so that the user side executes logic operation responding to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
4. A method for transmitting a live stream, comprising:
receiving a second live stream transmitted by a stream server, wherein the second live stream is pushed to the stream server by an anchor terminal based on communication connection between the stream server and the anchor terminal, and the second live stream is obtained after adding message data in the first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
playing the second live stream and performing a logical operation in response to the message data; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
5. A device for transmitting a live stream, wherein the device is an anchor terminal, comprising:
the establishing module is used for establishing communication connection between the anchor terminal and the streaming server;
the generating module is used for generating a first direct-current stream;
the adding module is used for responding to the triggering operation of the anchor terminal and adding message data in the first live stream to obtain a second live stream;
a push module, configured to push the second live stream to the streaming server based on the communication connection, and transmit the second live stream to a user side through the streaming server, so that the user side performs a logic operation in response to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
the adding module is further configured to: responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
6. A live streaming transmission apparatus, wherein the apparatus is a server, comprising:
the establishing module is used for establishing communication connection between the streaming server and the anchor terminal;
a receiving module, configured to receive a second live stream pushed by the anchor terminal based on the communication connection, where the second live stream is obtained after message data is added to a first live stream in response to a trigger operation of the anchor terminal after the first live stream is generated by the anchor terminal;
a transmission module, configured to transmit the second live stream to a user side, so that the user side executes a logic operation in response to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
7. A transmission device of live streaming, wherein the device is a user side, comprising:
the receiving module is used for receiving a second live stream transmitted by a stream server, wherein the second live stream is pushed to the stream server by an anchor terminal based on communication connection between the stream server and the anchor terminal, and the second live stream is obtained by responding to triggering operation of the anchor terminal and adding message data into a first live stream after the first live stream is generated by the anchor terminal;
a playing module, configured to play the second live stream and execute a logic operation in response to the message data; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
8. A computer-readable storage medium having a computer program stored thereon, the program when executed implementing the steps of:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream;
pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
establishing communication connection between the anchor terminal and the streaming server;
generating a first direct-broadcasting stream;
responding to the trigger operation of the anchor terminal, and adding message data in the first live stream to obtain a second live stream;
pushing the second live stream to the stream server based on the communication connection, and transmitting the second live stream to a user side through the stream server, so that the user side executes logic operation responding to the message data when playing the second live stream; the logic operation comprises popping up an advertisement frame, playing a special sound effect and page jumping;
responding to a trigger operation of the anchor terminal, adding message data in the first live stream to obtain a second live stream, wherein the second live stream comprises:
if the trigger operation on the anchor terminal is detected, calling a preset processing method based on the communication connection; detecting the trigger operation on the anchor terminal by setting a global listening event addLissue (YY, handle), wherein YY is the type of the trigger operation, and handle is the preset processing method;
adding the message data to the first live stream through the preset processing method to obtain a second live stream;
adding the message data to the first live stream through the preset processing method to obtain the second live stream, including:
acquiring a communication connection ns1 between the anchor terminal and the server;
calling the sending method of the ns 1: send method, ns1.send (handlerName, type, data); wherein, handleName represents the name of ActionScript processing function used for receiving the message data; type is the type of the message data, including onCuePoint, onImageData, onMetaData, onPlayStatus, onSeekPoint (), onTextData, and onXMPData; the data is carried message data;
and fusing the carried message data with the first live broadcast stream to obtain a second live broadcast stream.
CN201810157039.2A 2018-02-24 2018-02-24 Live streaming transmission method and device Active CN108377243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810157039.2A CN108377243B (en) 2018-02-24 2018-02-24 Live streaming transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810157039.2A CN108377243B (en) 2018-02-24 2018-02-24 Live streaming transmission method and device

Publications (2)

Publication Number Publication Date
CN108377243A CN108377243A (en) 2018-08-07
CN108377243B true CN108377243B (en) 2021-03-16

Family

ID=63017965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810157039.2A Active CN108377243B (en) 2018-02-24 2018-02-24 Live streaming transmission method and device

Country Status (1)

Country Link
CN (1) CN108377243B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225384A (en) * 2019-06-18 2019-09-10 北京字节跳动网络技术有限公司 The method for pushing of status message, the switching method of interaction content, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331830A (en) * 2016-09-06 2017-01-11 北京小米移动软件有限公司 Method, device, equipment and system for processing live broadcast
CN107360160A (en) * 2017-07-12 2017-11-17 广州华多网络科技有限公司 live video and animation fusion method, device and terminal device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090118019A1 (en) * 2002-12-10 2009-05-07 Onlive, Inc. System for streaming databases serving real-time applications used through streaming interactive video

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331830A (en) * 2016-09-06 2017-01-11 北京小米移动软件有限公司 Method, device, equipment and system for processing live broadcast
CN107360160A (en) * 2017-07-12 2017-11-17 广州华多网络科技有限公司 live video and animation fusion method, device and terminal device

Also Published As

Publication number Publication date
CN108377243A (en) 2018-08-07

Similar Documents

Publication Publication Date Title
CN104602133A (en) Multimedia file shearing method and terminal as well as server
CN109982148B (en) Live broadcast method and device, computer equipment and storage medium
CN108965932B (en) Continuous wheat window display method and device
CN110765744A (en) Multi-person collaborative document editing method and system
US10972511B2 (en) Streaming relay for digital signage
CN110198478B (en) Interactive recording and broadcasting method, system, client, device, equipment and storage medium
CN103491162B (en) Information sharing method based on mobile Internet and system
CN108712320B (en) Message pushing method and device
CN111723558A (en) Document display method and device, electronic equipment and storage medium
CN111163330A (en) Live video rendering method, device, system, equipment and storage medium
CN109151541B (en) Method, storage medium, device and system for realizing cue bullet box for leaving anchor
US10893333B2 (en) Video playing method, device and storage
CN103841466A (en) Screen projection method, computer end and mobile terminal
CN111694625B (en) Method and equipment for projecting screen from car box to car machine
CN112073754A (en) Cloud game screen projection method and device, computer equipment, computer readable storage medium and cloud game screen projection interaction system
CN112929680A (en) Live broadcast room image rendering method and device, computer equipment and storage medium
CN108235111B (en) Information sharing method and intelligent set top box
CN110113298B (en) Data transmission method, device, signaling server and computer readable medium
CN111131891B (en) Audio and video playing method and device, playing equipment and system
CN113010135B (en) Data processing method and device, display terminal and storage medium
CN108377243B (en) Live streaming transmission method and device
CN103001948B (en) Method and system for controlling computer terminal by handheld device through scan codes
CN113242173B (en) Screen sharing method, device and system and instant messaging server
CN105898596B (en) Direct broadcasting room display control method and device
CN110752999B (en) Screen broadcasting method, device, system, electronic equipment and storage medium

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