WO2018232799A1 - 直播快速启播方法及系统 - Google Patents

直播快速启播方法及系统 Download PDF

Info

Publication number
WO2018232799A1
WO2018232799A1 PCT/CN2017/092824 CN2017092824W WO2018232799A1 WO 2018232799 A1 WO2018232799 A1 WO 2018232799A1 CN 2017092824 W CN2017092824 W CN 2017092824W WO 2018232799 A1 WO2018232799 A1 WO 2018232799A1
Authority
WO
WIPO (PCT)
Prior art keywords
slice
file
slice file
key frame
timestamp
Prior art date
Application number
PCT/CN2017/092824
Other languages
English (en)
French (fr)
Inventor
卢美辉
陈鸿
吕士表
Original Assignee
网宿科技股份有限公司
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 网宿科技股份有限公司 filed Critical 网宿科技股份有限公司
Priority to EP17849862.2A priority Critical patent/EP3448040A4/en
Priority to US15/741,936 priority patent/US10638192B2/en
Publication of WO2018232799A1 publication Critical patent/WO2018232799A1/zh

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/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/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/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/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4344Remultiplexing of multiplex streams, e.g. by modifying time stamps or remapping the packet identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • 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
    • 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/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Definitions

  • the present invention relates to the field of streaming media technologies, and in particular, to a live broadcast fast broadcast method and system.
  • the opening speed of the first screen is directly related to the user experience.
  • the first audio and video frame of 0 seconds must be a key frame, so for the on-demand, the network transmission is abandoned.
  • Decoding factor its first screen opening speed can be said to be open in real time.
  • the live broadcast user receives the stream file for playback at a random time, so the first audio and video frame when the user accesses may be intraframe code.
  • the frame I frame also known as the key frame, may also be an interframe predictive coded frame P frame, or a bidirectional predictive coded frame B frame. Since the player needs to have key frames to play when it starts, it will cause the following problems:
  • the player will have a black screen with a high probability when starting the broadcast, and if the GOP (Group Of Picture) of the live stream file is relatively large, the first audio and video frame received by the player is compared with the next key frame. Long, then the user needs to wait a certain amount of time before they can see the first screen.
  • GOP Group Of Picture
  • an embodiment of the present invention provides a live broadcast fast-starting method and system.
  • the technical solution is as follows:
  • a live broadcast quick start method including the following steps:
  • the server slices the audio and video stream, and numbers the generated slice file according to the time stamp of the audio and video stream;
  • the server records key frame information of the audio and video stream
  • the server sends a start response file and the start slice file number to the play end according to the start slice file number and the recorded audio and video stream key frame information;
  • the playing end performs timestamp reset on the initiating response file according to a key frame that is closest to the starting slice file number, and the playing end responds to the initiating response file after the time stamp is reset. Perform decoding playback.
  • step of the server sending the initiating response file and the starting slice file number to the playing end according to the starting slice file number and the key frame information of the recorded audio and video stream specifically includes:
  • a key frame slice file that is closest to the start slice file number, wherein the key frame slice file includes a key frame, and the number of the key frame slice file is less than or equal to the start slice file Numbering, at the same time, the difference between the number of the key frame slice file and the starting slice file number is the smallest;
  • the start response file includes a key frame slice file, a number of the key frame slice file, and the start slice file number.
  • An intermediate slice file, a start slice file, and the server sends the start response file and the start slice file number to the play end;
  • the start response file includes a start slice file, and the start slice file is the key frame slice file, and the server will The initiating response file and the starting slice file number are sent to the playing end.
  • the step of the time end resetting the response file by the playing end specifically includes:
  • the playing end discards the audio and video frames before the key frame in the key frame slice file, and resets the time stamp of the key frame and the audio and video frame after the key frame in the key frame slice file as the start time. stamp;
  • the playing end resets a timestamp of the audio and video frame in the intermediate slice file to the start timestamp
  • the first frame timestamp of the initial slice file is set as a reference value, and the play end resets each frame timestamp in the start slice file and the subsequent slice file to an adjustment timestamp, the adjustment
  • the timestamp is: the original timestamp of the corresponding audio and video frame minus the reference value, plus the start timestamp.
  • the step of performing time stamp reset on the response file by the playing end specifically includes:
  • the playing end discards the audio and video frames before the key frame in the key frame slice file, and resets the timestamp of the key frame as a start time stamp;
  • the original timestamp of the key frame is set as a reference value, and the playing end resets the timestamp of all audio and video frames after the key frame to an adjustment timestamp, where the adjustment timestamp is: corresponding audio and video frame
  • the original timestamp is subtracted from the reference value, plus the starting timestamp.
  • step of the server recording the key frame information of the audio and video stream is specifically:
  • the server generates a key frame slice file number list according to the audio and video stream slice file and its corresponding number.
  • the slice is a physical slice
  • the step of the server to slice the audio and video stream and number the generated slice file according to the timestamp of the audio and video stream specifically includes:
  • the server slices the audio and video stream according to a set time interval to generate a slice file
  • the server numbers the generated slice files by natural numbers based on time stamps.
  • the step of performing timestamp resetting on the response file by the playing end further includes: after receiving the initiating response file, and performing timestamp reset, the playing end is based on the physical slice number
  • the slicing file after the initiating response file is requested from the server in a small to large order, and time stamp reset and decoding play are performed.
  • the slice is a logical slice
  • the step of the server to slice the audio and video stream and number the generated slice file according to the time stamp of the audio and video stream includes:
  • the server inserts a header byte with a slice number in the audio and video stream file according to a set time interval; the slice number is numbered by a natural number based on a timestamp.
  • the step of performing timestamp resetting on the response file by the playing end further includes: after receiving the initiating response file, and performing timestamp resetting, the playing end
  • the server continues to automatically send the logical slice after the initiating response file in a descending order, and performs timestamp reset and decoding playback by the playing end.
  • the live broadcast request sent by the play end includes a delay parameter
  • the step of determining, by the server according to the live broadcast request sent by the playing end, the starting slice file number includes:
  • the server calculates the starting slice file number according to a delay parameter in the live broadcast request and a latest slice number of the audio and video stream.
  • a live broadcast fast broadcast system including a server and a play end, the server includes a slicing module and a sending module, and the play end includes a time stamp reset module and a decoding play module;
  • the sculpt module is configured to slice an audio and video stream, and number the generated slice file according to a timestamp of the audio and video stream, and record the key frame information of the audio and video stream, and according to the The live broadcast request sent by the playing end determines the starting slice file number;
  • the sending module is configured to send a start response file and the start slice file number to the play end according to the start slice file number and the recorded key video information of the audio and video stream;
  • the timestamp resetting module is configured to perform timestamp reset on the initiating response file according to the starting slice file number being closest to a key frame;
  • the decoding and playing module is configured to decode and play the initiating response file after the time stamp is reset.
  • the sending module is further configured to:
  • a key frame slice file closest to the start slice file number wherein the key frame slice file includes a key frame, and the number of the key frame slice file is less than or equal to the start slice file number, and The difference between the number of the key frame slice file and the starting slice file number is the smallest;
  • the start response file includes a key frame slice file, a number of the key frame slice file, and the start slice file number.
  • An intermediate slice file, a start slice file, and the sending module sends the start response file and the start slice file number to the play end;
  • the start response file includes a start slice file, where the start slice file is the key frame slice file, and the sending module The initiating response file and the starting slice file number are sent to the playing end.
  • the timestamp reset module is further configured to:
  • the original timestamp of the first frame of the initial slice file is set as a reference value, and each frame timestamp in the start slice file and the subsequent slice file is reset to an adjustment timestamp, and the adjustment timestamp is:
  • the original time stamp of the corresponding audio and video frame is subtracted from the reference value, and the start time stamp is added.
  • the timestamp reset module is further configured to:
  • the original timestamp of the key frame is set as a reference value, and the timestamp of all audio and video frames after the key frame is reset to an adjustment timestamp, and the adjustment timestamp is: the original timestamp of the corresponding audio and video frame is reduced. Go to the reference value, plus the start timestamp.
  • the slicing module is further configured to generate a key frame slice file number list according to the audio and video stream slice file and the corresponding number.
  • the slice is a physical slice
  • the slice module is further configured to:
  • the generated slice files are numbered by natural numbers based on the timestamp.
  • the playing end further includes a requesting module, configured to continue to request the slice file after the initiating response file from the server according to the physical slice number from small to large.
  • the slice is a logical slice
  • the slice module is further configured to:
  • a header byte with a slice number is inserted into the audio stream file according to a set time interval; the slice number is numbered by a natural number based on a timestamp.
  • the sending module is further configured to continue to automatically send the logical slice after the initiating response file in an order from small to large.
  • the live broadcast request sent by the play end includes a delay parameter
  • the sending module is further configured to calculate the starting slice file number according to a delay parameter in the live broadcast request and a latest slice number of the audio and video stream.
  • Timestamp the initiating response file by associating the starting slice file number closest to the keyframe Reset, combining the keyframe closest to the starting slice file with the starting slice file for fast start-up and resetting the timestamps of all audio and video frames between the keyframe and the starting slice file As a start timestamp, a quick skip is performed to achieve the effect of not affecting the live broadcast delay.
  • Embodiment 1 is a flow chart of steps of a live broadcast fast start method according to Embodiment 1 of the present invention
  • step S104 is a flowchart of detailed sub-steps of step S104 according to Embodiment 1 of the present invention.
  • FIG. 3 is a schematic diagram of a live broadcast fast broadcast system according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic diagram of another live broadcast quick start system according to Embodiment 2 of the present invention.
  • An embodiment of the present invention provides a method for quickly starting a live broadcast. Referring to FIG. 1, the method includes the following steps:
  • S101 The server slices the audio and video stream, and numbers the generated slice file according to the timestamp of the audio and video stream.
  • the server may be a server that provides a live broadcast service, or a server that performs broadcast, such as a CDN (Content Delivery Network) node server.
  • the above-mentioned playing end refers to a player with a live broadcast function, such as a local player such as Youku video player or Tencent video player, or a web player.
  • the above audio and video stream refers to audio and video data transmitted from the live broadcast site to the server through the network.
  • the manner in which the server slices the audio and video streams may be a physical slice or a logical slice.
  • the server when the physical slice mode is adopted, the server is configured according to the set time interval.
  • the audio and video streams are sliced to generate a slice file.
  • the set time interval may be set as needed, for example, the set time interval is 1 second or 2 seconds.
  • the server performs the audio and video stream according to the length of 1 second. Slice, and then generate a plurality of slice files with a length of 1 second.
  • the server numbers the generated slice files by natural numbers based on time stamps.
  • the slice files are numbered in order to distinguish the order of the slice files, and the slice files are processed in order. Since each slice file contains a large number of audio and video frames, each audio and video frame has a built-in time stamp, and in a single slice file, these audio and video frames are arranged in order of time stamp size, so
  • the timestamp of the first audio and video frame of each slice file determines the order of each slice file and is numbered according to the sequence.
  • the numbering rule is numbered by natural numbers based on the timestamp, for example, the timestamp is minimized.
  • the slice file number is 1, and the second time slice file number is 2, and the number increases as the time stamp of the slice file increases.
  • the starting number can be other numbers, for example starting from 5.
  • the number can also be numbered according to other methods, for example, the letters and numbers are in the manner of A1, A2, A3, ..., A1 corresponds to the slice file with the smallest timestamp, and A2 corresponds to the second smallest time slice file, and the subsequent numbers are sequentially A slice file whose time stamp is gradually increased. That is to say, the slice files can be numbered as long as there is a sequential numbering method.
  • the server when the logical slice mode is adopted, the server inserts a header byte with a slice number in the audio and video stream file according to a set time interval; the slice number is based on a timestamp. Natural numbers are numbered.
  • the numbering mode is similar to that of the physical slice, and the slice files are numbered in natural order according to the timestamp from the smallest to the largest, and these numbers are inserted into the header bytes of the slice file.
  • the server records key frame information of the audio and video stream.
  • the server generates a key frame slice file number list according to the audio and video stream slice file and its corresponding number.
  • the server records the slice file number including the key frame, and generates a key frame slice file number list according to a certain rule, for example, in descending order of numbers, as data for subsequent determination of the key frame slice file.
  • S103 The server determines a starting slice file number according to a live broadcast request sent by the playing end.
  • the live broadcast request sent by the play end includes a delay parameter, and the server And calculating the starting slice file number according to the delay parameter in the live broadcast request and the latest slice number of the audio and video stream.
  • the start slice file refers to the slice file corresponding to the timestamp when the player starts to broadcast
  • the latest slice refers to the latest slice file generated by the server
  • the timestamp is the largest
  • the delay parameter refers to the broadcast of the broadcast end.
  • the delay for example, the delay parameter is 3 seconds
  • the player will play the timestamp position from the delay of the latest audio and video stream for 3 seconds, that is, the server sends the tone from the position 3 seconds before the latest audio and video stream timestamp.
  • the video is streamed to the player, and the other audio and video stream data is no longer sent to the client.
  • the server calculates the delay parameter as 5 set time intervals, and the starting slice file number is the latest slice number. 5 numbers, ie the starting slice file number is 15.
  • S104 The server sends a start response file and the start slice file number to the play end according to the start slice file number and the recorded audio and video stream key frame information.
  • the step specifically includes three sub-steps of S1041-S1043:
  • the server determines a key frame slice file that is closest to the start slice file number, wherein the key frame slice file includes a key frame, and the number of the key frame slice file is less than or equal to the start The file number is sliced while the difference between the number of the key frame slice file and the start slice file number is the smallest.
  • the server needs to determine The key frame slice file closest to the start slice file number starts to send the audio and video stream to the play end from the key frame slice file number.
  • the server can only find key frames from the slice file before the start slice file number, and in order not to increase the live broadcast delay, the key frame distance is started.
  • the slice file is recently, and thus the audio and video frames between the key frame and the initial slice file are minimized, and the number of the key frame slice file is required to be less than or equal to the start slice file number, and the key frame slice is The difference between the file number and the starting slice file number is the smallest.
  • the server calculates the number of the key frame slice file by calculating the number of the slice file containing the key frame included in the key frame information.
  • the launch response file includes a key frame slice file, an intermediate slice file numbered between the number of the key frame slice file and the start slice file number, a start slice file, and the server will respond to the launch The file and the starting slice file number are sent to the play end.
  • the server needs to send the key frame slice file and the subsequent slice file to the play end.
  • the start response file includes the key frame slice file, and the number is in the An intermediate slice file and a start slice file between the number of the key frame slice file and the start slice file number.
  • the initiation response file includes a start slice file, where the start slice file is the key frame slice file, the server Sending the initiating response file and the starting slice file number to the playing end.
  • the start slice file is the key frame slice file, and the server sends the start slice file and the subsequent slice file to the play end.
  • S105 The playing end performs a timestamp reset on the initiating response file according to a key frame that is closest to the starting slice file number, and the playing end performs the invoicing after the timestamp is reset.
  • the response file is decoded and played.
  • the step of the time end resetting the response file by the play end specifically includes:
  • the playing end discards the audio and video frames before the key frame in the key frame slice file, and resets the time stamp of the key frame and the audio and video frame after the key frame in the key frame slice file as the start time.
  • the audio and video frames before the key frame are meaningless to the live broadcast, they need to be discarded.
  • the broadcast terminal can obtain the key frame, the live video can be broadcasted. Therefore, the audio and video frames after the key frame in the key frame slice file It doesn't make sense.
  • the skip is quickly skipped, and the playback terminal can quickly play the first screen.
  • the playing end resets the timestamp of the audio and video frame in the intermediate slice file to the starting timestamp; specifically, the playing end needs to start broadcasting from the position of the starting slice file, so these intermediate slice files It also makes no sense to do a quick skip by resetting its timestamp to the start timestamp.
  • the first frame timestamp of the initial slice file is set as a reference value, and the play end resets each frame timestamp in the start slice file and the subsequent slice file to an adjustment timestamp, the adjustment Time
  • the stamp is: the original time stamp of the corresponding audio and video frame minus the reference value, plus the start time stamp.
  • the playing end can perform live broadcast according to the key frame and the starting slice file.
  • the time stamp of the starting slice file also needs to be reset, that is, the original of each audio and video frame in the starting slice file.
  • the timestamp minus the first frame original timestamp of the starting slice file, plus the start timestamp is the timestamp after the start of the slice file.
  • the start timestamp is 00:00:10
  • the original frame timestamp of the first slice file is 10:05:50
  • the original timestamp of the fiftieth frame of the start slice file is 10:05:52
  • the adjustment timestamp of the fifty-th frame of the starting slice file is 10:05:52 minus 10:05:50, plus 00:00:10, ie 00:00:12.
  • the step of the time end resetting the response file by the play end specifically includes:
  • the playing end discards the audio and video frames before the key frame in the key frame slice file, and resets the timestamp of the key frame as a start time stamp;
  • the original timestamp of the key frame is set as a reference value, and the playing end resets the timestamp of all audio and video frames after the key frame to an adjustment timestamp, where the adjustment timestamp is: corresponding audio and video frame
  • the original timestamp is subtracted from the reference value, plus the starting timestamp.
  • the playing end when the number of the key frame slicing file is equal to the starting slice file number, the playing end also needs to discard the audio and video frames before the key frame in the starting slice file, and all the key frames and all subsequent thereto. Audio and video frames reset the timestamp.
  • the server can also perform timestamp reset on the initiation response file and subsequent slice files, and the reset is equally divided into the key frame slice file whose number is less than or equal to the start slice file. Numbered case, and its reset content is similar to the reset content of the player.
  • the server sends the reset start response file and the subsequent slice file to the play end, and the play end follows Live broadcast can be performed by regular live broadcast.
  • the playing end continues to request the slice file after the initiating response file to the server according to the physical slice number from small to large.
  • the server continues to automatically send the logical slice after the initiating response file in ascending order.
  • the slice file after the response file is started it is also necessary to reset its time stamp to the adjustment time stamp. After the timestamp is set, the player will decode and play the slice file in order from the smallest to the largest.
  • an embodiment of the present invention provides a live broadcast fast-starting system, which can perform the live broadcast fast-starting method provided in the first embodiment, including a server and a play end, where the server includes a slicing module and a sending module, The playing end includes a time stamp reset module and a decoding play module;
  • the sculpt module is configured to slice an audio and video stream, and number the generated slice file according to a timestamp of the audio and video stream, and record the key frame information of the audio and video stream, and according to the The live broadcast request sent by the playing end determines the starting slice file number;
  • the sending module is configured to send a start response file and the start slice file number to the play end according to the start slice file number and the recorded key video information of the audio and video stream;
  • the timestamp resetting module is configured to perform timestamp reset on the initiating response file according to the starting slice file number being closest to a key frame;
  • the decoding and playing module is configured to decode and play the initiating response file after the time stamp is reset.
  • the sending module is further configured to:
  • a key frame slice file closest to the start slice file number wherein the key frame slice file includes a key frame, and the number of the key frame slice file is less than or equal to the start slice file number, and The difference between the number of the key frame slice file and the starting slice file number is the smallest;
  • the start response file includes a key frame slice file, a number of the key frame slice file, and the start slice file number.
  • An intermediate slice file, a start slice file, and the sending module sends the start response file and the start slice file number to the play end;
  • the initiation response file includes a start slice file, and the start slice file is the key frame slice file, and the sending module will The initiating response file and the starting slice file number are sent to the playing end.
  • the timestamp reset module is further configured to:
  • the original timestamp of the first frame of the initial slice file is set as a reference value, and each frame timestamp in the start slice file and the subsequent slice file is reset to an adjustment timestamp, and the adjustment timestamp is:
  • the original time stamp of the corresponding audio and video frame is subtracted from the reference value, and the start time stamp is added.
  • the timestamp reset module is further configured to:
  • the original timestamp of the key frame is set as a reference value, and the timestamp of all audio and video frames after the key frame is reset to an adjustment timestamp, and the adjustment timestamp is: the original timestamp of the corresponding audio and video frame is reduced. Go to the reference value, plus the start timestamp.
  • the slicing module is further configured to generate a key frame slice file number list according to the audio and video stream slice file and its corresponding number.
  • the slice is a physical slice
  • the slice module is further configured to:
  • the generated slice files are numbered by natural numbers based on the timestamp.
  • the playing end further includes a requesting module, configured to continue to request the slice file after the initiating response file from the server according to the physical slice number from small to large.
  • the slice is a logical slice
  • the slice module is further configured to:
  • a header byte with a slice number is inserted into the audio stream file according to a set time interval; the slice number is numbered by a natural number based on a timestamp.
  • the sending module is further configured to continue to automatically send the logical slice after the initiating response file in an order from small to large.
  • the live broadcast request sent by the playing end includes a delay parameter
  • the sending module is further configured to calculate the starting slice file number according to a delay parameter in the live broadcast request and a latest slice number of the audio and video stream.
  • the start-up response file is time-stamp-resetd based on the start slice file number closest to the key frame, and the key frame closest to the start slice file is combined with the start slice file.
  • the effect of fast start-up is achieved, and the time stamp of all audio and video frames between the key frame and the starting slice file is reset to the start time stamp, and the fast skip is performed, which achieves the effect of not affecting the live broadcast delay.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Television Signal Processing For Recording (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种直播快速启播方法及系统,属于流媒体技术领域。其中,该方法包括如下步骤:服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号;所述服务器记录所述音视频流关键帧信息;所述服务器根据播放端发送的直播请求确定起始切片文件编号;所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;所述播放端以与所述起始切片文件编号最接近的关键帧为依据对所述启播响应文件进行时间戳重置,所述播放端对时间戳重置后的所述启播响应文件进行解码播放。本发明能够达到快速启播的效果,又不影响直播延迟。

Description

直播快速启播方法及系统 技术领域
本发明涉及流媒体技术领域,尤其涉及一种直播快速启播方法及系统。
背景技术
在直播中,首屏打开速度直接关系到用户体验。以点播为例,由于点播用户的接入都是从0秒开始,而任何一个点播文件,其0秒的第一个音视频帧一定是关键帧,因而对于点播而言,抛开网络传输、解码因素,其首屏打开速度可以说是实时打开。
然而,对于直播来讲,由于直播文件往往是流文件,直播用户都是在一个随机的时间点接到这个流文件进行播放,因而用户接入时的第一个音视频帧可能是帧内编码帧I帧,又称关键帧,也有可能是帧间预测编码帧P帧,也有可能是双向预测编码帧B帧。由于播放器启播时需要有关键帧才能够进行播放,因而会带来以下问题:
1)播放器在启播时会大概率出现黑屏,并且,如果直播流文件的GOP(Group Of Picture,图像组)比较大,播放器接收的第一个音视频帧离下一个关键帧还比较长,那么用户需要等待一定时间才可以看到首屏。
2)如果服务器从上一个关键帧的位置开始发送数据,那么会额外增加直播延迟,从而降低用户体验。
发明内容
为了解决现有技术的问题,本发明实施例提供了一种直播快速启播方法及系统。所述技术方案如下:
一方面,提供了一种直播快速启播方法,包括如下步骤:
服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号;
所述服务器记录所述音视频流关键帧信息;
所述服务器根据播放端发送的直播请求确定起始切片文件编号;
所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;
所述播放端以与所述起始切片文件编号最接近的关键帧为依据对所述启播响应文件进行时间戳重置,所述播放端对时间戳重置后的所述启播响应文件进行解码播放。
进一步的,所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端的步骤具体包括:
所述服务器确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小;
当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述服务器将所述启播响应文件以及所述起始切片文件编号发送至所述播放端;
当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述服务器将所述启播响应文件及所述起始切片文件编号发送至所述播放端。
进一步的,当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述播放端对所述响应文件进行时间戳重置的步骤具体包括:
所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;
所述播放端将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;
所述起始切片文件的第一帧原时间戳设为基准值,所述播放端将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
进一步的,当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述播放端对所述响应文件进行时间戳重置的步骤具体包括:
所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
所述关键帧的原时间戳设为基准值,所述播放端将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
进一步的,所述服务器记录所述音视频流关键帧信息的步骤具体为:
所述服务器根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
进一步的,所述切片为物理切片,所述服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号的步骤具体包括:
所述服务器根据设定时间间隔对所述音视频流进行切片,生成切片文件;
所述服务器对生成的切片文件以时间戳为依据用自然数进行编号。
进一步的,所述播放端对所述响应文件进行时间戳重置的步骤还包括:所述播放端在接收到所述启播响应文件,并进行时间戳重置后,依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件,并进行时间戳重置和解码播放。进一步的,所述切片为逻辑切片,所述服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号的步骤具体包括:
所述服务器根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
进一步的,
所述播放端对所述响应文件进行时间戳重置的步骤还包括:所述播放端在接收到所述启播响应文件,并进行时间戳重置后,
所述服务器继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片,并由播放端进行时间戳重置和解码播放。
进一步的,所述播放端发送的直播请求包括延迟参数;
所述服务器根据播放端发送的直播请求确定起始切片文件编号的步骤具体包括:
所述服务器根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
另一方面,提供了一种直播快速启播系统,包括服务器和播放端,所述服务器包括切片模块和发送模块,所述播放端包括时间戳重置模块和解码播放模块;
所述切片模块,用于对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号,以及,用于记录所述音视频流关键帧信息,并根据所述播放端发送的直播请求确定起始切片文件编号;
所述发送模块,用于根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;
所述时间戳重置模块,用于以所述起始切片文件编号最接近关键帧为依据对所述启播响应文件进行时间戳重置;
所述解码播放模块,用于对时间戳重置后的所述启播响应文件进行解码播放。
进一步的,所述发送模块还用于:
确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小;
当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述发送模块将所述启播响应文件以及所述起始切片文件编号发送至所述播放端;
当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述发送模块所述启播响应文件及所述起始切片文件编号发送至所述播放端。
进一步的,当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述时间戳重置模块还用于:
将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关 键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;
将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;
所述起始切片文件的第一帧原时间戳设为基准值,将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
进一步的,当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述时间戳重置模块还用于:
将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
所述关键帧的原时间戳设为基准值,将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
进一步的,所述切片模块还用于根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
进一步的,所述切片为物理切片,所述切片模块还用于:
根据设定时间间隔对所述音视频流进行切片,生成切片文件;
对生成的切片文件以时间戳为依据用自然数进行编号。
进一步的,所述播放端还包括请求模块,用于依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件。
进一步的,所述切片为逻辑切片,所述切片模块还用于:
根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
进一步的,所述发送模块,还用于继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片。
进一步的,所述播放端发送的直播请求包括延迟参数;
所述发送模块还用于根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
本发明实施例提供的技术方案带来的有益效果是:
通过以起始切片文件编号最接近关键帧为依据对启播响应文件进行时间戳 重置,将最接近起始切片文件的关键帧和起始切片文件结合起来,达到了快速启播的效果,同时将关键帧至起始切片文件之间的所有音视频帧的时间戳重置为起始时间戳,进行快速跳过,达到了不影响直播延迟的效果。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例一提供的一种直播快速启播方法步骤流程图;
图2是本发明实施例一提供的步骤S104的详细子步骤流程图;
图3是本发明实施例二提供的一种直播快速启播系统示意图;
图4是本发明实施例二提供的另一种直播快速启播系统示意图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
实施例一
本发明实施例提供了一种直播快速启播方法,参见图1,包括如下步骤:
S101:服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号。
具体而言,上述服务器可以是提供直播服务的服务器,也可以是进行转播的服务器,例如CDN(Content Delivery Network,内容分发网络)节点服务器。上述播放端是指具备直播功能的播放器,例如优酷视频播放器、腾讯视频播放器等本地播放器,也可以是网页播放器。上述音视频流是指从直播现场通过网络传输至服务器的音视频数据。
在本实施例中,服务器对音视频流进行切片的方式可以是物理切片,也可以是逻辑切片。
在本实施例中,采用物理切片的方式时,所述服务器根据设定时间间隔对 所述音视频流进行切片,生成切片文件。
具体而言,上述设定时间间隔可以根据需要进行设置,例如设定时间间隔为1秒或者2秒,当设定时间间隔为1秒时,服务器将按照1秒的时间长度对音视频流进行切片,进而生成多个时间长度为1秒的切片文件。
所述服务器对生成的切片文件以时间戳为依据用自然数进行编号。
具体而言,对切片文件进行编号是为了区分切片文件的先后顺序,并按照先后顺序依次处理这些切片文件。由于在每个切片文件中包含有大量的音视频帧,每个音视频帧均内置有时间戳,并且在单个切片文件中这些音视频帧是按照时间戳的大小顺序进行排列的,因此可以根据每个切片文件的第一个音视频帧的时间戳,判断出各个切片文件的先后顺序,并根据先后顺序进行编号,编号规则是以时间戳为依据用自然数进行编号,例如将时间戳最小的切片文件编号为1,时间戳第二小的切片文件编号为2,随切片文件的时间戳增大其编号同样增大。当然起始编号可以是其他数字,例如从5开始。
需要说明的是,还可以按照其他方式进行编号,例如字母加数字的方式A1、A2、A3……,A1对应时间戳最小的切片文件,A2对应时间戳第二小的切片文件,后续编号依次对应时间戳逐渐增大的切片文件。也就是说,只要存在先后顺序的编号方式均可以对切片文件进行编号。
在本实施例中,采用逻辑切片的方式时,所述服务器根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
具体而言,编号方式同物理切片的编号方式类似,按照时间戳从小到大的顺序对切片文件进行自然数编号,并将这些编号插入切片文件的头部字节中。
S102:所述服务器记录所述音视频流关键帧信息。
在本实施例中,所述服务器根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
具体而言,服务器记录包含有关键帧的切片文件编号,并按照一定的规则,例如按照编号从小到大的顺序,生成关键帧切片文件编号列表,作为后续判断关键帧切片文件的数据。
S103:所述服务器根据播放端发送的直播请求确定起始切片文件编号。
在本实施例中,所述播放端发送的直播请求中包括延迟参数,所述服务器 根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
具体而言,起始切片文件是指播放器开始直播时的时间戳所对应的切片文件,最新切片是指服务器生成的最新切片文件,其时间戳最大,延迟参数是指播放端进行直播的设定延迟,例如延迟参数为3秒,则播放端将从延迟最新音视频流的时间3秒的时间戳位置进行播放,也就是说,服务器从最新音视频流时间戳前3秒的位置发送音视频流至播放端,对于其他的音视频流数据则不再发送至客户端。
例如,当切片时的设定时间间隔为1秒,延迟参数为5秒,最新切片编号为20时,服务器计算得到延迟参数为5个设定时间间隔,则起始切片文件编号距离最新切片编号5个编号,即起始切片文件编号为15。
S104:所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端。
参见图2,在本实施例中,本步骤具体包括S1041-S1043三个子步骤:
S1041:所述服务器确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小。
具体而言,由于起始切片文件不一定存在关键帧,当起始切片文件不存在关键帧时,播放端将无法播放起始切片文件,出现黑屏,直到接收到关键帧,因此,服务器需要确定与所述起始切片文件编号最接近的关键帧切片文件,从关键帧切片文件编号开始发送音视频流至播放端。
由于编号按照自然数从小到大的顺序,并且起始切片文件编号已经确定,服务器只能从起始切片文件编号之前的切片文件中寻找关键帧,并且为了不增加直播延迟,该关键帧距离起始切片文件最近,进而保证该关键帧与起始切片文件之间的音视频帧最少,也就需要满足所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小。服务器通过上述关键帧信息中包含的含有关键帧的切片文件编号,经过编号差值计算,得到关键帧切片文件的编号。
S1042:当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述 启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述服务器将所述启播响应文件以及所述起始切片文件编号发送至所述播放端。
具体而言,对于起始切片文件不包含关键帧的情况,服务器需要将关键帧切片文件及其之后的切片文件发送至播放端,此时,启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件。
S1043:当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述服务器将所述启播响应文件及所述起始切片文件编号发送至所述播放端。
具体而言,对于起始切片文件包含关键帧的情况,此时,所述起始切片文件即所述关键帧切片文件,服务器将起始切片文件及其之后的切片文件发送至播放端。
S105:所述播放端以与所述起始切片文件编号最接近的关键帧为依据对所述启播响应文件进行时间戳重置,所述播放端对时间戳重置后的所述启播响应文件进行解码播放。
在本实施例中,本步骤存在两种情况。
对于所述关键帧切片文件的编号小于所述起始切片文件编号的情况,所述播放端对所述响应文件进行时间戳重置的步骤具体包括:
所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;具体而言,由于关键帧之前的音视频帧对直播无意义,因此需要丢弃,同时,由于播放端得到关键帧即能够进行直播,因此,关键帧切片文件中关键帧之后的音视频帧也没有意义。通过将上述无意义的音视频帧的时间戳重置为起始时间戳,从而快速跳过,实现播放端快速播放首屏。
所述播放端将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;具体而言,播放端需要从起始切片文件的位置开始直播,因此这些中间切片文件同样没有意义,通过重置其时间戳为起始时间戳,同样进行快速跳过。
所述起始切片文件的第一帧原时间戳设为基准值,所述播放端将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间 戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。具体而言,播放端根据关键帧和起始切片文件即可进行直播,为了保证直播的正常,起始切片文件的时间戳也需要重置,即起始切片文件中每一个音视频帧的原时间戳减去起始切片文件的第一帧原时间戳,再加上所述起始时间戳,即为起始切片文件重置后的时间戳。例如,起始时间戳为00:00:10,起始切片文件的第一帧原时间戳为10:05:50,起始切片文件的第五十帧原时间戳为10:05:52,则起始切片文件的第五十帧的调整时间戳为10:05:52减去10:05:50,再加上00:00:10,即00:00:12。
对于所述关键帧切片文件的编号等于所述起始切片文件编号的情况,所述播放端对所述响应文件进行时间戳重置的步骤具体包括:
所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
所述关键帧的原时间戳设为基准值,所述播放端将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
具体而言,当所述关键帧切片文件的编号等于所述起始切片文件编号时,播放端同样需要丢弃起始切片文件中关键帧之前的音视频帧,并对关键帧及其之后的所有音视频帧重置时间戳。
需要说明的是,服务器也能够对所述启播响应文件和其之后的切片文件进行时间戳重置,其重置同样分为所述关键帧切片文件的编号小于或者等于所述起始切片文件编号的情况,并且其重置内容和播放端重置内容类似,待服务器时间戳重置完成后,服务器将重置后的启播响应文件和其之后的切片文件发送至播放端,播放端按照常规直播方式即可进行直播。
在本实施例中,对于物理切片的方式,所述播放端依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件。
在本实施例中,对于逻辑切片的方式,所述服务器继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片。
具体而言,对于启播响应文件之后的切片文件,同样需要对其时间戳重置为调整时间戳。待时间戳设置完成后,播放端将按照编号从小到大的顺序依次对切片文件进行解码播放。
实施例二
参见图3,本发明实施例提供了一种直播快速启播系统,可以执行实施例一中提供的直播快速启播方法,包括服务器和播放端,所述服务器包括切片模块和发送模块,所述播放端包括时间戳重置模块和解码播放模块;
所述切片模块,用于对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号,以及,用于记录所述音视频流关键帧信息,并根据所述播放端发送的直播请求确定起始切片文件编号;
所述发送模块,用于根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;
所述时间戳重置模块,用于以所述起始切片文件编号最接近关键帧为依据对所述启播响应文件进行时间戳重置;
所述解码播放模块,用于对时间戳重置后的所述启播响应文件进行解码播放。
在本实施例中,所述发送模块还用于:
确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小;
当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述发送模块将所述启播响应文件以及所述起始切片文件编号发送至所述播放端;
当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述发送模块将所述启播响应文件以及所述起始切片文件编号发送至所述播放端。
在本实施例中,当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述时间戳重置模块还用于:
将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;
将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;
所述起始切片文件的第一帧原时间戳设为基准值,将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
在本实施例中,当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述时间戳重置模块还用于:
将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
所述关键帧的原时间戳设为基准值,将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
在本实施例中,所述切片模块还用于根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
在本实施例中,所述切片为物理切片,所述切片模块还用于:
根据设定时间间隔对所述音视频流进行切片,生成切片文件;
对生成的切片文件以时间戳为依据用自然数进行编号。
参见图4,在本实施例中,所述播放端还包括请求模块,用于依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件。
在本实施例中,所述切片为逻辑切片,所述切片模块还用于:
根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
在本实施例中,所述发送模块,还用于继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片。
在本实施例中,所述播放端发送的直播请求包括延迟参数;
所述发送模块还用于根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
本发明实施例通过以起始切片文件编号最接近关键帧为依据对启播响应文件进行时间戳重置,将最接近起始切片文件的关键帧和起始切片文件结合起来, 达到了快速启播的效果,同时将关键帧至起始切片文件之间的所有音视频帧的时间戳重置为起始时间戳,进行快速跳过,达到了不影响直播延迟的效果。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (20)

  1. 一种直播快速启播方法,其特征在于,包括如下步骤:
    服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号;
    所述服务器记录所述音视频流关键帧信息;
    所述服务器根据播放端发送的直播请求确定起始切片文件编号;
    所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;
    所述播放端以与所述起始切片文件编号最接近的关键帧为依据对所述启播响应文件进行时间戳重置,所述播放端对时间戳重置后的所述启播响应文件进行解码播放。
  2. 根据权利要求1所述的直播快速启播方法,其特征在于,所述服务器根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端的步骤具体包括:
    所述服务器确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小;
    当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述服务器将所述启播响应文件以及所述起始切片文件编号发送至所述播放端;
    当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述服务器将所述启播响应文件及所述起始切片文件编号发送至所述播放端。
  3. 根据权利要求2所述的直播快速启播方法,其特征在于,当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述播放端对所述响应文件进 行时间戳重置的步骤具体包括:
    所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;
    所述播放端将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;
    所述起始切片文件的第一帧原时间戳设为基准值,所述播放端将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
  4. 根据权利要求2所述的直播快速启播方法,其特征在于,当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述播放端对所述响应文件进行时间戳重置的步骤具体包括:
    所述播放端将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
    所述关键帧的原时间戳设为基准值,所述播放端将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
  5. 根据权利要求1所述的直播快速启播方法,其特征在于,所述服务器记录所述音视频流关键帧信息的步骤具体为:
    所述服务器根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
  6. 根据权利要求4所述的直播快速启播方法,其特征在于,所述切片为物理切片,所述服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号的步骤具体包括:
    所述服务器根据设定时间间隔对所述音视频流进行切片,生成切片文件;
    所述服务器对生成的切片文件以时间戳为依据用自然数进行编号。
  7. 根据权利要求6所述的直播快速启播方法,其特征在于,所述播放端对所述响应文件进行时间戳重置的步骤还包括:所述播放端在接收到所述启播响应文件,并进行时间戳重置后,依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件,并进行时间戳重置和解码播放。
  8. 根据权利要求4所述的直播快速启播方法,其特征在于,所述切片为逻辑切片,所述服务器对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号的步骤具体包括:
    所述服务器根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
  9. 根据权利要求8所述的直播快速启播方法,其特征在于,所述播放端对所述响应文件进行时间戳重置的步骤还包括:所述播放端在接收到所述启播响应文件,并进行时间戳重置后,所述服务器继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片,并由播放端进行时间戳重置和解码播放。
  10. 根据权利要求1所述的直播快速启播方法,其特征在于,所述播放端发送的直播请求包括延迟参数;
    所述服务器根据播放端发送的直播请求确定起始切片文件编号的步骤具体包括:
    所述服务器根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
  11. 一种直播快速启播系统,其特征在于,包括服务器和播放端,所述服务器包括切片模块和发送模块,所述播放端包括时间戳重置模块和解码播放模块;
    所述切片模块,用于对音视频流进行切片,并根据所述音视频流的时间戳对生成的切片文件进行编号,以及,用于记录所述音视频流关键帧信息,并根据所述播放端发送的直播请求确定起始切片文件编号;
    所述发送模块,用于根据所述起始切片文件编号以及所记录的音视频流关键帧信息,发送启播响应文件以及所述起始切片文件编号至所述播放端;
    所述时间戳重置模块,用于以所述起始切片文件编号最接近关键帧为依据对所述启播响应文件进行时间戳重置;
    所述解码播放模块,用于对时间戳重置后的所述启播响应文件进行解码播放。
  12. 根据权利要求11所述的直播快速启播系统,其特征在于,所述发送模块还用于:
    确定与所述起始切片文件编号最接近的关键帧切片文件,其中,所述关键帧切片文件包含有关键帧,并且所述关键帧切片文件的编号小于等于所述起始切片文件编号,同时所述关键帧切片文件的编号与所述起始切片文件编号的差值最小;
    当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述启播响应文件包括关键帧切片文件、编号处在所述关键帧切片文件的编号和所述起始切片文件编号之间的中间切片文件、起始切片文件,所述发送模块将所述启播响应文件以及所述起始切片文件编号发送至所述播放端;
    当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述启播响应文件包括起始切片文件,所述起始切片文件即所述关键帧切片文件,所述发送模块将所述启播响应文件及所述起始切片文件编号发送至所述播放端。
  13. 根据权利要求12所述的直播快速启播系统,其特征在于,当所述关键帧切片文件的编号小于所述起始切片文件编号时,所述时间戳重置模块还用于:
    将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧切片文件中关键帧及关键帧之后的音视频帧的时间戳为起始时间戳;
    将所述中间切片文件中的音视频帧的时间戳重置为所述起始时间戳;
    所述起始切片文件的第一帧原时间戳设为基准值,将所述起始切片文件及之后的切片文件中每一帧时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
  14. 根据权利要求12所述的直播快速启播系统,其特征在于,当所述关键帧切片文件的编号等于所述起始切片文件编号时,所述时间戳重置模块还用于:
    将所述关键帧切片文件中所述关键帧之前的音视频帧丢弃,并重置所述关键帧的时间戳为起始时间戳;
    所述关键帧的原时间戳设为基准值,将所述关键帧之后的所有音视频帧的时间戳重置为调整时间戳,所述调整时间戳为:对应的音视频帧原时间戳减去基准值,再加上所述起始时间戳。
  15. 根据权利要求11所述的直播快速启播系统,其特征在于,所述切片模块还用于根据音视频流切片文件及其对应的编号生成关键帧切片文件编号列表。
  16. 根据权利要求11所述的直播快速启播系统,其特征在于,所述切片为物理切片,所述切片模块还用于:
    根据设定时间间隔对所述音视频流进行切片,生成切片文件;
    对生成的切片文件以时间戳为依据用自然数进行编号。
  17. 根据权利要求16所述的直播快速启播系统,其特征在于,所述播放端还包括请求模块,用于依据所述物理切片编号从小到大的顺序继续向所述服务器请求所述启播响应文件之后的切片文件。
  18. 根据权利要求11所述的直播快速启播系统,其特征在于,所述切片为逻辑切片,所述切片模块还用于:
    根据设定时间间隔在所述音视频流文件中插入带有切片编号的头部字节;所述切片编号以时间戳为依据用自然数进行编号。
  19. 根据权利要求18所述的直播快速启播系统,其特征在于,所述发送模块,还用于继续以从小到大的顺序自动发送所述启播响应文件之后的逻辑切片。
  20. 根据权利要求11所述的直播快速启播系统,其特征在于,所述播放端发送的直播请求包括延迟参数;
    所述发送模块还用于根据所述直播请求中的延迟参数及所述音视频流最新切片编号计算所述起始切片文件编号。
