CN112584231B - Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal - Google Patents

Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal Download PDF

Info

Publication number
CN112584231B
CN112584231B CN201910952321.4A CN201910952321A CN112584231B CN 112584231 B CN112584231 B CN 112584231B CN 201910952321 A CN201910952321 A CN 201910952321A CN 112584231 B CN112584231 B CN 112584231B
Authority
CN
China
Prior art keywords
video stream
slice data
video
stream
image group
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
CN201910952321.4A
Other languages
Chinese (zh)
Other versions
CN112584231A (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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201910952321.4A priority Critical patent/CN112584231B/en
Publication of CN112584231A publication Critical patent/CN112584231A/en
Application granted granted Critical
Publication of CN112584231B publication Critical patent/CN112584231B/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/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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • 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
    • 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/765Media network packet handling intermediate
    • 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
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44008Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • 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/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64784Data processing by the network

Landscapes

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

Abstract

The invention provides a video live broadcast method, a video live broadcast device, edge equipment of a CDN (content delivery network) and a user terminal, wherein the method comprises the following steps: receiving a video stream pushed by a stream pushing client; setting time information for the image group in the video stream according to the arrival time of the image group in the video stream, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from a source station server; packaging the video stream into slice data, and setting index information for the slice data according to the time information of the image group contained in the slice data; and pushing the set slice data to a pull stream client corresponding to the pull stream request. The method sets the only index information of the slice data based on the time information, when the user terminal obtains the slice data from different devices, the index information forms a complete video stream, which is beneficial to introducing the P2P technology into the video live broadcast to reduce the live broadcast pause rate, so that the video live broadcast is smoother and the bandwidth is saved.

Description

Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal
Technical Field
The invention relates to the field of live video, in particular to a live video method and device, edge equipment of a CDN (content delivery network) and a user terminal.
Background
In related technologies, a live broadcast mode mostly adopts a play mode of an RTMP (Real Time Messaging Protocol) push stream and an HTTP (HyperText Transfer Protocol) + FLV (Flash Video, a streaming media format), and the processes of the push stream and the pull stream are realized through a CDN (Content Delivery Network) Network. When the number of users for live video is large, all the streaming clients pull data from the same server, which brings large pressure to the network, and not only results in high live broadcast pause rate and high bandwidth cost.
Disclosure of Invention
In view of this, the present invention provides a live video broadcast method and apparatus, an edge device of a CDN network, and a user terminal, so as to reduce a live broadcast pause rate, make live video broadcast smoother, and save bandwidth.
In a first aspect, an embodiment of the present invention provides a live video broadcast method, where the method is applied to an edge device of a CDN network, and includes: receiving a video stream pushed by a stream pushing client; setting time information for the image group in the video stream according to the arrival time of the image group in the video stream, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from a source station server; packaging the video stream into slice data, and setting index information for the slice data according to the time information of the image group contained in the slice data; and pushing the set slice data to a pull stream client corresponding to the pull stream request.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the step of setting time information for a group of pictures in a video stream according to an arrival time of the group of pictures in the video stream includes: generating a time stamp corresponding to the arrival time of the current image group aiming at each image group in the video stream; the time stamp is set as the time information of the current group of images.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the step of encapsulating a video stream into slice data includes: and according to the image group in the video stream, carrying out slicing processing on the video stream to obtain slice data.
With reference to the second possible implementation manner of the first aspect, the embodiment of the present invention provides a third possible implementation manner of the first aspect, where each slice data includes one image group.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the step of setting index information for slice data according to time information of a group of pictures included in the slice data includes: for each slice data, time information of the image group contained in the current slice data is determined as index information of the current slice data.
With reference to the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where the slice data includes multiple video tags; after the step of setting index information for the slice data based on the time information of the image group included in the slice data, the method further includes: setting a Tag number for each video Tag in the slice data; the Tag number comprises identification information of the video stream, index information of the slice data and a serial number of the video Tag in the slice data.
With reference to the first aspect, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, where before the step of pushing the set slice data to the pull stream client corresponding to the pull stream request, the method further includes: generating verification data of the current slice data by a preset verification algorithm aiming at each slice data; the check data is carried into the current slice data.
With reference to the first aspect, an embodiment of the present invention provides a seventh possible implementation manner of the first aspect, where after the step of receiving a video stream pushed by a stream pushing client, the method further includes: checking whether a communication protocol packet corresponding to a current image group is complete or not aiming at each image group in a video stream; if not, the current group of images is discarded.
With reference to any implementation manner of the first aspect, an embodiment of the present invention provides an eighth possible implementation manner of the first aspect, where the pushing the set slice data to a pull flow client corresponding to a pull flow request includes: the edge device of the CDN network combines the set slice data into a first video stream and pushes the first video stream to a stream pulling client corresponding to the stream pulling request; the method further comprises the following steps: if the pull stream client receives a second video stream corresponding to the first video stream from the user terminal, matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream; and the stream pulling client plays the first video stream and/or the second video stream according to a preset playing strategy.
In a second aspect, an embodiment of the present invention provides a video live broadcasting method, where the method is applied to a user terminal, and includes: sending a pull flow request to an edge device of the CDN network; receiving a first video stream pushed by an edge device; the first video stream includes slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to the arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from a source station server; packaging the video stream into slice data, and setting index information for the slice data according to time information of an image group contained in the slice data to obtain final slice data; if a second video stream corresponding to the first video stream is received from the user terminal, matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream; and playing the first video stream and/or the second video stream according to a preset playing strategy.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the method further includes: if the designated slice data in the second video stream needs to be played according to the playing strategy, generating verification data of the designated slice data through a preset verification algorithm; judging whether the generated check data is consistent with the check data carried in the specified slice data; if the two video streams are consistent, the specified slice data in the second video stream is played.
In a third aspect, an embodiment of the present invention provides a live video broadcast apparatus, where the apparatus is applied to an edge device of a CDN network, and includes the following modules: the first receiving module is used for receiving the video stream pushed by the stream pushing client; the setting module is used for setting time information for the image group in the video stream according to the arrival time of the image group in the video stream and pushing the set video stream to a source station server; an obtaining module, configured to obtain the video stream from the source station server if a pull request of the video stream is received; the packaging module is used for packaging the video stream into slice data and setting index information for the slice data according to the time information of the image group contained in the slice data; and the pushing module is used for pushing the set slice data to a pull stream client corresponding to the pull stream request.
In a fourth aspect, an embodiment of the present invention provides a live video broadcast apparatus, where the apparatus is applied to a user terminal, and includes the following modules: a pull flow request sending module, configured to send a pull flow request to an edge device of the CDN network; the second receiving module is used for receiving the first video stream pushed by the edge device; the first video stream comprises slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from the source station server; packaging the video stream into slice data, and setting index information for the slice data according to time information of an image group contained in the slice data to obtain final slice data; the matching module is used for matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream if the second video stream corresponding to the first video stream is received from the user terminal; and the playing module is used for playing the first video stream and/or the second video stream according to a preset playing strategy.
In a fifth aspect, an embodiment of the present invention provides an edge device of a CDN network, where the edge device includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the video live broadcasting method of the second aspect.
In a sixth aspect, an embodiment of the present invention provides a user terminal, which includes a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to perform the method of any one of the first aspect or the second aspect.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a live video broadcasting method and device, edge equipment of a CDN (content distribution network) and a user terminal, wherein the edge equipment of the CDN sets time information for an image group in a video stream according to the arrival time of the image group in the video stream after receiving the video stream pushed by a stream pushing client, and then pushes the set video stream to a source station server. And if a pull stream request of the video stream is received, acquiring the video stream from the source station server and packaging the video stream into slice data. And according to the time information of the image group contained in the slice data, setting index information for the slice data, and pushing the set slice data to a pull stream client corresponding to the pull stream request. The method sets the index information of the slice data based on the time information, and the index information of the slice data has uniqueness due to the uniqueness of the time information, so that the slice data has a unique identity in the network transmission process, and even if a user terminal acquires the slice data from different equipment, a complete video stream can be formed based on the unique identity, thereby facilitating the subsequent introduction of a P2P technology into the live video, reducing the live broadcast pause rate, ensuring the live video to be smoother and saving the bandwidth.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
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 other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic diagram of a hardware scene of live video according to an embodiment of the present invention;
fig. 2 is a flowchart of a video live broadcasting method according to an embodiment of the present invention;
fig. 3 is a flowchart of another video live broadcasting method according to an embodiment of the present invention;
fig. 4 is a flowchart of another video live broadcasting method according to an embodiment of the present invention;
fig. 5 is a flowchart of another video live broadcasting method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of another video live broadcasting method according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a video live broadcast method in conjunction with a P2P network according to an embodiment of the present invention;
fig. 8 is a flowchart of another video live broadcasting method according to an embodiment of the present invention;
fig. 9 is a multi-party interaction flowchart of another video live broadcasting method according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a video live broadcasting apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of another video live broadcasting apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an edge device or a user terminal of a CDN network according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent 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.
For ease of understanding, a hardware scenario of a live video will first be described. As shown in fig. 1, the live streaming client includes a streaming client and a streaming client deployed in a user terminal, where a live streaming user uploads a recorded live video stream to a CDN network through the streaming client and the live video stream is received by an edge device of the CDN network. After receiving the video stream pushed by the stream pushing client, the CDN network device uploads the video stream to the source station server. When one or more live streaming users request live video streaming from the edge device of the CDN network through the streaming client, the edge device retrieves the live video streaming from the source station server and sends the live video streaming to the streaming client, so that video streaming transmission from the streaming client to the streaming client is completed.
In the existing live broadcast mode, the play modes of RTMP streaming and HTTP + FLV streaming are mostly adopted, and as can be seen from fig. 1, when the number of users watching live broadcast is large, a large number of streaming clients request live broadcast video streams to the edge device of the CDN network at the same time, the edge device of the CDN network needs to send the live broadcast video streams to each streaming client, the CDN network needs to bear huge network load pressure, and if the flow exceeds the bandwidth of the network, live broadcast blocking easily occurs.
Based on the video live broadcast method and device, the edge device of the CDN network and the user terminal, the technology can be applied to a video live broadcast scene; the techniques may be implemented in associated software or hardware, as described by way of example below. First, a video live broadcast method disclosed in the embodiment of the present invention is described in detail. As shown in fig. 2, the method may be applied to an edge device of a CDN network, and includes the following steps:
step S202, receiving the video stream pushed by the stream pushing client.
The stream pushing client can be used for live video broadcast, specifically, can be an application program installed on a user terminal (such as a mobile phone, a computer, a camera, and the like), and can also run on a web browser. The stream pushing client generally has a video recording function or a video acquisition function, and transmits the recorded video through a network. The video stream collected by the plug-flow client may be pushed to the edge device of the CDN network through a built-in plug-flow SDK (Software Development Kit), and an RTMP protocol or other network transmission protocols may be used in the pushing process.
Step S204, according to the arrival time of the Group of pictures in the video stream, setting time information for the Group of pictures (GOP for short) in the video stream, and pushing the set video stream to the source station server.
When a push streaming client records a video, a video frame is generally divided into a plurality of groups of pictures according to a time sequence, each group of pictures includes one or more video frames, then coding is performed based on each group of pictures, and the coded groups of pictures constitute a video stream. The image groups in the video stream are sent to the edge device of the CDN network according to the recording sequence, that is, the image group recorded first arrives at the edge device of the CDN network first. Thus, the time of arrival of each image group at the edge device is unique. Furthermore, according to the arrival time of the image group in the video stream, time information is set for the image group in the video stream, so that the time information of the image group can be unique; also, because of the irreversibility of time, the time information of the image groups has a monotonically increasing characteristic, and thus the order between the respective image groups can be determined based on the time information.
In the related art, when the stream pushing client pushes the video stream based on the RTMP protocol, the timestamps of the transmitted video stream are numbered from zero after the stream pushing client establishes communication contact with the edge device each time; if the network is suddenly interrupted in the transmission process and is connected again, a new session is established, and the timestamp of the video stream still starts from zero; at this time, the timestamps of the video streams are repetitive and irregular, and it is difficult to identify each video frame in the video streams according to the timestamps and sequence the video frames. In the above steps of this embodiment, the timestamp is set according to the arrival time of the image group at the edge device, that is, after the edge device receives the stream pushing data, the original unordered timestamp is reset according to the arrival time of the image group at the edge device, the reset time information has uniqueness, and the arrangement order between the image groups can be standardized.
And pushing the video stream with the completion time set to a source station server, wherein the source station server is usually a central server of the CDN network and can store the received video stream. If the pull stream client makes a pull stream request for the video stream, the source station server can send the video stream to the pull stream client.
In step S206, if a pull request of the video stream is received, the video stream is obtained from the source station server.
And the pull stream request is sent through the pull stream client, the pull stream request usually contains identification information of the video stream, and the edge device acquires the corresponding video stream from the source station server based on the identification information.
Step S208, the video stream is encapsulated into slice data, and index information is set for the slice data according to the time information of the image group included in the slice data.
In practical implementation, the video stream may be encapsulated according to a preset protocol format, for example, FLV format, or other video formats, so as to obtain slice data in a corresponding format. The packaged slice data comprises one or more image groups, and each image group comprises set time information. By setting index information for each slice data by these pieces of time information, it is possible to ensure that each index information has uniqueness and has the same incremental attribute as the time information of the image group.
And step S210, pushing the set slice data to a pull stream client corresponding to the pull stream request.
And the process of pushing the slice data to the pull streaming client can select HTTP + FLV or other protocols. The pull streaming client is used for watching live video, and specifically may be an application program installed on a user terminal (such as a mobile phone, a computer, and the like), or may be a Web application running in a Web browser. The pull streaming client is provided with a video player which can decode and play the slice data and watch videos for users of the pull streaming client.
It should be noted that, a CDN network usually includes a plurality of edge devices, and a pull client usually sends a pull request to a closer edge device, so if the push client and the pull client are far away, an edge device that pushes a video stream to a source station server is usually different from an edge device that obtains a video stream from the source station server.
In the video live broadcast method, after receiving a video stream pushed by a stream pushing client, time information is set for an image group in the video stream according to the arrival time of the image group in the video stream, and then the set video stream is pushed to a source station server. And if a pull stream request of the video stream is received, acquiring the video stream from the source station server and packaging the video stream into slice data. And according to the time information of the image group contained in the slice data, setting index information for the slice data, and pushing the set slice data to a pull stream client corresponding to the pull stream request. The method sets the index information of the slice data based on the time information, and the index information of the slice data has uniqueness due to the uniqueness of the time information, so that the slice data has a unique identity in the network transmission process, and even if a user terminal acquires the slice data from different equipment, a complete video stream can be formed based on the unique identity, thereby facilitating the subsequent introduction of a P2P (Peer to Peer) technology into the live video, reducing the live video pause rate, enabling the live video to be smoother and saving the bandwidth.
The embodiment of the invention also provides another video live broadcast method which is realized on the basis of the method in the embodiment; the method mainly includes a specific implementation process of setting time information for an image group in a video stream, which is implemented mainly through a step S304 and a step S306 described later, and as shown in fig. 3, the live video broadcast method includes the following steps:
step S302, receiving a video stream pushed by the stream pushing client.
Step S304, aiming at each image group in the video stream, generating a time stamp corresponding to the arrival time of the current image group.
In an actual implementation process, the time stamp corresponding to the arrival time may be obtained by converting the arrival time through a preset mapping algorithm. One way is that the time stamp can be the total number of seconds from 1970 to 01/00 second of greenwich mean time (00/00 second of 08/01/1970) to the arrival time, the precision of the time stamp can be ten digits, but in some scenes needing higher precision, the time stamp can be accurate to milliseconds, and the time stamp in such scenes can be 13 digits. For example, arrival time: 2017-04-15.
When the live video starts, time jump is caused when the network is unstable in the process of uploading the video, and the time stamp is abnormal. In the step, the timestamp is set according to the time pair of the image group in the video stream reaching the CDN edge device, so that the timestamp abnormality in the video uploading process can be avoided. Because the time stamp describes the arrival time of the image group, the time stamp can also indicate the sequence of the corresponding image group arriving at the CDN edge device, which is beneficial to subsequent use of the image group.
Step S306, setting the time stamp as the time information of the current image group; and pushing the set video stream to a source station server.
The time stamp data is more favorable for transmission and is easier to be acquired by the server and the relevant time is calculated, so that the speed of the relevant time calculation can be improved by setting the time stamp as the time information, and the time information of the image group can be set more conveniently.
Step S308, if the pull stream request of the video stream is received, the video stream is obtained from the source station server.
Step S310, packaging the video stream into slice data, and setting index information for the slice data according to the time information of the image group contained in the slice data.
Step S312, pushing the set slice data to the pull flow client corresponding to the pull flow request.
In the above embodiment, the timestamps are set for the image groups according to the arrival times of the image groups in the video stream to the edge devices, so that the duplication or disorder of the timestamps in the video uploading process can be avoided, and the timestamps can also indicate the sequence of the arrival of the corresponding image groups to the edge devices, thereby facilitating the subsequent use of the image groups.
The embodiment of the invention also provides another video live broadcast method which is realized on the basis of the method in the embodiment; the method mainly describes a specific implementation process of encapsulating video streams into slice data and setting index information for the slice data, and the process is mainly implemented by the following steps S410 and S412, as shown in fig. 4, the video live broadcasting method includes the following steps:
step S402, receiving the video stream pushed by the stream pushing client.
Step S404, aiming at each image group in the video stream, generating a time stamp corresponding to the arrival time of the current image group.
Step S406, setting the timestamp as the time information of the current image group, and pushing the set video stream to the source station server.
In step S408, if a pull request of the video stream is received, the video stream is obtained from the source station server.
And step S410, according to the image group in the video stream, carrying out slice processing on the video stream to obtain slice data.
Step S412 is to determine, for each piece of slice data, time information of an image group included in the current piece of slice data as index information of the current piece of slice data.
As described in the above embodiment, the video stream may be sliced according to the arrangement order of the image groups in the video stream, and the obtained slice data may include one image group or may include a plurality of adjacent images. Taking an example that one slice data includes one image group, since the image group is provided with time information, the time information can be used as index information of the slice data. Since the time information is unique and monotonically increases, the index information of the slice data determined based on the time information is also unique and monotonically increases.
And step S414, pushing the set slice data to the pull stream client corresponding to the pull stream request.
In the live video broadcasting method provided in this embodiment, the index information is determined based on a timestamp that arrives at the edge device during the image group stream pushing process, and since the timestamp is unique, the index information of the slice data is also unique, so that the slice data has a unique identity during the network transmission process. Even if the user terminal obtains slice data from different devices, the complete video stream can be formed based on the unique identity, so that the subsequent introduction of the P2P technology into the video live broadcast is facilitated, the live broadcast pause rate is reduced, the video live broadcast is smoother, and the bandwidth is saved.
The embodiment of the present invention further provides another video live broadcast method, which is implemented on the basis of the method described in the above embodiment, and the method mainly describes a process of detecting a communication protocol for an image group in a video stream after receiving a pushed video stream, where the process is implemented by step S508 described later; also described is a process of setting a serial number for the slice data, which is realized by the subsequent step S510; a generation process of the verification data is also described, which is mainly realized by the step S512 described later. As shown in fig. 5, the video live broadcasting method includes the following steps:
step S502, receiving the video stream pushed by the stream pushing client.
Step S504, according to the arrival time of the image group in the video stream, setting time information for the image group in the video stream, and pushing the set video stream to the source station server.
In step S506, if a pull request of the video stream is received, the video stream is obtained from the source station server.
Step S508, aiming at each image group in the video stream, checking whether a communication protocol packet corresponding to the current image group is complete; and discarding the current image group with incomplete communication protocol packets.
In the process of live video, the network is often unstable, and a communication protocol packet is lost. For example, in a video stream uploading process, a live broadcaster often uses a smart phone to upload through a mobile network, and the mobile network is more easily affected by signals at a device side than a wired network and a wireless local area network. At this time, it is necessary to check the communication protocol packet in each group of pictures in the video stream to determine whether the communication protocol packet corresponding to the group of pictures is complete. If the group of images is found to be incomplete, the entire group of images is discarded. If one or more image groups are discarded in the video stream, the time information corresponding to the remaining image groups is still arranged in a monotonically increasing order.
It should be noted that if the communication protocol packet corresponding to the image group is incomplete, the image group is still continuously played, which may cause a screen splash on a live broadcast interface of the pull-streaming client, and may easily cause strong visual discomfort to a live broadcast user; and if the communication protocol packet corresponding to the image group is incomplete, discarding the whole image group, at this moment, a momentary pause appears on a live broadcast interface of the pull streaming client, and a next image group is immediately broadcast after the pause.
Step S510, the video stream is encapsulated into slice data, and index information is set for the slice data according to the time information of the image group included in the slice data.
Taking slice data in the FLV format as an example, the slice data generally includes a plurality of video tags, and thus a Tag number needs to be set for each video Tag in the slice data; the Tag number includes identification information of the video stream, index information of the slice data, and a sequence number of the video Tag in the slice data. Wherein, the identification information of the video stream is an identity of the video stream, which may also be referred to as a push stream ID; the index information of the slice data is the time stamp of the image group contained in the slice data; the sequence number of the video Tag in the slice data may specifically be the position of the video Tag relative to the video Tag where the key frame is located, and the sequence number may be one or multiple.
For example, 150/1492069631186/0 represents the Tag where the key frame with the plug flow ID of 150 and the time stamp of 1492069631186 is located, i.e. the 1 st video Tag;150/1492069631186/2-9 represents the 2 nd to 9 th video Tag after the Tag where the key frame with the push stream ID of 150 and the time stamp of 1492069631186 is located.
Step S512, generating verification data of the current slice data by a preset verification algorithm aiming at each slice data; and carrying the check data into the current slice data.
The preset check algorithm may be specifically a Cyclic Redundancy Check (CRC) 32 algorithm, and the CRC32 algorithm belongs to a cyclic redundancy check algorithm; of course, the predetermined check algorithm may be implemented by other algorithms, such as CRC12, CRC16, etc.
And step S514, pushing the set slice data to a pull stream client corresponding to the pull stream request.
The set slice data not only contains the information contained in the above embodiment, but also contains verification data, and the client can judge whether the slice data is tampered according to the verification information, and if the slice data is not tampered, the slice data is available; if tampered with, the slice data is not available.
For further understanding of the above embodiments, see a schematic diagram of another video live method shown in fig. 6; and the stream pushing SDK on the client side pushes the video stream to the edge device of the CDN network through an RTMP protocol, and the edge device modifies the time information of the image group based on the arrival time of the image group in the video stream and then pushes the video stream to a source station server of the CDN network through the RTMP protocol. After receiving the stream pulling request, the edge device acquires a video stream corresponding to the stream pulling request from a source station server; the source station server sends the video stream to the edge server through an RTMP protocol; the edge server packages the video stream into slice data, generates check data and then sends the check data to the pull stream client.
In other implementations, the edge client may send the video stream to the pull stream client by using an RTMP protocol, HTTP + FLV, or the like. The pull flow client can be provided with a P2P module, and the P2P network is accessed based on the P2P module. Based on this, the pull streaming client may obtain the video stream through the edge device, and may also obtain the video stream through other pull streaming clients in the P2P network.
Each pull flow client in the P2P network establishes connection and transmits data through a Tracker server. As shown in fig. 7, in the P2P network, the ues connected through the network are all in the peer-to-peer status, each ue has the same function, and there is no master-slave difference, so that the ue can be used as a server to set up shared resources for other ues in the network. However, in the P2P network, the ue is not trusted, and the data sent from other ues needs to be checked to ensure that the data is not modified. When the stream pulling client receives video data transmitted by other stream pulling clients, performing CRC32 operation on the video data to obtain check data, and verifying the obtained check data and the check data carried in the video data. If the two are consistent, the video stream is not modified, and the video stream can be played; if the two are not consistent, the video stream is tampered and is not trusted, the video stream cannot be played, and at the moment, the video stream can be obtained from the edge device only for playing.
Through the embodiment, the check data of the slice data and the slice data are sent to each pull stream client together. Because the pull stream clients are in the P2P network, the video streams transmitted by the pull stream clients can be mutually checked according to the checking data. If the video stream transmitted from other pull stream clients has the same verification result as the verification data carried by the video stream, it indicates that the slice data is not modified, so that the pull stream clients can play the video stream transmitted from other pull stream clients. Compared with the mode that all the stream pulling clients acquire the video stream from the edge device, the method for acquiring the video stream through the P2P network can improve the transmission efficiency of the video stream, is beneficial to relieving the network pressure of the CDN network, simultaneously enables the playing of the video stream to be smoother, reduces the phenomenon of video blocking, and saves the bandwidth.
The embodiment of the invention also provides another video live broadcast method, which is applied to a user terminal, wherein the user terminal can be any one of an intelligent mobile phone, a tablet personal computer, a personal computer and intelligent equipment supporting a live broadcast application program, and the user terminal needs to be provided with a pull stream client and has a network connection function so as to send a pull stream request to edge equipment of the CDN network. As shown in fig. 8, the method comprises the steps of:
step S802, a pull flow request is sent to an edge device of the CDN network.
Step S804, receiving a first video stream pushed by the edge device.
The first video stream includes slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to the arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from a source station server; and encapsulating the video stream into slice data, and setting index information for the slice data according to the time information of the image group contained in the slice data to obtain the final slice data.
The first video stream corresponds to the pull request. In actual implementation, there may be multiple user terminals sending pull requests to the edge device of the CDN network to obtain the same video stream. In most cases, a user terminal usually sends a pull request to an edge device closest to the CDN network, and the edge device obtains a video stream from a source server of the CDN network.
Step S806, if a second video stream corresponding to the first video stream is received from the user terminal, matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream.
The ue may obtain the video stream, i.e. the first video stream, from the edge device, and may also obtain the video stream, i.e. the second video stream, from other ues in the P2P network. As can be seen from the foregoing embodiment, the index information of slice data is set according to the time information of a group of images contained in the slice data, and the time information of a group of images is the arrival time of the group of images at the edge device. Therefore, the index information of the slice data has uniqueness and monotonically increases. Based on the index information of the slice data, the respective slice data in the video stream may be ordered. Therefore, for the same video stream, the first video stream of the video stream acquired from the edge device and the second video stream of the video stream acquired from other user terminals can be positioned one by one and correspond to each other based on the index information of the slice data in the video stream.
Step S808, playing the first video stream and/or the second video stream according to a preset playing policy.
The preset playing policy may be preset, and may include, for example, playing a first video stream acquired from the edge device under a first specified condition, playing a second video stream acquired from another user terminal under a second specified condition, or playing the first video stream and the second video stream simultaneously under a third specified condition. In the simultaneous playing mode, a part of slice data may be obtained from the first video stream and another part of slice data may be obtained from the second video stream according to the index information, so as to form a complete video stream.
As an example, the speed of acquiring the first video stream from the edge device may be detected, and if the speed is lower than a preset speed threshold, a second video stream corresponding to the first video stream may be acquired from another user terminal through the P2P network, the second video stream may be played, or a complete video stream composed of partial slice data in the first video stream and the second video stream may be played, so as to improve the smoothness of playing the video stream.
In the method, the video streams among the plurality of user terminals are shared according to the characteristics of the P2P network, the pause rate in the live broadcast process can be reduced, and the dependence on the bandwidth of the CDN network can be reduced.
In the embodiment of the invention, the index information set based on the time information is matched with the video stream, and due to the uniqueness of the index information, the mutual video stream transmission between the user terminals becomes possible, thereby being beneficial to introducing the P2P technology into the live video, reducing the live video pause rate, ensuring the live video to be smoother and saving the bandwidth.
In one embodiment, the video live broadcasting method further includes the following steps 1 and 2:
step 1, if the designated slice data in the second video stream needs to be played according to the playing strategy, generating the verification data of the designated slice data through a preset verification algorithm.
If video streams from other user terminals in the P2P network need to be played, a preset verification algorithm needs to be used to perform verification calculation on the specified piece data to be played in the second video stream, so as to obtain verification data. The check algorithm is typically consistent with a check algorithm corresponding to the check data carried in the sliced data, such as a CRC32 algorithm.
And 2, judging whether the generated check data is consistent with the check data carried in the specified slice data. If the two video streams are consistent, the specified slice data in the second video stream is played.
The verification data carried in the designated slice data is usually obtained by the edge device through verifying and calculating the designated slice data after the edge device acquires the video stream from the source station server; and carrying the verification data into the video stream, and sending the verification data to each user terminal along with the video stream. Because the content of the user terminal in the P2P network of the video stream is easy to be distorted, the distorted data can be prevented from being played by the user terminal through the comparison of the verification data, and the reliability of the video stream playing is improved.
If the two are identical, it indicates that the designated slice data sent from other user terminal has not been modified, so that the designated slice data in the second video stream sent from other user terminal can be played in the user terminal.
In the embodiment of the invention, the video streams sent from other user terminals are verified through the preset verification algorithm, and the video streams are played according to the verification result, so that the reliability of video stream playing is improved, the mutual video stream transmission between the user terminals becomes possible, the P2P technology is favorably introduced into the live video broadcast, the live broadcast pause rate is reduced, the live video broadcast is smoother, and the bandwidth is saved.
The embodiment of the invention also provides another video live broadcast method which is realized on the basis of the method in the embodiment, and the method describes the video live broadcast method in a multi-party interaction mode. As shown in fig. 9, the method includes the steps of:
step S902, the stream pushing client pushes the video stream to the edge device.
In step S904, the edge device sets time information for the group of pictures in the video stream according to the arrival time of the group of pictures in the video stream, and pushes the set video stream to the source station server.
Step S906, the pull streaming client sends a pull streaming request of the video stream to the edge device.
In step S908, the edge device acquires the video stream from the source station server.
In step S910, the edge device encapsulates the video stream into slice data, and sets index information for the slice data according to the time information of the image group included in the slice data.
Step S912, the edge device combines the set slice data into a first video stream, and pushes the first video stream to a stream pulling client corresponding to the stream pulling request.
Step S914, the user terminal sends a second video stream corresponding to the first video stream to the pull stream client;
step S916, the stream pulling client receives the second video stream, and matches the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream.
Step S918, the stream pulling client plays the first video stream and/or the second video stream according to a preset playing policy.
The system of the embodiment of the invention describes a process of pushing the set slice data to the pull stream client corresponding to the pull stream request. According to the uniqueness of the time information, the identity generated by the slice data in the network transmission process has uniqueness, even if the user terminal acquires the slice data from different devices, a complete video stream can be formed based on the unique identity, so that the subsequent introduction of the P2P technology into the live video is facilitated, the live broadcast pause rate is reduced, the live video broadcast is smoother, and the bandwidth is saved.
In an embodiment of the foregoing live video broadcasting method, referring to fig. 10, a live video broadcasting apparatus applied to an edge device of a CDN network includes the following modules:
a first receiving module 1010, configured to receive a video stream pushed by a stream pushing client;
a setting module 1020, configured to set time information for an image group in the video stream according to an arrival time of the image group in the video stream, and push the set video stream to a source station server;
an obtaining module 1030, configured to obtain the video stream from the source station server if a pull request of the video stream is received;
a packaging module 1040, configured to package the video stream into slice data, and set index information for the slice data according to time information of an image group included in the slice data;
and a pushing module 1050, configured to push the set slice data to a pull stream client corresponding to the pull stream request.
The video live broadcasting device provided by the embodiment of the invention can set time information for the video stream pushed by the stream pushing client through the edge device of the CDN network, and then send the video stream with the set time information to the source station server. When the edge device of the CDN network receives a user watching request, a video stream with set time information is obtained from a source station server, and after the video stream is packaged to obtain a video slice, index information is set according to the time information in the video slice and used for verifying video data. And pushing the set slice data to the corresponding pull streaming client, and completing the whole process from the live streaming to the watching end. In the process, the index information of the slice data is set based on the time information, and the index information of the slice data has uniqueness due to the uniqueness of the time information, so that the slice data has the unique identity in the network transmission process, and even if a user terminal acquires the slice data from different equipment, a complete video stream can be formed based on the unique identity, thereby being beneficial to introducing the P2P technology into the video live broadcast subsequently, leading the video live broadcast to be smoother and saving the bandwidth.
In one implementation, the setting module 1020 is further configured to:
and generating a time stamp corresponding to the arrival time of the current image group aiming at each image group in the video stream. The time stamp is set as the time information of the current group of pictures.
In an implementation manner, the encapsulating module 1040 is further configured to perform a slicing process on the video stream according to the group of pictures in the video stream, so as to obtain slice data.
In one implementation, the encapsulating module 1040 is further configured to determine, for each slice data, time information of a group of images included in the current slice data as index information of the current slice data.
In one implementation, the encapsulating module 1040 is further configured to determine, for each slice data, time information of a group of pictures included in the current slice data as index information of the current slice data.
In one implementation manner, the video live broadcasting device further comprises a Tag setting module, the slice data comprises a plurality of video tags, and the Tag setting module is used for setting Tag numbers for each video Tag in the slice data. The Tag number comprises identification information of the video stream, index information of the slice data and a serial number of the video Tag in the slice data.
In one implementation manner, the video live broadcasting device further includes a verification module, where the verification module is configured to generate, for each slice data, verification data of current slice data through a preset verification algorithm; the check data is carried into the current slice data.
In one implementation manner, the above live video broadcasting apparatus further includes a checking module, where the checking module is configured to check, for each group of pictures in the video stream, whether a communication protocol packet corresponding to a current group of pictures is complete. If not, the current group of images is discarded.
In one implementation, the pushing module 1050 is further configured to:
and the edge device of the CDN network combines the set slice data into a first video stream and pushes the first video stream to a pull stream client corresponding to the pull stream request.
If the pull stream client receives a second video stream corresponding to the first video stream from the user terminal, matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream;
and the stream pulling client plays the first video stream and/or the second video stream according to a preset playing strategy.
In correspondence to the above embodiment of the video live broadcast method, referring to fig. 11, a video live broadcast apparatus is applied to a user terminal, and includes the following modules:
a pull request sending module 1110, configured to send a pull request to an edge device of the CDN network;
a second receiving module 1120, configured to receive a first video stream pushed by an edge device; the first video stream includes slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to the arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from a source station server; packaging the video stream into slice data, and setting index information for the slice data according to time information of an image group contained in the slice data to obtain final slice data;
a matching module 1130, configured to, if a second video stream corresponding to the first video stream is received from the user terminal, match the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream;
the playing module 1140 is configured to play the first video stream and/or the second video stream according to a preset playing policy.
In this embodiment, according to the determination result of the matching module 1130, the video stream can be selectively played according to the P2P playing policy and the network state. For example: when the signal is poor with the CDN network edge signal, the video in the second video stream is preferentially selected to be played; when a problem occurs in P2P network transmission, data transmission with the CDN network edge is preferentially selected. In the process, according to the characteristics of the P2P, the video streams among a plurality of user sides are shared, the pause rate in the live broadcast process can be reduced, and the dependence on the CDN network bandwidth can be reduced.
In another implementation manner, the video live broadcasting apparatus further includes:
and the slice checking module is used for judging whether the specified slice data in the second video stream needs to be played according to the playing strategy. And if so, generating the verification data of the specified slice data through a preset verification algorithm.
And the slice judging module is used for judging whether the generated check data is consistent with the check data carried in the specified slice data.
And the slice playing module is used for playing the specified slice data in the second video stream according to the judgment result in the slice judging module.
The video live broadcasting device provided by the embodiment of the invention has the same implementation principle and technical effect as the video live broadcasting method embodiment, and for brief description, corresponding contents in the video live broadcasting method embodiment can be referred to where the embodiment of the video live broadcasting device is not mentioned.
The embodiment of the invention also provides edge equipment and a user terminal of the CDN network; referring to fig. 12, a schematic structural diagram of an edge device or a user terminal of a CDN network includes a processor 101 and a memory 100, where the memory 100 stores machine executable instructions capable of being executed by the processor 101, and the processor 101 executes the machine executable instructions to implement the video live broadcasting method.
Further, the server shown in fig. 12 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The Memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 12, but that does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The Processor 101 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the video live broadcasting method.
The image enhancement method, the image enhancement device, and the computer program product of the server provided in the embodiments of the present invention include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the methods described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, which are not described herein again.
The functions, if implemented in the form of software functional units 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 or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) 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 removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (15)

