LIVE STREAMING QUICK START METHOD AND SYSTEM

Information

  • Patent Application
  • 20180376195
  • Publication Number
    20180376195
  • Date Filed
    July 13, 2017
    7 years ago
  • Date Published
    December 27, 2018
    5 years ago
Abstract
The present disclosure relates to a live streaming quick start method and system, which belong to streaming media technology. The method comprises: slicing, by a server, an audio-video stream into slice files, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream; recording, by the server, key frame information of the audio-video stream; determining, by the server, an initial slice file sequence number in response to a live streaming request sent by a player client; based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client; and resetting, by the player client, timestamps for the start-streaming response file based on a key frame closest to the initial slice file, and decoding and playing the start-streaming response file.
Description
FIELD OF THE DISCLOSURE

The present disclosure generally relates to the streaming media technology and, more particularly, relates to a live streaming quick start method and system.


BACKGROUND

In live streaming, the speed for displaying the first image on the screen may directly affect user experience. Taking on-demand streaming as an example, on-demand streaming user always cuts in from 0 second. In any on-demand streaming media file, the first audio-video frame at 0 second must be a key frame. Thus, for on-demand services, regardless of network transmission and decoding factors, the speed for displaying the first image on the screen may often be treated as real-time display.


However, for live streaming, a live media file may often be a streaming media file. A live streaming user may access the streaming media file at any random time. Thus, a first audio-video frame when the user cuts in may be an intra-coding frame (I-frame) also known as key frame, an inter-frame prediction coding frame (P-frame), or a bidirectional prediction coding frame (B-frame). When a player starts to play, the player needs a key frame to play properly. Thus, the following problems may exist.


1) When the player starts to play, very likely a dark screen is displayed. Moreover, when group of pictures (GOP) for the live streaming media file is large, the gap between the first audio-video frame that the player receives and the next key frame is relatively long, and hence the user may have to wait for a long time to be able to see the first image.


2) When the server transmits data starting from the last key frame, extra delay to the live streaming may be introduced. Thus, user experience may be degraded.


BRIEF SUMMARY OF THE DISCLOSURE

To solve issues in the existing technology, the present disclosure provides a live streaming quick start method and a live streaming quick start system. The technical solutions include the followings.


One aspect of the present disclosure provides a live streaming quick start method, comprising:


slicing, by a server, an audio-video stream into slice files, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream;


recording, by the server, key frame information of the audio-video stream;


determining, by the server, an initial slice file sequence number in response to a live streaming request sent by a player client;


based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client; and


resetting, by the player client, timestamps for the start-streaming response file based on a key frame closest to the initial slice file, and decoding and playing the start-streaming response file with the timestamps reset.


Further, based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client includes:


determining, by the server, a key frame slice file that has a sequence number closest to the initial slice file sequence number, where the key frame slice file is a slice file that contains a key frame and has a sequence number smaller than or equal to the initial slice file sequence number, and at the same time, the difference between the sequence number of the key frame slice file and the initial slice file sequence number is the minimum;


when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, where the start-streaming response file includes the key frame slice file, intermediate slice files having the sequence numbers between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file; and


when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, where the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.


Further, when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, resetting, by the player client, the timestamps for the start-streaming response file includes:


discarding, by the player client, the audio-video frames preceding the key frame in the key frame slice file, and resetting the timestamps of the key frame and the audio-video frames succeeding the key frame in the key frame slice file to an initial timestamp;


resetting, by the player client, the timestamps for the audio-video frames in the intermediate slice files to the initial timestamp; and


assuming the original timestamp for the first frame in the initial slice file is a reference value, resetting, by the player client, the timestamp for every frame in the initial slice file and the succeeding slice file to an adjusted timestamp, where the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.


Further, when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, resetting, by the player client, the timestamps for the start-streaming response file includes:


discarding, by the player client, the audio-video frames preceding the key frame in the key frame slice file, and resetting the timestamp for the key frame to an initial timestamp; and


assuming the original timestamp for the key frame is a reference value, resetting, by the player client, the timestamp for every audio-video frame succeeding the key frame to an adjusted timestamp, where the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.


Further, recording, by the server, key frame information in the audio-video stream includes:


based on the audio-video stream slice files and the corresponding sequence numbers, generating, by the server, a numbered list of key frame slice files.


Further, the slicing is physical slicing, and slicing, by the server, an audio-video stream into slices, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream further includes:


slicing, by the server, the audio-video stream according to a preset time interval to generate slice files; and


assigning, by the server, natural numbers as the sequence numbers of the generated slice files according to the timestamps.


Further, resetting, by the player client, the timestamps for the start-streaming response file further includes:


after receiving, by the player client, the start-streaming response file and resetting the timestamps,


continuing to request for the slice files succeeding the start-streaming response file from the server in the ascending order of the physical slice sequence numbers, resetting the timestamps, and decoding for playing.


Further, the slicing is logical slicing, and slicing by the server, an audio-video stream into slices, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream, further includes:


inserting, by the server, a header byte including a slice sequence number in the audio-video stream file according to a preset time interval; and


assigning, by the server, natural numbers as the sequence numbers of the generated slice files according to the timestamps.


Further, resetting, by the player client, the timestamps for the start-streaming response file further includes:


after receiving, by the player client, the start-streaming response file and resetting the timestamps,


continuing, by the server, to automatically transmit logic slices succeeding the start-streaming response file in the ascending order of the slice file sequence numbers; and


resetting, by the player client, the timestamps, and decoding for playing.


Further, the live streaming request sent by the player client includes a delay parameter; and


determining, by the server, an initial slice file sequence number in response to the live streaming request sent by the player client further includes:

    • calculating, by the server, an initial slice file sequence number based on the delay parameter in the live streaming request and the latest slice sequence number of the audio-video stream.


Another aspect of the present disclosure provides a live streaming quick start system, comprising:


a server including a slicing module and a transmitting module; and


a player client including a timestamp resetting module and a decoding and playing module, wherein:

    • the slicing module is configured to slice an audio-video stream into slice files, assign a sequence number to each generated slice file according to timestamps of the audio-video stream, record key frame information of the audio-video stream, determine an initial slice file sequence number in response to a live streaming request sent by the player client;
    • the transmitting module is configured to transmit a start-streaming response file and the initial slice file sequence number to the player client based on the initial slice file sequence number and the recorded audio-video stream key frame information;
    • the timestamp resetting module is configured to reset timestamps for the start-streaming response file based on a key frame closest to the initial slice file; and
    • the decoding and playing module is configured to decode and play the start-streaming response file having the timestamps reset.


Further, the transmitting module is further configured to:


determine a key frame slice file that has a sequence number closest to the initial slice file sequence number, wherein the key frame slice file is a slice file that contains a key frame and has a sequence number smaller than or equal to the sequence number of the initial slice file, and at the same time, the difference between the sequence number of the key frame slice file and the sequence number of the initial slice file is the minimum;


when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, transmit the start-streaming response file and the initial slice file sequence number to the player client, wherein the start-streaming response file includes the key frame slice file, intermediate slice files having the sequence numbers between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file; and


when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, transmit the start-streaming response file and the initial slice file sequence number to the player client, wherein the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.


Further, when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, the timestamp resetting module is further configured to:


discard the audio-video frames preceding the key frame in the key frame slice file, and reset the timestamps of the audio-video frames of the key frame and the succeeding key frame in the key frame slice file to an initial timestamp;


reset the timestamps for the audio-video frames in the intermediate slice files to the initial timestamp; and


assuming the original timestamp for the first frame in the initial slice file is a reference value, reset the timestamp for every frame in the initial slice file and the succeeding slice file to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.


Further, when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, the timestamp resetting module is further configured to:


discard the audio-video frames preceding the key frame in the key frame slice file, and reset the timestamp for the key frame to an initial timestamp; and


assuming the original timestamp for the first frame in the initial slice file is a reference value, reset the timestamp for every audio-video frame succeeding the key frame to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.


Further, the slicing module is further configured to generate a list of key frame slice file sequence numbers based on the audio-video stream slice files and the corresponding sequence numbers.


Further, when the slices are physically sliced, the slicing module is further configured to:


slice the audio-video stream according to a preset time interval and generate slice files accordingly; and


assign natural numbers as the sequence numbers of the generated slice files according to the timestamps.


Further, the player client further includes a request module configured to continue to request for the slice files succeeding the start-streaming response file from the server in the ascending order of the physical slice sequence numbers.


Further, when the slices are logically sliced, the slicing module is further configured to:


insert a header byte including a slice sequence number in the audio-video stream file according to a preset time interval; and


assign natural numbers as the sequence numbers of the generated slice files according to the timestamps.


Further, the transmitting module is further configured to continue to automatically transmit the logic slices succeeding the start-streaming response file in the ascending order of the slice sequence numbers.


Further, the live streaming request sent by the player client includes a delay parameter; and


the transmitting module is further configured to calculate an initial slice file sequence number based on the delay parameter in the live streaming request and the latest slice sequence number of the audio-video stream.


The technical solution provided by the embodiments of the present disclosure brings the following beneficial effect.


The timestamps of the start-streaming response file may be reset according to the sequence number of the key frame closest to the initial slice file. The key frame closest to the initial slice and the initial slice file may be combined to achieve the quick start effect. At the same time, the timestamps for all the audio-video frames between the key frame and the initial slice file may be reset to the initial timestamp, and may be rapidly skipped. Thus, the effect of not affecting the live streaming delay may be achieved.





BRIEF DESCRIPTION OF THE DRAWINGS

To more clearly illustrate the technical solution in the present disclosure, the accompanying drawings used in the description of the disclosed embodiments are briefly described hereinafter. Obviously, the drawings described below are merely some embodiments of the present disclosure. Other drawings may be derived from such drawings by a person with ordinary skill in the art without creative efforts.



FIG. 1 illustrates a flow chart of an exemplary live streaming quick start method according to Embodiment 1 of the present disclosure;



FIG. 2 illustrates a flow chart of exemplary detailed sub-steps for the step S104 according to Embodiment 1 of the present disclosure;



FIG. 3 illustrates a schematic diagram of an exemplary live streaming quick start system according to Embodiment 2 of the present disclosure; and



FIG. 4 illustrates a schematic diagram of another exemplary live streaming quick start system according to Embodiment 2 of the present disclosure.





DETAILED DESCRIPTION

The objectives, features, and advantages of the present disclosure will become clearer from the following description of the embodiments of the present disclosure when taken in conjunction with the accompanying drawings.


Embodiment 1

The present disclosure provides a live streaming quick start method. Referring to FIG. 1, the method may include the following steps.


Step S101: slicing, by the server, an audio-video stream into slice files, and assigning a sequence number to each generated slice file according to timestamps in the audio-video stream.


Specifically, the server may be a server that provides a live streaming service, or an intermediate server such as a node server in a content delivery network (CDN). The player client may be a player having live streaming function, such as Youku video player, Tencent video player, and other local players, or a webpage player. The audio-video stream may be the audio-video data that are transmitted from live stage to the server through network transmission.


In the embodiment, the server may physically slice the audio-video stream or may logically slice the audio-video stream.


In the embodiment, when the slices are sliced physically, the server may slice the audio-video stream according to a preset time interval and generate slice files accordingly.


Specifically, the preset time interval may be configured according to actual requirement. For example, the preset time interval may be 1 second or 2 seconds. When the preset time interval is 1 second, the server may slice the audio-video stream according to the 1 second time interval, and may generate a plurality of slice files having a 1-second length in time.


The server may assign a natural number as the sequence number to each slice file according to timestamps.


Specifically, assigning sequence numbers to the slice files may be intended to distinguish the order of the slice files, and may sequentially process the slice files in an ascending order. Because each slice file may include a large amount of audio-video frames, each audio-video frame may include a timestamp. In a single slice file, the audio-video frames may be arranged according to the order of the timestamps. Thus, based on the timestamp of the first audio-video frame in each slice file, the server may determine the sequential order of the each slice file and assign sequence numbers based on the sequential order. The sequence numbers may be natural numbers assigned based on the timestamps. For example, the slice file that has the smallest timestamp may be assigned with the sequence number 1, the slice file that has the second smallest timestamp may be assigned with the sequence number 2, and the slice file that has a larger timestamp may be assigned with a larger sequence number. The starting sequence number may also be a different natural number, e.g., 5.


It should be noted that other methods may also be used to assign sequence numbers. For example, an alphanumerical format A1, A2, A3 . . . A1 may correspond to the slice file having the smallest timestamp, A2 may correspond to the slice file having the second smallest timestamp, and subsequent sequence numbers may correspond to the slice files having the ascending timestamps. In other words, as long as a sequence number format contains a sequential order, the sequence number format may be used to assign sequence numbers to the slice files.


In the embodiment, when the slices are sliced logically, the server may insert a header byte containing a slice sequence number into the audio-video stream file according to a preset time interval. The slice sequence numbers may be natural numbers assigned according to the timestamps.


Specifically, similar to the physical slicing method, in the logical slicing method, natural numbers may be assigned as sequence numbers to the slice files in the ascending order of timestamps, and the sequence numbers may be inserted to the header byte in the slice files.


Step S102: recording, by the server, key frame information in the audio-video stream.


In the embodiment, the server may generate a sequence number list for the slice files that contain a key frame based on the audio-video stream slice files and the corresponding sequence numbers.


Specifically, the server may record the sequence numbers for the slice files that contain a key frame, and may generate the sequence number list for the slice files that contain a key frame according to a certain rule, e.g., in the ascending order of the sequence numbers. The sequence number list may be the data used later to determine the slice files that contain a key frame.


Step S103: determining, by the server, an initial slice file sequence number in response to a live streaming request sent by the player client.


In the embodiment, the live streaming request transmitted by the player client may include a delay parameter. Based on the delay parameter in the live streaming request and the sequence number of the latest slice of the audio-video stream, the server may calculate the initial slice file sequence number.


Specifically, the initial slice file may be the slice file corresponding to the timestamp when the player client starts live streaming. The latest slice may be the latest slice file generated by the server and having a largest timestamp. The delay parameter may be a delay configured for the player client for the live streaming. For example, the delay parameter may be 3 seconds. The player client may play from the timestamp that includes 3-second delay from the latest audio-video stream. In other words, the server may transmit the audio-video stream to the player client from the position that is 3 seconds prior to the latest audio-video stream timestamp. Any prior audio-video stream data may not be transmitted to the client.


For example, when the slice time interval is set to 1 second, the delay parameter is set to 5 seconds, and the latest slice sequence number is 20, the server may calculate and obtain that the delay parameter is equal to 5 time intervals. The initial slice file sequence number may be 5 sequence numbers prior to the latest slice sequence number, that is, the initial slice file sequence number may be 15.


Step S104: based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client.


Referring to FIG. 2, in the embodiment, the step S104 may include three sub-steps S1041-S1043.


Step S1041: determining, by the server, a key frame slice file that has a sequence number closest to the initial slice file sequence number, where the key frame slice file is a slice file that contains a key frame and has a sequence number smaller than or equal to the sequence number of the initial slice file, and at the same time, the difference between the sequence number of the key frame slice file and the sequence number of the initial slice file is the minimum.


Specifically, the initial slice file may not contain a key frame. When the initial slice file does not contain a key frame, the player client may not be able to play the initial slice file, and the black screen may appear until a key frame slice file is received. Thus, the server may need to determine the key frame slice file that has a sequence number closest to the sequence number of the initial slice file, and may transmit the audio-video stream to the player client starting from the key frame slice file sequence number.


Because the sequence number are natural numbers in the ascending order, and the initial slice file sequence number has been determined, the server may only search for a key frame slice file from the slice files preceding the sequence number of the initial slice file. In order to avoid increasing the live streaming delay, the key frame slice file must be closest to the sequence number of the initial slice file, thus, ensuring that the number of audio-video frames between the key frame and the initial slice file are kept to the minimum. In other words, the sequence number of the key frame slice file may be smaller than or equal to the sequence number of the initial slice file. At the same time, the difference between the sequence number of the key frame slice file and the sequence number of the initial slice file may be kept to the minimum. Through the key frame information which includes the sequence number of the key frame slice file, the server may calculate the sequence number difference to obtain the sequence number of the key frame slice file.


Step S1042: when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, where the start-streaming response file includes the key frame slice file, intermediate slice files having the sequence numbers between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file.


Specifically, when the initial slice file does not contain a key frame, the server may transmit the key frame slice file and the subsequent slice files to the player client. At this point, the start-streaming response file may include the key frame slice file, the intermediate slice file having the sequence number between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file.


Step S1043: when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, where the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.


Specifically, in terms of the initial slice file containing a key frame, in this case, the initial slice file may be a key frame slice file. The server may transmit the initial slice file and the subsequent slice files to the player client.


Step S105: resetting, by the player client, timestamps for the start-streaming response file based on a key frame closest to the initial slice file, and decoding and playing the start-streaming response file with the timestamps reset.


In the embodiment, this step may have two scenarios.


In the scenario where the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, resetting the timestamp for the start-streaming response file at the player client may include the following steps.


The player client may discard the audio-video frames preceding the key frame in the key frame slice file, and may reset the timestamp of the key frame and the audio-video frames succeeding the key frame in the key frame slice file to the initial timestamp. Specifically, because the audio-video frames preceding the key frame are useless to the live streaming, the audio-video frames preceding the key frame may be discarded. At the same time, because the player client may start the live streaming once the key frame is obtained, the audio-video frames succeeding the key frame may be useless too. Resetting the timestamp of the useless audio-video frames to the initial timestamp may allow rapid skipping of the useless audio-video frames, and the player client may rapidly play the first image frame on the display screen.


The player client may reset the timestamps for the audio-video frames in the intermediate slice file. Specifically, the player client may start live streaming from the position of the initial slice. Thus, the intermediate slice file may be useless, and may be rapidly skipped similarly by resetting the timestamp to the initial timestamp.


The timestamp of the first frame of the initial slice file may be set as the reference value. The player client may reset the timestamp for each frame in the initial slice file and subsequent slice files to an adjusted timestamp. The adjusted timestamp may be the original timestamp of the corresponding audio-video frame minus the reference value and plus the initial timestamp. Specifically, the player client may perform the live streaming based on the key frame and the initial slice file. To ensure the normal operation of the live streaming, the timestamps of the initial slice file may be reset. That is, the original timestamp for each audio-video frame in the initial slice file minus the original timestamp of the first frame in the initial slice file and plus the initial timestamp may be the reset timestamp for each frame in the initial slice file. For example, the initial timestamp may be 00:00:10. The original timestamp for the first frame in the initial slice file may be 10:05:50. The original timestamp for the 50th frame in the initial slice file may be 10:05:52. Then, the adjusted timestamp for the 50th frame may be 10:05:52 minus 10:05:50 and plus 00:00:10, that is, 00:00:12.


For the case where the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, resetting the timestamp for the start-streaming response file at the player client may include the following steps.


The player client may discard the audio-video frames preceding the key frame in the key frame slice file, and may reset the timestamp of the key frame to the initial timestamp.


The original timestamp of the key frame may be set as the reference value. The player client may reset the timestamp for each frame succeeding the key frame to an adjusted timestamp. The adjusted timestamp may be the original timestamp of the corresponding audio-video frame minus the reference value and plus the initial timestamp.


Specifically, when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, the player client may similarly discard the audio-video frames preceding the key frame in the initial slice file, and may reset the timestamp of the key frame and all audio-video frames succeeding the key frame.


It should be noted that the server may reset the timestamps of the start-streaming response file and the succeeding slice files. Similarly, the timestamp resetting may be divided into the two scenarios where the sequence number of the key frame slice file is smaller than or equal to the sequence number of the initial slice file, and the resetting content may be similar to the resetting content at the player client. After the timestamp resetting is completed at the server, the server may transmit the start-streaming response file and the succeeding slice files that have been reset to the player client. The player client may play the received files according to normal live streaming operation.


In the embodiment, when a physical slicing method is used, the player client may request the slice files succeeding the start-streaming response file from the server according to the ascending order of the physical slice sequence numbers.


In the embodiment, when a logical slicing method is used, the server may continue to automatically transmit the logical slices succeeding the start-streaming response file in the ascending order.


Specifically, the slice files succeeding the start-streaming response file may need the similar resetting of the timestamps to the adjusted timestamps. After the timestamp resetting is completed, the player client may decode and play the slice files according to the ascending order of the sequence numbers.


Embodiment 2

Referring to FIG. 3, the embodiment of the present disclosure provides a live streaming quick start system for executing the live streaming quick start method provided by Embodiment 1. The system may include a server and a player client. The server may include a slicing module and a transmitting module. The player client may include a timestamp resetting module and a decoding and playing module.


The slicing module may be used to slice the audio-video stream, and may assign sequence numbers to the generated slice files according to the timestamps in the audio-video stream. Further, the slicing module may be used to record the key frame information of the audio-video stream, and may determine the sequence number of the initial slice file according to the live streaming request sent by the player client.


The transmitting module may be used to transmit the start-streaming response file and the sequence number of the initial slice file to the player client according to the sequence number of the initial slice and the recorded key frame information of the audio-video stream.


The timestamp resetting module may be used to reset the timestamps of the start-streaming response file based on the key frame closest to the initial slice file sequence number.


The decoding and playing module may be used to decode and play the start-streaming response file that has the timestamps reset.


In the embodiment, the transmitting module may be used to perform the followings.


The transmitting module may determine a key frame slice file that has a sequence number closest to the initial slice file sequence number. The key frame slice file may be a slice file that contains a key frame and has a sequence number smaller than or equal to the sequence number of the initial slice file. At the same time, the difference between the sequence number of the key frame slice file and the sequence number of the initial slice file may be the minimum.


When the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, the transmitting module may transmit the start-streaming response file and the initial slice file sequence number to the player client, where the start-streaming response file includes the key frame slice file, an intermediate slice file having the sequence number between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file.


When the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, the transmitting module may transmit the start-streaming response file and the initial slice file sequence number to the player client, where the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.


In the embodiment, when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, the timestamp resetting module may perform the followings.


The timestamp resetting module may discard the audio-video frames preceding the key frame in the key frame slice file, and may reset the timestamp of the key frame and the audio-video frames succeeding the key frame to the initial timestamp.


The timestamp resetting module may reset the timestamp for the audio-video frames in the intermediate slice file to the initial timestamp.


The original timestamp of the first frame of the initial slice file may be set as the reference value. The timestamp resetting module may reset the timestamp for each frame in the initial slice file and subsequent slice files to an adjusted timestamp. The adjusted timestamp may be the original timestamp of the corresponding audio-video frame minus the reference value and plus the initial timestamp.


In the embodiment, when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, the timestamp resetting module may perform the followings.


The timestamp resetting module may discard the audio-video frames preceding the key frame in the key frame slice file, and may reset the timestamp of the key frame to the initial timestamp.


The original timestamp of the first frame of the initial slice file may be set as the reference value. The timestamp resetting module may reset the timestamp for each frame succeeding the key frame to an adjusted timestamp. The adjusted timestamp may be the original timestamp of the corresponding audio-video frame minus the reference value and plus the initial timestamp.


In the embodiment, the slicing module may be used to generate a key frame slice file sequence number list according to the slice files of the audio-video stream and the corresponding sequence numbers.


In the embodiment, when the slices are physically sliced, the slicing module may perform the followings.


The slicing module may slice the audio-video stream into slices according to a preset time interval and generate slice files accordingly.


The slicing module may assign natural numbers as the sequence numbers of the generated slice files according to the timestamps.


Referring to FIG. 4, in the embodiment, the player client may also include a request module, configured to continue to request the slice files succeeding the start-streaming response file from the server in the ascending order of the sequence numbers of the physical slices.


In the embodiment, when the slices are logically sliced, the slicing module may perform the followings.


The slicing module may insert a header byte containing a slice sequence number into the audio-video stream file according to a preset time interval. The slice sequence numbers may be natural numbers assigned according to the timestamps.


In the embodiment, the transmitting module may also be used to continue to automatically transmit the logical slices succeeding the start-streaming response file in the ascending order.


In the embodiment, the live streaming request sent by the player client may include a delay parameter.


The transmitting module may also be used to calculate a sequence number for the initial slice file according to the delay parameter in the live streaming request and the sequence number of the latest slice of the audio-video stream.


In the embodiment, the timestamps of the start-streaming response file may be reset according to the sequence number of the key frame closest to the initial slice file. The key frame closest to the initial slice and the initial slice file may be combined to achieve the quick start effect. At the same time, the timestamps for all the audio-video frames between the key frame and the initial slice file may be reset to the initial timestamp, and may be rapidly skipped. Thus, the effect of not affecting the live streaming delay may be achieved.


The sequence of the embodiments of the present disclosure are intended to be descriptive, and do not represent any preference.


The system embodiments described above are merely for illustrative purpose. The units described as separated parts may or may not be physically detached. The parts displayed as units may or may not be physical units, i.e., may be located at one place, or distributed at a plurality of network units. Based on the actual needs, a part or all of the modules may be selected to achieve the objective of the embodiments. Those ordinarily skilled in the art may understand and implement the disclosed embodiments without contributing creative labor.


Through the descriptions of various aforementioned embodiments, those skilled in the art may clearly understand that the embodiments may be implemented by means of software in conjunction with an essential common hardware platform, or may be simply implemented by hardware. Based on such understanding, the essential part of the aforementioned technical solutions or the part that contribute to the prior art may be embodied in the form of software products. The software products may be stored in computer readable storage media, such as ROM/RAM, magnetic disk, and optical disk, etc., and may include a plurality of instructions to enable a computer device (may be a personal computer, a server, or a network device) having one or more processors to execute the methods described in various embodiments or parts of the embodiments.


The foregoing are merely certain preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Without departing from the spirit and principles of the present disclosure, any modifications, equivalent substitutions, and improvements, etc. shall fall within the scope of the present disclosure.

Claims
  • 1. A live streaming quick start method, comprising: slicing, by a server, an audio-video stream into slice files, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream;recording, by the server, key frame information of the audio-video stream;determining, by the server, an initial slice file sequence number in response to a live streaming request sent by a player client;based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client; andresetting, by the player client, timestamps for the start-streaming response file based on a key frame closest to the initial slice file, and decoding and playing the start-streaming response file with the timestamps reset.
  • 2. The live streaming quick start method according to claim 1, wherein based on the initial slice file sequence number and the recorded audio-video stream key frame information, transmitting, by the server, a start-streaming response file and the initial slice file sequence number to the player client includes: determining, by the server, a key frame slice file that has a sequence number closest to the initial slice file sequence number, wherein the key frame slice file is a slice file that contains a key frame and has a sequence number smaller than or equal to the initial slice file sequence number, and at the same time, the difference between the sequence number of the key frame slice file and the initial slice file sequence number is the minimum;when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, wherein the start-streaming response file includes the key frame slice file, intermediate slice files having the sequence numbers between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file; andwhen the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, transmitting the start-streaming response file and the initial slice file sequence number by the server to the player client, wherein the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.
  • 3. The live streaming quick start method according to claim 2, wherein when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, resetting, by the player client, the timestamps for the start-streaming response file includes: discarding, by the player client, the audio-video frames preceding the key frame in the key frame slice file, and resetting the timestamps of the key frame and the audio-video frames succeeding the key frame in the key frame slice file to an initial timestamp;resetting, by the player client, the timestamps for the audio-video frames in the intermediate slice files to the initial timestamp; andassuming the original timestamp for the first frame in the initial slice file is a reference value, resetting, by the player client, the timestamp for every frame in the initial slice file and the succeeding slice file to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.
  • 4. The live streaming quick start method according to claim 2, wherein when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, resetting, by the player client, the timestamps for the start-streaming response file includes: discarding, by the player client, the audio-video frames preceding the key frame in the key frame slice file, and resetting the timestamp for the key frame to an initial timestamp; andassuming the original timestamp for the key frame is a reference value, resetting, by the player client, the timestamp for every audio-video frame succeeding the key frame to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.
  • 5. The live streaming quick start method according to claim 1, wherein recording, by the server, key frame information in the audio-video stream includes: based on the audio-video stream slice files and the corresponding sequence numbers, generating, by the server, a numbered list of key frame slice files.
  • 6. The live streaming quick start method according to claim 4, wherein the slicing is physical slicing, and slicing, by the server, an audio-video stream into slices, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream further includes: slicing, by the server, the audio-video stream according to a preset time interval to generate slice files; andassigning, by the server, natural numbers as the sequence numbers of the generated slice files according to the timestamps.
  • 7. The live streaming quick start method according to claim 6, wherein resetting, by the player client, the timestamps for the start-streaming response file further includes: after receiving, by the player client, the start-streaming response file and resetting the timestamps,continuing to request for the slice files succeeding the start-streaming response file from the server in the ascending order of the physical slice sequence numbers, resetting the timestamps, and decoding for playing.
  • 8. The live streaming quick start method according to claim 4, wherein the slicing is logical slicing, and slicing, by the server, an audio-video stream into slices, and assigning a sequence number to each generated slice file according to timestamps of the audio-video stream, further includes: inserting, by the server, a header byte including a slice sequence number in the audio-video stream file according to a preset time interval; andassigning, by the server, natural numbers as the sequence numbers of the generated slice files according to the timestamps.
  • 9. The live streaming quick start method according to claim 8, wherein resetting, by the player client, the timestamps for the start-streaming response file further includes: after receiving, by the player client, the start-streaming response file and resetting the timestamps,continuing, by the server, to automatically transmit logic slices succeeding the start-streaming response file in the ascending order of the slice file sequence numbers; andresetting, by the player client, the timestamps, and decoding for playing.
  • 10. The live streaming quick start method according to claim 1, wherein: the live streaming request sent by the player client includes a delay parameter; anddetermining, by the server, an initial slice file sequence number in response to the live streaming request sent by the player client further includes: calculating, by the server, an initial slice file sequence number based on the delay parameter in the live streaming request and the latest slice sequence number of the audio-video stream.
  • 11. A live streaming quick start system, comprising: a server including a slicing module and a transmitting module; anda player client including a timestamp resetting module and a decoding and playing module, wherein: the slicing module is configured to slice an audio-video stream into slice files, assign a sequence number to each generated slice file according to timestamps of the audio-video stream, record key frame information of the audio-video stream, determine an initial slice file sequence number in response to a live streaming request sent by the player client;the transmitting module is configured to transmit a start-streaming response file and the initial slice file sequence number to the player client based on the initial slice file sequence number and the recorded audio-video stream key frame information;the timestamp resetting module is configured to reset timestamps for the start-streaming response file based on a key frame closest to the initial slice file; andthe decoding and playing module is configured to decode and play the start-streaming response file having the timestamps reset.
  • 12. The live streaming quick start system according to claim 11, wherein the transmitting module is further configured to: determine a key frame slice file that has a sequence number closest to the initial slice file sequence number, wherein the key frame slice file is a slice file that contains a key frame and has a sequence number smaller than or equal to the sequence number of the initial slice file, and at the same time, the difference between the sequence number of the key frame slice file and the sequence number of the initial slice file is the minimum;when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, transmit the start-streaming response file and the initial slice file sequence number to the player client, wherein the start-streaming response file includes the key frame slice file, intermediate slice files having the sequence numbers between the sequence number of the key frame slice and the sequence number of the initial slice file, and the initial slice file; andwhen the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, transmit the start-streaming response file and the initial slice file sequence number to the player client, wherein the start-streaming response file includes the initial slice file, and the initial slice file is the key frame slice file.
  • 13. The live streaming quick start system according to claim 12, wherein when the sequence number of the key frame slice file is smaller than the sequence number of the initial slice file, the timestamp resetting module is further configured to: discard the audio-video frames preceding the key frame in the key frame slice file, and reset the timestamps of the key frame and the audio-video frames succeeding the key frame in the key frame slice file to an initial timestamp;reset the timestamps for the audio-video frames in the intermediate slice files to the initial timestamp; andassuming the original timestamp for the first frame in the initial slice file is a reference value, reset the timestamp for every frame in the initial slice file and the succeeding slice file to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.
  • 14. The live streaming quick start system according to claim 12, wherein when the sequence number of the key frame slice file is equal to the sequence number of the initial slice file, the timestamp resetting module is further configured to: discard the audio-video frames preceding the key frame in the key frame slice file, and reset the timestamp for the key frame to an initial timestamp; andassuming the original timestamp for the first frame in the initial slice file is a reference value, reset the timestamp for every audio-video frame succeeding the key frame to an adjusted timestamp, wherein the adjusted timestamp is the original timestamp for the corresponding audio-video frame minus the reference value and plus the initial timestamp.
  • 15. The live streaming quick start system according to claim 11, wherein: the slicing module is further configured to generate a list of key frame slice file sequence numbers based on the audio-video stream slice files and the corresponding sequence numbers.
  • 16. The live streaming quick start system according to claim 11, wherein when the slices are physically sliced, the slicing module is further configured to: slice the audio-video stream according to a preset time interval and generate slice files accordingly; andassign natural numbers as the sequence numbers of the generated slice files according to the timestamps.
  • 17. The live streaming quick start system according to claim 16, wherein the player client further includes a request module configured to continue to request for the slice files succeeding the start-streaming response file from the server in the ascending order of the physical slice sequence numbers.
  • 18. The live streaming quick start system according to claim 11, wherein when the slices are logically sliced, the slicing module is further configured to: insert a header byte including a slice sequence number in the audio-video stream file according to a preset time interval; andassign natural numbers as the sequence numbers of the generated slice files according to the timestamps.
  • 19. The live streaming quick start system according to claim 18, wherein the transmitting module is further configured to continue to automatically transmit the logic slices succeeding the start-streaming response file in the ascending order of the slice sequence numbers.
  • 20. The live streaming quick start system according to claim 11, wherein: the live streaming request sent by the player client includes a delay parameter; andthe transmitting module is further configured to calculate an initial slice file sequence number based on the delay parameter in the live streaming request and the latest slice sequence number of the audio-video stream.
Priority Claims (1)
Number Date Country Kind
201710464840.7 Jun 2017 CN national
PCT Information
Filing Document Filing Date Country Kind
PCT/CN2017/092824 7/13/2017 WO 00