PCT/CN2017/092824 2017-06-19 2017-07-13 直播快速启播方法及系统 WO2018232799A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17849862.2A EP3448040A4 (en) 2017-06-19 2017-07-13 METHOD AND SYSTEM FOR QUICK START OF LIVE BROADCAST
US15/741,936 US10638192B2 (en) 2017-06-19 2017-07-13 Live streaming quick start method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710464840.7A CN107147919B (zh) 2017-06-19 2017-06-19 直播快速启播方法及系统
CN201710464840.7 2017-06-19

Publications (1)

Publication Number Publication Date
WO2018232799A1 true WO2018232799A1 (zh) 2018-12-27

Family

ID=59781741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092824 WO2018232799A1 (zh) 2017-06-19 2017-07-13 直播快速启播方法及系统

Country Status (3)

Country Link
EP (1) EP3448040A4 (zh)
CN (1) CN107147919B (zh)
WO (1) WO2018232799A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726641A (zh) * 2019-03-18 2020-09-29 北京奇虎科技有限公司 直播视频的播放处理方法、装置及服务器

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109756749A (zh) * 2017-11-07 2019-05-14 阿里巴巴集团控股有限公司 视频数据处理方法、装置、服务器和存储介质
CN108259987A (zh) * 2017-12-19 2018-07-06 湖北鸿云科技股份有限公司 移动端低延时流媒体播放器及播放方法
CN110113621B (zh) * 2018-02-01 2023-03-03 腾讯科技(深圳)有限公司 媒体信息的播放方法和装置、存储介质、电子装置
CN108260024B (zh) * 2018-04-12 2020-06-12 腾讯科技(深圳)有限公司 直播数据处理方法、装置、计算机设备和存储介质
CN108540819B (zh) * 2018-04-12 2020-04-03 腾讯科技(深圳)有限公司 直播数据处理方法、装置、计算机设备和存储介质
CN110392269B (zh) * 2018-04-17 2021-11-30 腾讯科技(深圳)有限公司 媒体数据处理方法和装置、媒体数据播放方法和装置
CN109089130B (zh) * 2018-09-18 2020-05-22 网宿科技股份有限公司 一种调整直播视频的时间戳的方法和装置
CN109151492B (zh) * 2018-09-29 2021-02-02 网宿科技股份有限公司 一种直播视频的快速启动方法及装置
CN109218745B (zh) * 2018-10-31 2021-07-23 网宿科技股份有限公司 一种直播方法、服务器、客户端及可读存储介质
CN111031385B (zh) * 2019-12-20 2022-03-08 北京爱奇艺科技有限公司 视频播放的方法及装置
CN112866763B (zh) * 2020-12-28 2023-05-26 网宿科技股份有限公司 Hls多码率流切片的序列号生成方法、服务器及存储介质
CN114630157B (zh) * 2022-03-21 2024-08-23 北京字节跳动网络技术有限公司 直播启播方法、设备及程序产品
CN115550746B (zh) * 2022-10-11 2024-09-10 杭州视洞科技有限公司 基于网络摄像机的hls低延迟方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227590A (zh) * 2007-01-19 2008-07-23 北京风行在线技术有限公司 基于p2p协议的媒体文件点播控制方法及装置
CN104683884A (zh) * 2015-02-09 2015-06-03 网宿科技股份有限公司 一种流媒体直播方法及系统
CN105721952A (zh) * 2016-01-27 2016-06-29 观止云(北京)信息技术有限公司 一种等时长切片的直播流网络传输方法及系统
EP2046044B1 (en) * 2007-10-01 2017-01-18 Cabot Communications Ltd A method and apparatus for streaming digital media content and a communication system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193273B (zh) * 2006-11-20 2010-07-14 中兴通讯股份有限公司 一种实时多媒体图像信息存储和播放方法
US9436692B1 (en) * 2013-06-25 2016-09-06 Emc Corporation Large scale video analytics architecture
CN105981397B (zh) * 2014-02-10 2020-06-16 杜比国际公司 将编码音频嵌入到传输流中以供用于完美拼接
CN105979404A (zh) * 2015-12-01 2016-09-28 乐视致新电子科技(天津)有限公司 一种流媒体的处理方法及装置
US20170155697A1 (en) * 2015-12-01 2017-06-01 Le Holdings (Beijing) Co., Ltd. Method and device for processing streaming media
CN106454389B (zh) * 2016-10-10 2019-05-03 广州酷狗计算机科技有限公司 一种直播视频的播放方法与装置
CN106791994B (zh) * 2016-12-30 2020-11-24 北京奇艺世纪科技有限公司 一种低延时快速开播方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227590A (zh) * 2007-01-19 2008-07-23 北京风行在线技术有限公司 基于p2p协议的媒体文件点播控制方法及装置
EP2046044B1 (en) * 2007-10-01 2017-01-18 Cabot Communications Ltd A method and apparatus for streaming digital media content and a communication system
CN104683884A (zh) * 2015-02-09 2015-06-03 网宿科技股份有限公司 一种流媒体直播方法及系统
CN105721952A (zh) * 2016-01-27 2016-06-29 观止云(北京)信息技术有限公司 一种等时长切片的直播流网络传输方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3448040A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726641A (zh) * 2019-03-18 2020-09-29 北京奇虎科技有限公司 直播视频的播放处理方法、装置及服务器