1. A method for live video, the method comprising:
receiving a video stream pushed by a stream pushing client;
setting time information for the image group in the video stream according to the arrival time of the image group in the video stream, and pushing the set video stream to a source station server;
if a pull stream request of the video stream is received, acquiring the video stream from the source station server;
packaging the video stream into slice data, and setting index information for the slice data according to the time information of the image group contained in the slice data;
pushing the set slice data to a pull stream client corresponding to the pull stream request;
before the step of pushing the set slice data to the pull stream client corresponding to the pull stream request, the method further includes:
generating check data of the current slice data by a preset check algorithm aiming at each slice data;
and carrying the check data into the current slice data.
2. The method according to claim 1, wherein the step of setting time information for the group of pictures in the video stream according to the arrival time of the group of pictures in the video stream comprises:
generating a time stamp corresponding to the arrival time of the current image group aiming at each image group in the video stream;
and setting the time stamp as the time information of the current image group.
3. The method of claim 1, wherein the step of encapsulating the video stream into slice data comprises: and according to the image group in the video stream, carrying out slicing processing on the video stream to obtain slice data.
4. The method of claim 3, wherein each of said slice data comprises a group of images.
5. The method according to claim 1, wherein the step of setting index information for the slice data based on time information of a group of pictures contained in the slice data comprises:
and for each piece of slice data, determining the time information of the image group contained in the current piece of slice data as the index information of the current piece of slice data.
6. The method of claim 1, wherein the slice data comprises a plurality of video tags;
after the step of setting index information for the slice data according to time information of a group of images contained in the slice data, the method further includes:
setting a Tag number for each video Tag in the slice data; wherein the Tag number includes identification information of the video stream, index information of the slice data, and a sequence number of the video Tag in the slice data.
7. The method of claim 1, wherein after the step of receiving the video stream pushed by the push streaming client, the method further comprises:
checking whether a communication protocol packet corresponding to the current image group is complete or not aiming at each image group in the video stream;
and if not, discarding the current image group.
8. The method according to any one of claims 1 to 7, wherein the step of pushing the set slice data to a pull flow client corresponding to the pull flow request comprises: the edge device of the CDN network combines the set slice data into a first video stream and pushes the first video stream to a pull stream client corresponding to the pull stream request;
the method further comprises the following steps:
if the pull stream client receives a second video stream corresponding to the first video stream from a user terminal, matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream;
and the stream pulling client plays the first video stream and/or the second video stream according to a preset playing strategy.
9. A method for live video, the method comprising:
sending a pull flow request to an edge device of the CDN network;
receiving a first video stream pushed by the edge device; the first video stream comprises slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from the source station server; packaging the video stream into slice data, and setting index information for the slice data according to time information of an image group contained in the slice data to obtain final slice data;
if a second video stream corresponding to the first video stream is received from a user terminal, matching slice data in the second video stream with slice data in the first video stream according to index information of the slice data in the first video stream and the second video stream;
and playing the first video stream and/or the second video stream according to a preset playing strategy.
10. The method of claim 9, further comprising:
if the designated slice data in the second video stream needs to be played according to the playing strategy, generating verification data of the designated slice data through a preset verification algorithm;
judging whether the generated check data is consistent with check data carried in the specified slice data;
and if the two video streams are consistent, playing the specified slice data in the second video stream.
11. A video live broadcasting device, characterized in that the device comprises the following modules:
the first receiving module is used for receiving the video stream pushed by the stream pushing client;
the setting module is used for setting time information for the image group in the video stream according to the arrival time of the image group in the video stream and pushing the set video stream to a source station server;
an obtaining module, configured to obtain the video stream from the source station server if a pull request of the video stream is received;
the packaging module is used for packaging the video stream into slice data and setting index information for the slice data according to the time information of the image group contained in the slice data;
the pushing module is used for pushing the set slice data to a pull stream client corresponding to the pull stream request;
the checking module is used for generating checking data of the current slice data through a preset checking algorithm aiming at each slice data; and carrying the check data into the current slice data.
12. A video live broadcasting device, characterized in that the device comprises the following modules:
a pull request sending module, configured to send a pull request to an edge device of the CDN network;
the second receiving module is used for receiving the first video stream pushed by the edge device; the first video stream comprises slice data; the slice data is generated by the edge device by: setting time information for an image group in a video stream according to the arrival time of the image group in the video stream pushed by a stream pushing client, and pushing the set video stream to a source station server; if a pull stream request of the video stream is received, acquiring the video stream from the source station server; packaging the video stream into slice data, and setting index information for the slice data according to time information of an image group contained in the slice data to obtain final slice data;
the matching module is used for matching the slice data in the second video stream with the slice data in the first video stream according to the index information of the slice data in the first video stream and the second video stream if the second video stream corresponding to the first video stream is received from the user terminal;
and the playing module is used for playing the first video stream and/or the second video stream according to a preset playing strategy.
13. An edge device of a CDN network comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to perform the machine executable instructions to implement the live video method of any of claims 1-9.
14. A user terminal comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the live video method of claim 9 or 10.
15. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the video live method of any of claims 1 to 10.
CN201910952321.4A 2019-09-30 2019-09-30 Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal Active CN112584231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910952321.4A CN112584231B (en) 2019-09-30 2019-09-30 Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910952321.4A CN112584231B (en) 2019-09-30 2019-09-30 Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal

Publications (2)

Publication Number Publication Date
CN112584231A CN112584231A (en) 2021-03-30
CN112584231B true CN112584231B (en) 2023-04-07

Family

ID=75117272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910952321.4A Active CN112584231B (en) 2019-09-30 2019-09-30 Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal

Country Status (1)

Country Link
CN (1) CN112584231B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259694A (en) * 2021-04-22 2021-08-13 北京金山云网络技术有限公司 Data slicing method and device and electronic equipment
CN115002336A (en) * 2021-11-30 2022-09-02 荣耀终端有限公司 Video information generation method, electronic device and medium
CN114710694B (en) * 2022-04-12 2023-05-30 深圳市瑞云科技有限公司 Distributed plug flow method in cloud game scene
CN115103202A (en) * 2022-04-27 2022-09-23 北京歌华有线电视网络股份有限公司 IP video live broadcast transmission method and system capable of resisting network degradation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094107A (en) * 2006-06-21 2007-12-26 北京网视天元信息技术有限公司 System and method for accurate measuring transmission effect of P2P stream media netwrok for video / audio programs
CN102710966A (en) * 2012-06-13 2012-10-03 百视通网络电视技术发展有限责任公司 Video live broadcast method and system based on HTTP (Hyper Text Transport Protocol)
CN105451096A (en) * 2015-12-02 2016-03-30 北京暴风科技股份有限公司 Webcast system and webcast method
CN105848011A (en) * 2016-03-31 2016-08-10 乐视控股(北京)有限公司 Video living broadcast method and device
CN108366292A (en) * 2017-12-27 2018-08-03 武汉烽火众智数字技术有限责任公司 A kind of across a network net cast method and system based on Streaming Media
CN109474684A (en) * 2018-11-14 2019-03-15 广州虎牙信息科技有限公司 A kind of method, apparatus, terminal device and storage medium obtaining live video stream

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9736502B2 (en) * 2015-09-14 2017-08-15 Alan H. Barber System, device, and method for providing audiences for live video streaming

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094107A (en) * 2006-06-21 2007-12-26 北京网视天元信息技术有限公司 System and method for accurate measuring transmission effect of P2P stream media netwrok for video / audio programs
CN102710966A (en) * 2012-06-13 2012-10-03 百视通网络电视技术发展有限责任公司 Video live broadcast method and system based on HTTP (Hyper Text Transport Protocol)
CN105451096A (en) * 2015-12-02 2016-03-30 北京暴风科技股份有限公司 Webcast system and webcast method
CN105848011A (en) * 2016-03-31 2016-08-10 乐视控股(北京)有限公司 Video living broadcast method and device
CN108366292A (en) * 2017-12-27 2018-08-03 武汉烽火众智数字技术有限责任公司 A kind of across a network net cast method and system based on Streaming Media
CN109474684A (en) * 2018-11-14 2019-03-15 广州虎牙信息科技有限公司 A kind of method, apparatus, terminal device and storage medium obtaining live video stream

Also Published As

Publication number Publication date
CN112584231A (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN112584231B (en) Video live broadcast method and device, edge device of CDN (content delivery network) and user terminal
JP6190525B2 (en) A concept for determining the quality of media data streams with varying quality versus bit rate
EP2880836B1 (en) Replacing lost media data for network streaming
US20160337424A1 (en) Transferring media data using a websocket subprotocol
CN109495505B (en) Streaming media protocol conversion method, device, system and computer readable medium
US8649278B2 (en) Method and system of multimedia service performance monitoring
KR102188222B1 (en) Video service quality evaluation method and device
US11218784B1 (en) Method and system for inserting markers in a media presentation
US20180176278A1 (en) Detecting and signaling new initialization segments during manifest-file-free media streaming
CN108419041B (en) Video data processing method and device
CN111770390A (en) Data processing method, device, server and storage medium
US20170331666A1 (en) Real-time control interface for broadcast object streaming
US20230045876A1 (en) Video Playing Method, Apparatus, and System, and Computer Storage Medium
WO2017092433A1 (en) Method and device for video real-time playback
US9866459B1 (en) Origin failover for live streaming
CN113259694A (en) Data slicing method and device and electronic equipment
US20230328308A1 (en) Synchronization of multiple content streams
US11599570B2 (en) Device and method to render multimedia data stream tamper-proof based on block chain recording
CN108124183B (en) Method for synchronously acquiring video and audio to perform one-to-many video and audio streaming
CN111417031B (en) File transmission method and device and electronic equipment
CN110545447B (en) Audio and video synchronization method and device
JP2023007048A (en) Streaming server, transmission method, and program
CN115883855B (en) Playing data processing method, device, computer equipment and storage medium
WO2022100742A1 (en) Video encoding and video playback method, apparatus and system
CN108023855B (en) Video quality monitoring method, video quality monitoring server and equipment

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