CN109218745B - Live broadcast method, server, client and readable storage medium - Google Patents

Live broadcast method, server, client and readable storage medium Download PDF

Info

Publication number
CN109218745B
CN109218745B CN201811287125.1A CN201811287125A CN109218745B CN 109218745 B CN109218745 B CN 109218745B CN 201811287125 A CN201811287125 A CN 201811287125A CN 109218745 B CN109218745 B CN 109218745B
Authority
CN
China
Prior art keywords
slice
information
played
data
live
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
CN201811287125.1A
Other languages
Chinese (zh)
Other versions
CN109218745A (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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN201811287125.1A priority Critical patent/CN109218745B/en
Publication of CN109218745A publication Critical patent/CN109218745A/en
Application granted granted Critical
Publication of CN109218745B publication Critical patent/CN109218745B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Landscapes

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

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a live broadcast method, a server, a client and a readable storage medium. In some embodiments of the present invention, a live broadcast method is applied to a server, and includes: after receiving a live broadcast request sent by a client, determining information of a live broadcast stream corresponding to the live broadcast request; the information of the live stream comprises the playing delay information of the live stream and the information of a slice containing a key frame in the live stream; determining the information of the slice which is played at the beginning according to the information of the live stream; determining slice data corresponding to the live broadcast request according to the information of the slice which is played at the beginning; and determining and returning first response data according to the slice data corresponding to the live broadcast request. In the realization, the server determines the slice data corresponding to the live broadcast request according to the information of the live broadcast stream, so that the information that the client independently requests the live broadcast stream is saved, the first screen time is shortened, and the first screen speed is improved.

Description

Live broadcast method, server, client and readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a live broadcast method, a server, a client and a readable storage medium.
Background
The first screen loading time in live broadcasting refers to the time from the player loading to the rendering of the first frame of picture when the live broadcasting enters the live broadcasting room, and is an important index in the live broadcasting experience. The image frames in the live stream are divided into: key frames (Intra frames, I frames for short), forward-Predictive coded frames (P frames for short), Bi-directionally predicted interpolated frames (B frames for short). Wherein, only the I frame can finish decoding independently without depending on other frames, which means that the I frame can be rendered immediately after the I frame is received by the player, and when the P frame and the B frame are received, the dependent frames need to be waited, decoding and rendering cannot be finished immediately, and a 'black screen' phenomenon occurs in this period of time. The current slice live stream playing process is as follows: the live broadcast service end adds numbers to all audio and video data at a fixed time interval T (usually 1s), and each number represents the time of the part of audio and video; the client side initiates a request for acquiring a slice information file, the server returns the slice information file, and the slice information file comprises information such as serial numbers of slices containing I frame information, set play delay size and the like; the client determines a starting playing position according to the set playing delay size, searches the serial number A of the slice containing the I-frame information before the starting playing position by combining the slice information file, and then initiates a request for requesting the slice data with the serial number A. The client requests the slice with the number a, and then sequentially requests the slice data with the numbers a +1 and a +2 … ….
However, the inventors found that at least the following problems exist in the prior art: for a slice-based live stream, a slice information file is requested once before real slice data is requested, and then the slice data is requested in sequence. This will add some RTT time, making the live first screen slower.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a live broadcast method, a server, a client and a readable storage medium, so that the server determines slice data corresponding to a live broadcast request according to information of a live broadcast stream, the information of the live broadcast stream independently requested by the client is saved, the first screen starting time is shortened, and the first screen starting speed is improved.
In order to solve the above technical problem, an embodiment of the present invention provides a live broadcasting method, including the following steps: after receiving a live broadcast request sent by a client, determining information of a live broadcast stream corresponding to the live broadcast request; the information of the live stream comprises the playing delay information of the live stream and the information of a slice containing a key frame in the live stream; determining the information of the slice which is played at the beginning according to the information of the live stream; determining slice data corresponding to the live broadcast request according to the information of the slice which is played at the beginning; and determining and returning first response data according to the slice data corresponding to the live broadcast request.
The embodiment of the invention also provides a live broadcast method, which comprises the following steps: sending a first direct broadcasting request to a server; after receiving a live broadcast request sent by a client, a server determines information of a live broadcast stream corresponding to the live broadcast request; the information of the live stream comprises the playing delay information of the live stream and the information of the slice containing the key frame in the live stream; determining the information of the slice which is played at the beginning according to the information of the live stream; determining slice data corresponding to the live broadcast request according to the information of the slice which is played at the beginning; determining and returning first response data according to the slice data corresponding to the live broadcast request; receiving first response data returned by the server; and playing the slice data in the first response data.
An embodiment of the present invention further provides a server, including: the device comprises a first determining module, a second determining module, a third determining module and a fourth determining module; the first determining module, the second determining module, the third determining module and the fourth determining module are coupled to execute the live broadcasting method mentioned in the above embodiment.
An embodiment of the present invention further provides a client, including: the device comprises a sending module, a receiving module and a playing module; the sending module, the receiving module and the playing module are coupled and are used for executing the live broadcasting method mentioned in the above embodiment.
An embodiment of the present invention further provides a server, including: at least one processor; and a memory communicatively coupled to the at least one processor; and a communication component in communication connection with the client, the communication component receiving and sending data under control of the processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the live method as mentioned in the above embodiments.
An embodiment of the present invention further provides a client, including: at least one processor; and a memory communicatively coupled to the at least one processor; and a communication component in communication connection with the server, the communication component receiving and transmitting data under control of the processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the live method as mentioned in the above embodiments.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the live broadcast method mentioned in the above embodiment.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the live broadcast method mentioned in the above embodiment.
Compared with the prior art, the method and the device for processing the live broadcast data have the advantages that the client side directly requests the server for the slice data, the server determines the slice data corresponding to the live broadcast request according to the information of the live broadcast stream corresponding to the live broadcast request after receiving the live broadcast request of the client side, and the first response data comprising the slice data corresponding to the live broadcast request are returned. Compared with the method that the client requests the information of the live stream firstly, the client determines the information of the required slice data according to the information of the live stream and then requests the server for the slice data, in the embodiment of the invention, the client does not need to request the information of the live stream independently, thereby saving Round-Trip Time (RTT) in the process that the client requests the information of the live stream and the server returns the information of the live stream, shortening the Time of first screen and improving the speed of first screen.
In addition, according to the information of the slice which is played at the beginning, slice data corresponding to the live broadcast request is determined, which specifically includes: determining the slice which is played at the beginning according to the information of the slice which is played at the beginning; reading the key frame of the slice which is played at the beginning to the data of the last frame of the slice which is played at the beginning; and determining the slice data corresponding to the live broadcast request according to the data from the key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning. In the implementation, the server only returns the key frame and the data after the key frame, so that the time for transmitting the redundant data before the key frame is reduced, and the first screen time is further shortened.
In addition, determining the slice data corresponding to the live broadcast request according to the data from the key frame of the slice to be played at the beginning to the last frame of the slice to be played at the beginning specifically includes: reading data of N slices after the slice which is played at the beginning, wherein N is a positive integer; and determining the slice data corresponding to the live broadcast request according to the data from the key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning and the data of the N slices after the slice which is played at the beginning. In the implementation, the data of the N slices after the slice which is played at the beginning and the data from the key frame which is played at the beginning to the last frame of the slice which is played at the beginning are sent to the client together, so that the RTT of the data of the N slices after the slice which is requested to be played at the beginning is reduced.
In addition, the slice of the initial playing comprises T key frames, and T is a positive integer not less than 1; reading the data from the key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning, which specifically comprises the following steps: and reading data from the first key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning.
In addition, according to the information of the slice which is played at the beginning, slice data corresponding to the live broadcast request is determined, which specifically includes: determining the slice which is played at the beginning according to the information of the slice which is played at the beginning; reading data of a slice which is played at the beginning and data of M slices which are played at the beginning after the slice, wherein M is a positive integer; and determining the slice data corresponding to the live broadcast request according to the data of the slice which is played at the beginning and the data of the M slices which are played at the beginning after the slice. In the implementation, the data of the M slices after the slice which is played at the beginning and the slice which is played at the beginning are returned to the client together, so that the RTT of the data of the M slices after the slice which is played at the beginning is reduced.
In addition, the information of the live stream also comprises play rule information; determining and returning first response data according to the slice data corresponding to the live broadcast request, wherein the method specifically comprises the following steps: merging the slice data corresponding to the live broadcast request and the play rule information according to a preset rule to obtain first response data; and sending the first response data to the client.
In addition, determining the information of the slice to be played at the beginning according to the information of the live stream specifically includes: determining the latest slice information at the moment of receiving the live broadcast request according to the information of the live broadcast stream; determining the information of the initial request slice according to the information of the latest slice and the playing delay information of the live stream; and according to the information of the slice containing the key frame and the information of the start request slice, taking the information of the slice which is closest to the start request slice and is before the start request slice in the slice containing the key frame as the information of the slice for starting playing.
In addition, the slice data in the first response data includes data of a slice to be played initially and data of N slices after the slice to be played initially, where N is a positive integer; after receiving the first response data returned by the server, the live broadcasting method further comprises the following steps: determining information of a last slice in slice data in the first response data; generating a second live broadcast request according to the information of the last slice; the second live broadcast request is used for requesting data of M slices after the last slice, and M is a positive integer; and sending a second live broadcast request to the server. In the implementation, the client requests the data of the next slice in sequence after receiving the first response data, so that the continuity of the live broadcast picture is ensured.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a flow chart of a live method of a first embodiment of the invention;
fig. 2 is a schematic diagram of a method for numbering a live stream by a server according to a first embodiment of the present invention;
fig. 3 is a schematic diagram of a method of calculating information of a slice from which playback is started in a first embodiment of the present invention;
FIG. 4 is a flow chart of a live method of a second embodiment of the present invention;
fig. 5 is a flow chart of a live method of a third embodiment of the invention;
fig. 6 is a flow chart of a live method of a fourth embodiment of the invention;
FIG. 7 is an interaction diagram of a server, a content distribution network, and a client according to a fourth embodiment of the present invention;
fig. 8 is a schematic configuration diagram of a server according to a fifth embodiment of the present invention;
fig. 9 is a schematic structural diagram of a client according to a sixth embodiment of the present invention;
fig. 10 is a schematic configuration diagram of a server according to a seventh embodiment of the present invention;
fig. 11 is a schematic configuration diagram of a client according to an eighth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a live broadcast method which is applied to a server. In particular implementations, the server may be a server of the source station. As shown in fig. 1, the live broadcasting method includes the following steps:
step 101: after receiving a live broadcast request sent by a client, determining the information of a live broadcast stream corresponding to the live broadcast request.
Specifically, the information of the live stream includes information of a playback delay time of the live stream and information of a slice containing a key frame in the live stream.
In a specific implementation, the information of the slice includes a number of the slice. The server numbers each slice by a method of numbering the live stream, and stores the number of the slice containing the key frame in a slice information file as the information of the live stream. A schematic diagram of a method for numbering live streams by a server is shown in fig. 2, the server numbers live streams at fixed time intervals, the numbering may be from 0, or may be based on a certain value, and the numbering is accumulated by 1 each time, and so on. For example, the fixed time interval refers to the interval of the audio and video time stamps, and is numbered according to 1s interval, then the data of the audio and video time stamps in 0-1 s all belong to the slice (also called data block) with the number 1, and the data of the time stamps in 1 s-2 s all belong to the slice with the number 2. The server numbers at regular time intervals, so each number can represent the position of the slice in the live stream, i.e. the time of the audio and video. The server stores the number of the slice including the key frame in the slice information file as the information of the slice including the key frame. By reading the slice information file, it can be determined which slices contain key frames.
It should be noted that, in practical applications, other information, for example, the data size of the slice, may be included in the information of the slice.
Step 102: and determining the information of the slice which is played at the beginning according to the information of the live stream.
Specifically, the server determines, based on information of the live stream, information of the latest slice at the time when the live request is received. The server determines the information of the initial request slice according to the latest slice information and the playing delay information of the live stream; and according to the information of the slice containing the key frame and the information of the start request slice, taking the information of the slice which is closest to the start request slice and is before the start request slice in the slice containing the key frame as the information of the slice for starting playing.
It should be noted that, in practical applications, the server may also determine information of a latest slice at the current time according to information of the live stream, and determine information of an initial request slice according to the information of the latest slice at the current time and the play delay information of the live stream.
For example, as shown in fig. 3, when the server receives a live broadcast request, the server reads the broadcast delay information of the live broadcast stream in the information of the live broadcast stream, and determines that the broadcast delay information indicates that: the current delay time is set to D seconds, and at the time of receiving the live broadcast request, the information of the latest slice (the number of the latest slice) of the live broadcast stream is L, and then the information of the start request slice (the number of the start request slice) is S ═ L-D. Since the client needs to start playing from the key frame (I frame), the server determines, according to the information of the slice containing the key frame, the slice containing the key frame that is the last slice containing the key frame closest to the slice with the number S and is numbered P, and the slice with the number P is the last slice to be played at the start of the client.
Step 103: and determining the slice data corresponding to the live broadcast request according to the information of the slice which is played at the beginning.
In a specific implementation, after determining information of a slice to be played initially, the server reads data of the slice to be played initially, and takes the data of the slice to be played initially as slice data corresponding to a live broadcast request.
It should be noted that, in practical applications, after determining information of a slice to be initially played, a server may select, according to data of the slice to be initially played, a part of data in the data of the slice to be initially played as slice data corresponding to a live broadcast request, or the server selects data of the slice to be initially played and data of N slices after the slice to be initially played as slice data corresponding to the live broadcast request.
Step 104: and determining and returning first response data according to the slice data corresponding to the live broadcast request.
In the specific implementation, the server combines the slice data corresponding to the live broadcast request and the play rule information according to a preset rule according to the play rule information included in the information of the live broadcast stream to obtain first response data; and sending the first response data to the client.
In another specific implementation, the server returns data corresponding to the live broadcast request as first response data to the client. And the server sends the playing rule information to the client before or after returning the first response data.
It should be noted that, as can be understood by those skilled in the art, in practical application, the preset rule may be set as required, for example, the preset rule is: and merging the slice data corresponding to the live broadcast request and the playing rule information according to a binary format.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
Compared with the prior art, in the live broadcasting method provided by the embodiment, the client directly requests the server for the sliced data, after receiving the live broadcasting request of the client, the server determines the sliced data corresponding to the live broadcasting request according to the information of the live broadcasting stream corresponding to the live broadcasting request, and returns the first response data including the sliced data corresponding to the live broadcasting request. Compared with the method that the client requests the information of the live stream firstly, the client determines the information of the required slice data according to the information of the live stream and then requests the server for the slice data, in the embodiment, the client does not need to request the information of the live stream independently, so that the communication time in the process that the client requests the information of the live stream and the server returns the information of the live stream is saved, the first screen time is shortened, and the first screen speed is improved.
A second embodiment of the present invention relates to a live broadcast method, and is substantially the same as the first embodiment, and mainly differs therefrom in that: in the first embodiment, step 103 is specifically described by taking the data of the slice that is played at the beginning as the slice data corresponding to the live broadcast request by the server as an example, and in the present embodiment, another implementation manner is described in which step 103 determines the slice data corresponding to the live broadcast request according to the information of the slice that is played at the beginning.
Specifically, as shown in fig. 4, the present embodiment includes steps 201 to 205, where steps 201, 202 and 205 are substantially the same as steps 101, 102 and 104 in the first embodiment, and are not repeated herein. The following mainly introduces the differences:
step 201 and step 202 are performed.
Step 203: and determining the slice to be played initially according to the information of the slice to be played initially, and reading the data from the key frame of the slice to be played initially to the last frame of the slice to be played initially.
Specifically, after determining the slice to be played initially, the server determines the position of the key frame of the slice to be played initially, and reads the data of the key frame and the data following the key frame of the slice to be played initially. If the slice which is played at the beginning comprises T key frames, the server reads data from the first key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning, and T is a positive integer which is not less than 1.
Step 204: and determining the slice data corresponding to the live broadcast request according to the data from the key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning.
Specifically, the server may directly use data from a key frame of a slice to be played initially to a last frame of the slice to be played initially as slice data corresponding to the live broadcast request, or may read data of N slices after the slice to be played initially after reading data from the key frame of the slice to be played initially to the last frame of the slice to be played initially, and determine slice data corresponding to the live broadcast request according to the data from the key frame of the slice to be played initially to the last frame of the slice to be played initially and the data of the N slices after the slice to be played initially, where N is a positive integer.
It is worth mentioning that the server only returns the key frame and the data after the key frame, thereby reducing the time of transmitting the redundant data before the key frame and further shortening the first screen time.
It is worth mentioning that when the server sends the data of the N slices after the slice that is initially played, and the data from the key frame that is initially played to the last frame of the slice that is initially played to the client, the Round-Trip Time (RTT) of the data of the N slices after the slice that is requested to be initially played is reduced.
Step 205 is performed.
It should be noted that, in another specific implementation, step 203 and step 204 may be replaced by: determining the slice which is played at the beginning according to the information of the slice which is played at the beginning; reading data of the slice which is played at the beginning and data of M slices after the slice which is played at the beginning; and determining slice data corresponding to the live broadcast request according to the data of the slice which is played at the beginning and the data of M slices after the slice which is played at the beginning, wherein M is a positive integer. Those skilled in the art will appreciate that the specific implementation manner of step 103 includes, but is not limited to, the manner set forth in the first embodiment and the second embodiment of the present invention.
The above description is only for illustrative purposes and does not limit the technical aspects of the present invention.
Compared with the prior art, the client provided in the embodiment directly requests the server for the sliced data, and after receiving the live broadcast request of the client, the server determines the sliced data corresponding to the live broadcast request according to the information of the live broadcast stream corresponding to the live broadcast request, and returns the first response data including the sliced data corresponding to the live broadcast request. Compared with the method that the client requests the information of the live stream firstly, the client determines the information of the required slice data according to the information of the live stream and then requests the server for the slice data, in the embodiment, the client does not need to request the information of the live stream independently, so that the communication time in the process that the client requests the information of the live stream and the server returns the information of the live stream is saved, the first screen time is shortened, and the first screen speed is improved. In addition, the data of the N slices after the slice which is played at the beginning and the data from the key frame which is played at the beginning to the last frame of the slice which is played at the beginning are sent to the client together, so that the RTT of the data of the N slices after the slice which is requested to be played at the beginning is reduced. Further, the server returns the data of the M slices after the slice which starts playing and the slice which starts playing to the client together, so that the RTT of the data of the M slices after the slice which requests the start playing is reduced.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to a live broadcasting method, which is applied to a client, and as shown in fig. 5, includes the following steps:
step 301: a first broadcast request is sent to a server.
Specifically, after determining that a request for data in a live stream is needed, for example, after the client enters a live room, the client sends a first live request to the server. The name of the first live broadcast request may be customized, as long as the name can be distinguished from the subsequent live broadcast request, for example: http:// test.com/live/key.chunk. After receiving a live broadcast request sent by a client, a server determines information of a live broadcast stream corresponding to the live broadcast request; the information of the live stream comprises the playing delay information of the live stream and the information of the slice containing the key frame in the live stream; determining the information of the slice which is played at the beginning according to the information of the live stream; determining slice data corresponding to the live broadcast request according to the information of the slice which is played at the beginning; and determining and returning first response data according to the slice data corresponding to the live broadcast request. It should be noted that, for the process of determining the first reply data by the server, reference may be made to the related description of the first embodiment and the second embodiment, and details are not described here again.
It is worth mentioning that the client directly requests the slice data instead of requesting the slice data after requesting to obtain the information (slice information file) of the live stream, which saves the RTT time of initiating the information request of the live stream.
Step 302: and receiving first response data returned by the server.
Step 303: and playing the slice data in the first response data.
Specifically, after receiving the first response data, the client analyzes the slice data corresponding to the first direct broadcast request from the first response data, and plays the slice data corresponding to the first direct broadcast request according to a play rule of the live stream.
Compared with the prior art, according to the live broadcasting method provided by the embodiment, the client directly requests the server for the sliced data, after receiving the live broadcasting request of the client, the server determines the sliced data corresponding to the live broadcasting request according to the information of the live broadcasting stream corresponding to the live broadcasting request, and returns the first response data including the sliced data corresponding to the live broadcasting request. Compared with the method that the client requests the information of the live stream firstly, the client determines the information of the required slice data according to the information of the live stream and then requests the server for the slice data, in the embodiment, the client does not need to request the information of the live stream independently, so that the communication time in the process that the client requests the information of the live stream and the server returns the information of the live stream is saved, the first screen time is shortened, and the first screen speed is improved.
A fourth embodiment of the present invention relates to a live broadcast method applied to a client, and the present embodiment is substantially the same as the third embodiment, and mainly differs therefrom in that: after step 302, other related steps are added.
Specifically, as shown in fig. 6, the present embodiment includes steps 401 to 404, where steps 401, 402, and 404 are substantially the same as steps 301, 302, and 303 of the third embodiment, and are not repeated here, and differences are mainly described below, and the fourth embodiment of the present invention includes the following steps:
step 401 and step 402 are performed.
Step 403: and determining the information of the last slice in the slice data in the first response data, generating a second live broadcast request according to the information of the last slice, and sending the second live broadcast request to the server.
Specifically, the slice data in the first response data includes data of a slice to be played at the beginning and data of N slices following the slice to be played at the beginning, where N is a positive integer. The second live request is for requesting data of M slices after the last slice.
It should be noted that, in practical applications, after the second live request is generated, the client may immediately send the second live request to the server, so as to obtain data of M slices after the last slice as soon as possible, or send the data of M slices after the last slice to the server in the process of playing the slice data in the first response data.
It should be mentioned that the client requests the data of the next slice in sequence after receiving the first response data, so as to ensure the continuity of the live broadcast picture.
Step 404 is performed.
It should be noted that, in this embodiment, for clarity of illustration, step 403 is taken as a previous step of step 404 in this embodiment, but those skilled in the art can understand that, in practical application, step 403 only needs to be disposed after step 402, and step 403 and step 404 may be executed simultaneously.
Compared with the prior art, according to the live broadcasting method provided by the embodiment, the client directly requests the server for the sliced data, after receiving the live broadcasting request of the client, the server determines the sliced data corresponding to the live broadcasting request according to the information of the live broadcasting stream corresponding to the live broadcasting request, and returns the first response data including the sliced data corresponding to the live broadcasting request. Compared with the method that the client requests the information of the live stream firstly, the client determines the information of the required slice data according to the information of the live stream and then requests the server for the slice data, in the embodiment, the client does not need to request the information of the live stream independently, so that the communication time in the process that the client requests the information of the live stream and the server returns the information of the live stream is saved, the first screen time is shortened, and the first screen speed is improved. In addition, the client requests the data of the next slice in sequence after receiving the first response data, so that the continuity of the live broadcast picture is ensured.
The description has been given above on the direct broadcast method, and based on the related Content in the first embodiment, the second embodiment, the third embodiment, and the fourth embodiment, the following describes the interaction between the client and the server by taking the name of the first direct broadcast request as http:// test.com/live/key.chunk, the information of each slice of the direct broadcast stream as the number of each slice obtained after the server divides the direct broadcast stream according to a fixed time interval, and the server and the client communicate with each other through a Content Delivery Network (CDN). As shown in fig. 7, the interaction between the server, CDN and client includes the following steps:
step 501: the client sends http:// test.com/live/key.chunk to the CDN.
Step 502: the CDN sends http:// test. com/live/key. chunk to the server.
Step 503: the server calculates the start request slice and determines the slice for starting playing according to the information of the start request slice and the slice containing the key frame.
Step 504: and the server merges the slice information file, the data after the first key frame in the slice which is played at the beginning and the data of the next N slices to obtain response data. Wherein N can be set according to requirements.
Step 505: and the server sends the binary response data to the CDN according to an http protocol.
Step 506: the CDN sends the response data to the client.
Step 507: the client analyzes the slice information file and the slice data according to the defined protocol format, and sends the slice data to the player for decoding and playing.
After step 507, the client parses the number O of the last slice, and then requests the next slices numbered O +1 and O +2 … … in sequence.
A fifth embodiment of the present invention relates to a server, as shown in fig. 8, including: a first determination module 601, a second determination module 602, a third determination module 603, and a fourth determination module 604; the first determining module 601, the second determining module 602, the third determining module 603 and the fourth determining module 604 are coupled to perform the live broadcasting method mentioned in the above embodiments.
It should be noted that this embodiment is a system example corresponding to the first embodiment and the second embodiment, and may be implemented in cooperation with the first embodiment and the second embodiment. The related technical details mentioned in the first embodiment and the second embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment and the second embodiment.
A sixth embodiment of the present invention relates to a client, as shown in fig. 9, including: a sending module 701, a receiving module 702 and a playing module 703; the sending module 701, the receiving module 702 and the playing module 703 are coupled to execute the live broadcasting method mentioned in the above embodiments.
It should be noted that this embodiment is a system example corresponding to the third embodiment and the fourth embodiment, and may be implemented in cooperation with the third embodiment and the fourth embodiment. The related technical details mentioned in the third embodiment and the fourth embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied in the third embodiment and the fourth embodiment.
It should be noted that each of the modules in the fifth embodiment and the sixth embodiment is a logic module, and in practical application, one logic unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of a plurality of physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problem proposed by the present invention are not introduced in the fifth embodiment and the sixth embodiment, but this does not indicate that there are no other elements in the fifth embodiment and the sixth embodiment.
A seventh embodiment of the present invention relates to a server, as shown in fig. 10, including: at least one processor 801; and a memory 802 communicatively coupled to the at least one processor 801; and a communication component 803 communicatively coupled to the client, the communication component 803 receiving and transmitting data under control of the processor 801; wherein the memory 802 stores instructions executable by the at least one processor 801 to enable the at least one processor 801 to perform the live broadcast method as mentioned in the above embodiments.
An eighth embodiment of the present invention relates to a client, as shown in fig. 11, including: at least one processor 901; and, memory 902 communicatively connected to at least one processor 901; and a communication component 903 communicatively coupled to the server, the communication component 903 receiving and transmitting data under the control of the processor 901; wherein the memory 902 stores instructions executable by the at least one processor 901, the instructions being executable by the at least one processor 901 to enable the at least one processor 901 to perform the live broadcast method as mentioned in the above embodiments.
The seventh embodiment and the eighth embodiment include: one or more processors and memory, one processor being exemplified in fig. 10 and 11. The processor and the memory may be connected by a bus or other means, and fig. 10 and 11 illustrate the connection by a bus. The memory, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor executes various functional applications and data processing of the device by executing nonvolatile software programs, instructions and modules stored in the memory, namely, the method provided by the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store a list of options, etc. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the external device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory and, when executed by the one or more processors, perform the methods of any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, has corresponding functional modules and beneficial effects of the execution method, and can refer to the method provided by the embodiment of the application without detailed technical details in the embodiment.
A ninth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program, when executed by the processor, implements the live broadcast methods provided by the first and second embodiments.
A tenth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program, when executed by the processor, implements the live broadcast methods provided by the third and fourth embodiments.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. 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.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (14)

1. A live broadcast method is applied to a server and comprises the following steps:
after a first live broadcast request sent by a client is received, determining the information of a live broadcast stream corresponding to the first live broadcast request; the information of the live stream comprises playing delay information of the live stream and information of all slices containing key frames in the live stream, wherein the information of all slices containing key frames is the serial numbers of all slices containing key frames;
determining the information of the slice which is played at the beginning according to the information of the live stream, wherein the information of the slice which is played at the beginning comprises the information which is closest to the slice which is requested to be played at the beginning and is in front of the slice which is requested to be played at the beginning in the slices which contain key frames;
determining slice data corresponding to the first live broadcast request according to the information of the slice which is played at the beginning, wherein the slice data corresponding to the first live broadcast request comprises the data of the slice which is played at the beginning and the data of a plurality of slices after the slice which is played at the beginning;
and determining and returning first response data according to the slice data corresponding to the first live broadcast request, wherein the slice data in the first response data comprises the data of the slice which is played at the beginning and the data of N slices after the slice which is played at the beginning, and N is a positive integer.
2. The live broadcasting method according to claim 1, wherein the determining, according to the information of the slice to be played at the beginning, the slice data corresponding to the first live broadcasting request specifically includes:
determining the slice which is played at the beginning according to the information of the slice which is played at the beginning;
reading the key frame of the slice which is played at the beginning to the data of the last frame of the slice which is played at the beginning;
reading data of N slices after the slice which is played at the beginning, wherein N is a positive integer;
and determining slice data corresponding to the first live broadcast request according to the data from the key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning and the data of the N slices after the slice which is played at the beginning.
3. A live broadcasting method according to claim 2, wherein the slice of the start playing includes T key frames, T being a positive integer not less than 1;
the reading of the data from the key frame of the slice to be initially played to the last frame of the slice to be initially played specifically includes:
and reading data from the first key frame of the slice which is played at the beginning to the last frame of the slice which is played at the beginning.
4. The live broadcasting method according to claim 1, wherein the determining, according to the information of the slice to be played at the beginning, the slice data corresponding to the first live broadcasting request specifically includes:
determining the slice which is played at the beginning according to the information of the slice which is played at the beginning;
reading the data of the slice which is played at the beginning and the data of M slices after the slice which is played at the beginning, wherein M is a positive integer;
and determining slice data corresponding to the first live broadcast request according to the data of the slice which is played at the beginning and the data of the M slices which are obtained after the slice which is played at the beginning.
5. A live method according to any one of claims 1 to 4, characterized in that the information of the live stream further comprises playback rule information;
determining and returning first response data according to the slice data corresponding to the first live broadcast request, specifically comprising:
merging the slice data corresponding to the first live broadcast request and the playing rule information according to a preset rule to obtain first answer data;
and sending the first response data to the client.
6. The live broadcasting method according to any one of claims 1 to 4, wherein the determining information of a slice to start playing according to the information of the live broadcasting stream specifically includes:
determining the latest slice information at the moment of receiving the first live broadcast request according to the live broadcast stream information;
determining the information of the initial request slice according to the information of the latest slice and the playing delay information of the live stream;
and according to the information of the slice containing the key frame and the information of the start request slice, taking the information of the slice which is closest to the start request slice and is before the start request slice in the slice containing the key frame as the information of the slice for starting playing.
7. A live broadcast method is applied to a client and comprises the following steps:
sending a first live broadcast request to a server; after receiving a first live broadcast request sent by a client, the server determines the information of a live broadcast stream corresponding to the first live broadcast request; the information of the live stream comprises the playing delay information of the live stream and the information of all slices containing key frames in the live stream, and the information of all slices containing key frames is the serial numbers of all slices containing key frames; determining the information of the slice which is played at the beginning according to the information of the live stream, wherein the information of the slice which is played at the beginning comprises the information which is closest to the slice which is requested to be played at the beginning and is in front of the slice which is requested to be played at the beginning in the slices which contain key frames; determining slice data corresponding to the first live broadcast request according to the information of the slice which is played at the beginning, wherein the slice data corresponding to the first live broadcast request comprises the data of the slice which is played at the beginning and the data of a plurality of slices after the slice which is played at the beginning; determining and returning first response data according to slice data corresponding to the first live broadcast request, wherein the slice data in the first response data comprises data of the slice which is played at the beginning and data of N slices after the slice which is played at the beginning, and N is a positive integer;
receiving first response data returned by the server;
and playing the slice data in the first response data.
8. A live method according to claim 7, wherein after receiving the first response data returned by the server, the live method further comprises:
determining information of a last slice in slice data in the first response data;
generating a second live broadcast request according to the information of the last slice; the second live broadcast request is used for requesting data of M slices after the last slice, wherein M is a positive integer;
and sending the second live broadcast request to the server.
9. A server, comprising: the device comprises a first determining module, a second determining module, a third determining module and a fourth determining module; the first determining module, the second determining module, the third determining module and the fourth determining module are coupled to perform the live broadcasting method of any one of claims 1 to 6.
10. A client, comprising: the device comprises a sending module, a receiving module and a playing module; the sending module, the receiving module and the playing module are coupled to execute the live broadcasting method of claim 7 or 8.
11. A server, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; and the number of the first and second groups,
a communication component in communicative connection with a client, the communication component receiving and transmitting data under control of the processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a live method as claimed in any one of claims 1 to 6.
12. A client, comprising: at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; and the number of the first and second groups,
a communication component in communicative connection with a server, the communication component receiving and transmitting data under control of the processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the live method of claim 7 or 8.
13. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the live broadcasting method of any one of claims 1 to 6.
14. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the live broadcasting method of claim 7 or 8.
CN201811287125.1A 2018-10-31 2018-10-31 Live broadcast method, server, client and readable storage medium Active CN109218745B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811287125.1A CN109218745B (en) 2018-10-31 2018-10-31 Live broadcast method, server, client and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811287125.1A CN109218745B (en) 2018-10-31 2018-10-31 Live broadcast method, server, client and readable storage medium

Publications (2)

Publication Number Publication Date
CN109218745A CN109218745A (en) 2019-01-15
CN109218745B true CN109218745B (en) 2021-07-23

Family

ID=64998330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811287125.1A Active CN109218745B (en) 2018-10-31 2018-10-31 Live broadcast method, server, client and readable storage medium

Country Status (1)

Country Link
CN (1) CN109218745B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784740A (en) * 2019-11-25 2020-02-11 北京三体云时代科技有限公司 Video processing method, device, server and readable storage medium
CN111918092B (en) * 2020-08-12 2022-07-01 广州繁星互娱信息科技有限公司 Video stream processing method, device, server and storage medium
CN114553839B (en) * 2022-02-25 2024-03-15 阿里巴巴(中国)有限公司 RTC data processing method and device
CN115174924B (en) * 2022-07-20 2024-05-28 天翼数字生活科技有限公司 Set top box, video playing time delay calculation method, system, equipment and medium
CN115550746A (en) * 2022-10-11 2022-12-30 杭州视洞科技有限公司 HLS low-delay method based on network camera and media distribution service system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium
CN105282627A (en) * 2014-07-22 2016-01-27 中兴通讯股份有限公司 Method for acquiring a live video clip and server
CN105847854A (en) * 2016-04-12 2016-08-10 乐视控股(北京)有限公司 Webcasting method and system
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN107147919A (en) * 2017-06-19 2017-09-08 网宿科技股份有限公司 It is live quickly to open broadcasting method and system
CN107809684A (en) * 2017-10-27 2018-03-16 广东省南方数字电视无线传播有限公司 Video segment generation method and device, caching server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105282627A (en) * 2014-07-22 2016-01-27 中兴通讯股份有限公司 Method for acquiring a live video clip and server
CN104683884A (en) * 2015-02-09 2015-06-03 网宿科技股份有限公司 Live method and system for stream medium
CN105898380A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Rapid network video play starting method and device
CN105847854A (en) * 2016-04-12 2016-08-10 乐视控股(北京)有限公司 Webcasting method and system
CN107147919A (en) * 2017-06-19 2017-09-08 网宿科技股份有限公司 It is live quickly to open broadcasting method and system
CN107809684A (en) * 2017-10-27 2018-03-16 广东省南方数字电视无线传播有限公司 Video segment generation method and device, caching server

Also Published As

Publication number Publication date
CN109218745A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109218745B (en) Live broadcast method, server, client and readable storage medium
CN107615756B (en) Video server, method and video system for realizing rapid and smooth viewpoint switching
CN107147919B (en) Live broadcast quick starting method and system
CN107690073B (en) Video live broadcast method and video live broadcast server
US10277927B2 (en) Movie package file format
US10638192B2 (en) Live streaming quick start method and system
CN110933517B (en) Code rate switching method, client and computer readable storage medium
CN111447455A (en) Live video stream playback processing method and device and computing equipment
US10958972B2 (en) Channel change method and apparatus
US11438645B2 (en) Media information processing method, related device, and computer storage medium
EP3734927A1 (en) Content service implementation method and device, and content delivery network node
CN106791994B (en) Low-delay quick broadcasting method and device
CN111726657A (en) Live video playing processing method and device and server
CN109756749A (en) Video data handling procedure, device, server and storage medium
CN113852824A (en) Video transcoding method and device, electronic equipment and storage medium
CN112312162B (en) Video server for transmitting video stream
EP3304848A1 (en) Method for initiating a transmission of a streaming content delivered to a client device and access point for implementing this method
CN113727199A (en) HLS slice rapid playing starting method
CN111193936B (en) Video streaming transmission method and device, electronic equipment and computer readable storage medium
CN115134622A (en) Video data alignment method, device, equipment and storage medium
CN111436009B (en) Real-time video stream transmission and display method and transmission and play system
CN112291591A (en) Video data playback method, electronic equipment and storage medium
US9467691B2 (en) Video system for displaying image data, method and computer program
CN110798713B (en) Time-shifted television on-demand method, terminal, server and system
CN115643441A (en) Video playing method, device, equipment, readable storage medium and program product

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