Also Published As

Publication number Publication date
CN107147919B (zh) 2020-11-27
EP3448040A1 (en) 2019-02-27
EP3448040A4 (en) 2019-06-19
CN107147919A (zh) 2017-09-08

Similar Documents

Publication Publication Date Title
WO2018232799A1 (zh) 直播快速启播方法及系统
JP7506219B2 (ja) 再生方法および再生装置
US10638192B2 (en) Live streaming quick start method and system
USRE48360E1 (en) Method and apparatus for providing trick play service
CA2807156C (en) Trick modes for network streaming of coded video data
KR101558116B1 (ko) 코딩된 멀티미디어 데이터의 네트워크 스트리밍 동안의 표현들 사이의 전환
CN107690073B (zh) 一种视频直播方法及视频直播服务器
KR101927145B1 (ko) 다른 네트워크들을 통해 수신된 콘텐츠의 렌더링을 동기화하기 위한 디코더 및 이러한 디코더에서의 방법
CN110099288B (zh) 发送媒体数据的方法及装置
RU2551111C2 (ru) Устройство и способ загрузки файла с кинофильмом
WO2018076998A1 (zh) 一种回放视频文件的生成方法和装置
WO2011153868A1 (zh) 频道切换方法、装置及系统
JP2016526349A (ja) 複数のオーバーザトップストリーミングクライアントを同期させること
CN111031385B (zh) 视频播放的方法及装置
KR20110053179A (ko) 데이터 전송 방법 및 장치
KR20120119790A (ko) 미디어 데이터 전송 방법 및 장치와 미디어 데이터 수신 방법 및 장치
US11128897B2 (en) Method for initiating a transmission of a streaming content delivered to a client device and access point for implementing this method
CN106791994B (zh) 一种低延时快速开播方法及装置
JP6359539B2 (ja) レンダリング時の制御
US20090319557A1 (en) Method, system and software product for streaming content
JP2015136059A (ja) 通信装置、通信データ生成方法、および通信データ処理方法
US10019448B2 (en) Methods and systems for providing file data for media files
WO2017092433A1 (zh) 视频实时播放方法及装置
WO2015081893A1 (zh) 一种轮播媒体分片的方法、客户端及系统
WO2016090916A1 (zh) 码流传输方法和装置

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2017849862

Country of ref document: EP

Effective date: 20180322

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17849862

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE