WO2017028675A1 - Playing method, device and system for live streaming channel - Google Patents

Playing method, device and system for live streaming channel Download PDF

Info

Publication number
WO2017028675A1
WO2017028675A1 PCT/CN2016/092714 CN2016092714W WO2017028675A1 WO 2017028675 A1 WO2017028675 A1 WO 2017028675A1 CN 2016092714 W CN2016092714 W CN 2016092714W WO 2017028675 A1 WO2017028675 A1 WO 2017028675A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
media file
playing
preset
player
Prior art date
Application number
PCT/CN2016/092714
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2017028675A1 publication Critical patent/WO2017028675A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • 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/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • 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/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

Definitions

  • the present application relates to, but is not limited to, the field of communications, and in particular, to a live channel playing method, apparatus, and system.
  • HLS Hypertext Transfer Protocol
  • the HLS protocol is an HTTP-based streaming media transfer protocol implemented by Apple Inc., which enables live streaming and on-demand streaming. It is mainly used in iOS systems to provide audio and video for iOS devices (such as iPhone, iPad, Mac, etc.). Live and on-demand programs.
  • the server side cuts the live stream into multiple consecutive media files (eg, 10 seconds) (eg, MPEG-TS format) and is described by an constantly updated index file (m3u8 formatted text). .
  • the client downloads the media file fragment described in the index file according to the index file prompt, and starts to play the first media file fragment from the download, and continuously plays the media file fragments; The end will cut the latest live data to generate a new small media file fragment, so that the client can continuously and continuously play the media file fragment obtained from the server in order, thus realizing continuous uninterrupted live broadcast service.
  • the content delivery network Content Delivery Network, which is referred to as the content delivery network
  • the sequential downloading obtains at least two media file fragments, starting from the first media file fragmentation, continuous display playback of the media file fragments is performed.
  • this poses a problem: Since the media file fragmentation has a fixed duration, here is 10 seconds, so the index file is also updated in 10 seconds.
  • the embodiment of the invention provides a live channel playing method, device and system, so as to at least solve the problem that the HLS-based live channel playing screen is not synchronized in the related art.
  • a live channel playing method including: a player acquiring fragmentation information of a media file fragment, where the fragmentation information includes: a start time of a media file fragmentation; The player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment; the player starts playing the live channel from the play position; The time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the media file fragmentation.
  • the player determines, according to the start time, that the played position corresponding to the first time in the obtained media file fragment includes: the player according to the current Determine the first time according to the time and the preset duration; the player determines, according to the start time, a frame rate of the media file fragment, and determines the media file fragmentation Narrative The corresponding playback position at a time.
  • the method further includes: the player determining whether the preset time is reached; and determining that the preset time arrives, The player corrects the playing progress of the live channel according to the preset time and the preset duration.
  • the correcting the playing progress of the live channel according to the preset time and the preset duration includes: determining, by the player, the second corresponding to the current playing position at the preset time The player compares the relationship between the actual time difference between the preset time and the second time and the preset duration; when it is determined that the actual time difference is greater than the preset duration The player accelerates the playing of the live channel according to the first preset policy; and if it is determined that the actual time difference is less than the preset duration, the player follows the second preset policy. Slow down the playback of the live channel.
  • the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in a process of decoding the media file fragment;
  • the P frame is preferentially discarded, and the P frame is discarded without the B frame; the number of discarded frames is determined according to at least a difference between the actual time difference and the preset duration.
  • the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least according to the preset duration and the actual The difference between the time differences is determined, and the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
  • a live channel playback device which is applied to a player, and includes: a processing module, configured to obtain fragmentation information of a media file fragment, wherein the fragmentation information includes And a determining module, configured to determine, according to the starting time, a playback position corresponding to the first time in the obtained media file fragment; the playing module is set to be The playing position starts to play the live channel; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time is related to the device that generates the media file fragmentation The time is synchronized.
  • the determining module includes: a first determining unit, configured to determine the first time according to the current time and the preset duration; and the second determining unit is configured to be at the start time
  • the playback position corresponding to the first time in the media file fragment is determined according to a frame rate of the media file fragment.
  • the device further includes: a determining module, configured to determine whether the preset time is reached; and a correction module configured to determine, according to the preset time and the preset duration, that the preset time is reached Correcting the progress of playing the live channel.
  • a determining module configured to determine whether the preset time is reached
  • a correction module configured to determine, according to the preset time and the preset duration, that the preset time is reached Correcting the progress of playing the live channel.
  • the correction module includes: a third determining unit configured to determine a second time corresponding to the current playing position at the preset time; and a comparing unit configured to compare the preset time with the second time The relationship between the actual time difference and the preset duration; the first processing unit is configured to speed up the location according to the first preset policy when it is determined that the actual time difference is greater than the preset duration The playing of the live channel is performed. The second processing unit is configured to slow down the playing of the live channel according to the second preset policy if it is determined that the actual time difference is less than the preset duration.
  • the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in a process of decoding the media file fragment;
  • the P frame is preferentially discarded, and the P frame is discarded without the B frame; the number of discarded frames is determined according to at least a difference between the actual time difference and the preset duration.
  • the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least according to the preset duration and the actual The difference between the time differences is determined, and the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
  • a live channel playing system including: a set top box, a content distribution network, and a time synchronization source, wherein the content distribution network is connected to the set top box and configured to be based on a live broadcast.
  • the index file describes the fragmentation of the media file fragment Information
  • the fragmentation information includes: a start time of the media file fragmentation; the set top box is configured to acquire an index file from the content distribution network, and parse the fragmentation information; and obtain the fragmentation information according to the fragmentation information Decoding the media file; determining, according to the start time, a play position corresponding to the first time in the media file segment; and playing the live channel from the play position; wherein Current time of the set top box The time difference from the first time is a preset time length; the time synchronization source is respectively connected to the content distribution network and the set top box, and is set to synchronize the time of the set top box and the content distribution network.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions, which are implemented when the computer executable instructions are executed.
  • the fragmentation information of the media file fragment is obtained by using the player, where the fragmentation information includes: a start time of the media file fragmentation; and the player determines the obtained media file based on the start time. a playback position corresponding to the first time in the fragment; the player starts playing the live channel from the playback position; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time and the generated media file.
  • the time of the fragmented device is synchronized, which solves the problem that the HLS-based live channel playback screen is out of sync, so that the playback screen can be synchronized, which improves the user experience.
  • FIG. 1 is a flowchart of a live channel playing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a live channel playing device according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram 1 of an optional structure of a live channel playing device according to an embodiment of the present invention.
  • FIG. 4 is a second schematic diagram of an optional structure of a live channel playing device according to an embodiment of the present invention.
  • FIG. 5 is a third schematic diagram of an optional structure of a live channel playing device according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a live channel playing system according to an embodiment of the present invention.
  • FIG. 7 is a first schematic diagram of an HLS live channel playback screen synchronization system according to an alternative embodiment of the present application.
  • FIG. 8 is a schematic diagram of an HLS live channel playback screen synchronization system according to an alternative embodiment of the present application.
  • Figure II
  • FIG. 9 is a flowchart 1 of a method for synchronizing an HLS live channel playback screen according to an alternative embodiment of the present application.
  • FIG. 10 is a second flowchart of a method for synchronizing an HLS live channel playback screen according to an alternative embodiment of the present application.
  • FIG. 11 is a schematic diagram 1 of a scene of HLS live channel picture synchronization according to an alternative embodiment of the present application.
  • FIG. 12 is a second schematic diagram of a scenario of HLS live channel picture synchronization according to an alternative embodiment of the present application.
  • FIG. 13 is a third schematic diagram of a scenario of HLS live channel picture synchronization according to an alternative embodiment of the present application.
  • FIG. 14 is a fourth schematic diagram of a scene of HLS live channel picture synchronization according to an alternative embodiment of the present application.
  • FIG. 1 is a flowchart of a live channel playing method according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
  • step S102 the player obtains the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
  • Step S104 The player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
  • Step S106 the player starts playing the live channel from the playing position; wherein the player The time difference between the current time and the first time is a preset duration; the current time is synchronized with the time of the device that generated the media file fragmentation.
  • the playback time corresponding to the first time in the media file fragment can be determined based on the start time, and the live channel is played from the play position; wherein, the current time of the player
  • the time difference from the first time is the preset time length, so that when the player starts playing, the time corresponding to the playback position always lags the actual time by a fixed amount of time, thereby ensuring multiple players.
  • the screen is synchronized when playing a live channel. It can be seen that through the above steps, the problem that the live channel playback screen based on HLS is not synchronized is solved, so that the playback screen can be synchronized, and the user experience is improved.
  • the fragmentation information of the media file fragment is sent and updated to the player through the index file, and the index file is an m3u8 index file; in addition, the player is delivered or updated according to the identifier.
  • the fragmentation information of the media file fragmentation described in the index file obtains the media file fragmentation.
  • the start time of the media file fragmentation refers to the real time of generating the media file fragment, or the actual time represented by the content of the media file fragmentation record. For example, for a 10-second media file fragmentation, assuming that the actual content recorded is a live broadcast between 8:00:00 and 8:00:10, the start time of the above-mentioned media file fragmentation is 8:00:00.
  • the frame rate represents the number of frames per unit time; that is, the media stream of known frame rate, the number of frames per unit time is also known.
  • the player may determine the first time according to the current time and the preset duration; the player determines the media file fragmentation based on the start time and combined with the frame rate of the media file fragmentation. The playback position corresponding to the first time.
  • the player may further determine whether the preset time is reached; and when determining that the preset time arrives, the player according to the preset time and the preset duration Correct the progress of the live channel.
  • the playback progress can be corrected when the preset time arrives; wherein the preset time can be freely set, and can be set to a time after the fixed play duration, for example, once every half hour of the live broadcast. Correction It can also be set to a fixed point in time, for example, once every hour or half arrives.
  • the player corrects the playing progress of the live channel according to the preset time and the preset duration: the player determines the second time corresponding to the current playing position at the preset time; the player compares the preset time with the second time The actual time difference is related to the preset duration; if it is determined that the actual time difference is greater than the preset duration, the player speeds up the playback of the live channel according to the first preset policy; If the duration is less than the preset duration, the player slows down the playback of the live channel according to the second preset policy.
  • the first preset policy refers to a policy of dropping frames.
  • the frame is repeatedly discarded between two non-adjacent I frames in the media file fragment; wherein, the B frame is preferentially discarded, and is discarded without the B frame.
  • P frame the number of discarded frames is determined based at least on the difference between the actual time difference and the preset duration.
  • the second preset policy refers to a policy of repeatedly playing a specific frame. For example, performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is determined according to a difference between the preset duration and the actual time difference, and the specific frame includes at least the following One: I frame, P frame, B frame.
  • the playback is performed only once for a specific frame, the slow playback is smooth and does not affect the user's viewing experience.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM).
  • the instructions include a number of instructions for causing a terminal device (which may be a cell phone, computer, server, or network device, etc.) to perform the methods described in each embodiment of the present application.
  • a live channel playing device is also provided, and the device is applied to the player, and is used to implement the foregoing embodiments and optional embodiments.
  • the term "module" can implement a combination of software and/or hardware for a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the device includes: a processing module 22, a determining module 24, and a playing module 26; and a processing module 22 configured to obtain an index file, and Parsing the fragmentation information of the media file fragmentation described in the index file, where the fragmentation information includes: a start time of the media file fragmentation; the determining module 24 is coupled to the processing module 22, and is set to be based on the start time.
  • the playing module 26 is coupled to the determining module 24, configured to play the live channel from the play position; wherein, the current time of the player and the time of the first time The difference is the preset duration; the current time is synchronized with the time of the device that generated the fragmentation of the media file.
  • the problem that the live channel playback screen based on HLS is not synchronized is solved, so that the playback screen can be synchronized and the user experience is improved.
  • FIG. 3 is a block diagram of an optional structure of a live channel playing device according to an embodiment of the present invention.
  • the determining module 24 includes: a determining unit 242 is configured to determine the first time according to the current time and the preset duration; the second determining unit 244 is coupled to the first determining unit 242, and is set to be based on the starting time and combined with the media file fragmentation.
  • the frame rate determines the playback position corresponding to the first time in the media file fragment.
  • the determining module 42 is coupled to the playing module 26 and configured to determine whether the preset time is reached.
  • the correcting module 44 is coupled to the determining module 42 and configured to determine the preset time and the preset time according to the preset time and the preset time length. Correct the progress of the live channel.
  • FIG. 5 is a block diagram 3 of an optional structure of a live channel playing device according to an embodiment of the present invention.
  • the correcting module 44 includes: The third determining unit 442 is configured to determine a second time corresponding to the current playing position at the preset time; the comparing unit 444 is coupled to the third determining unit 442, and is configured to compare the actual time difference between the preset time and the second time with the pre-predetermined time.
  • the first processing unit 446 is coupled to the comparison unit 444, and is configured to be configured according to the first step when it is determined that the actual time difference is greater than the preset duration.
  • the preset policy speeds up the playing of the live channel; the second processing unit 448 is coupled to the comparing unit 444, and is configured to slow down the live channel according to the second preset policy if it is determined that the actual time difference is less than the preset duration Play.
  • the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in the process of decoding the media file fragment; wherein, preferentially discarding the B frame P frames are discarded without B frames; the number of discarded frames is determined based at least on the difference between the actual time difference and the preset duration.
  • the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least a difference between the preset duration and the actual time difference. Determining, the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
  • the player described above includes: a playback device having a frame parsing function, such as a set top box or the like.
  • FIG. 6 is a schematic structural diagram of a live channel playing system according to an embodiment of the present invention. As shown in FIG. 6, the system includes: a set top box 62, a content distribution network 64, and time synchronization. Source 66, where:
  • the content distribution network 64 is connected to the set top box 62 and configured to generate a media file fragment and an index file according to the live broadcast source, and provide the set top box 62 with the download of the media file fragment and the update of the index file; wherein the index file describes the media file.
  • the fragmentation information of the fragment, the fragmentation information includes: the start time of the fragmentation of the media file;
  • the set top box 62 is configured to obtain an index file from the content distribution network 64, and parse the fragmentation information; obtain the media file fragment according to the fragmentation information; and determine, according to the start time, the media file fragment corresponding to the first time. a playback position; and playing the live channel from the playback position; wherein the time difference between the current time of the set top box 62 and the first time is a preset duration;
  • the time synchronization source 66 is connected to the content distribution network 64 and the set top box 62, respectively, and is set to synchronize the time of the set top box 62 and the content distribution network 64.
  • set top box 62 is also used to implement the above-mentioned live channel playing method, and details are not described herein again.
  • each of the above modules can be implemented by software or hardware, and The foregoing may be implemented by, but not limited to, the above modules are all located in the same processor; or, the above modules are respectively located in multiple processors.
  • the embodiment of the present invention further provides a software for executing the technical solutions described in the foregoing embodiments and optional implementation manners.
  • the embodiment of the invention further provides a computer readable storage medium.
  • the computer readable storage medium described above may be arranged to store program code for performing the following steps:
  • step S1 the player obtains the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
  • Step S2 the player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
  • Step S3 The player starts playing the live channel from the playing position; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the media file fragmentation. .
  • the computer readable storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), and a mobile device.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • An optional embodiment of the present application provides a method and system for solving the problem that the HLS live channel playback screen is out of synchronization, so as to enhance the user's viewing experience for the HLS channel.
  • the method provided by this alternative embodiment includes the following steps:
  • Step 1 The CDN streaming server (equivalent to the content distribution network described above) and the set-top box playing client (corresponding to the above-mentioned player) perform clock synchronization with the same clock synchronization source to ensure that the time between the two is completely the same.
  • Step 2 When the media file is cut and the m3u8 index file is updated, the CDN streaming server adds a fragment creation time attribute for each media file fragment, and the fragment creation time attribute representation The actual start time of the media file fragmentation.
  • Step 3 When the set-top box playing client enters the HLS channel for playing, after the first two media files are downloaded, the first media file segmentation is no longer started, but the current system time of the client is subtracted from the set-top box.
  • the fixed duration (such as the length of the two media file fragments) t0 starts to play. This effectively solves the time difference between the different set-top box playing client entering the channel, or the time difference caused by the download speed of different network bandwidth differences, which causes the HLS channel live picture to be out of sync.
  • the set-top box playing client corrects the playing position of the t0 according to the local time of the system, and if there is a lag, the decoding is accelerated until the lag time is corrected, and the correcting mechanism is implemented.
  • the problem of playback is not synchronized caused by Caton or network transmission.
  • an optional embodiment of the present application further provides a system for solving the problem of non-synchronization of the HLS live channel playback screen, the system comprising: cutting a media file fragment and updating the index file of the CDN streaming server, downloading and correcting The set-top box that does not synchronize the problem plays the client, and the clock synchronization server (which is equivalent to the above-mentioned time synchronization source) that performs clock synchronization between the two.
  • the method and system for solving the problem of non-synchronization of the HLS live channel playback screen provided by the optional embodiment of the present application, by adding a synchronization policy between the CDN streaming media server and the set-top box playing client, to implement a plurality of set-top box playing clients
  • the live channel picture synchronization can realize the synchronization correction of the picture of the same HLS live channel under different conditions of different set-top box playing client and different network bandwidth, and bring a more real-time viewing experience to the user.
  • An optional embodiment of the present application describes an HLS live channel playback screen synchronization system. As shown in FIG. 7 and FIG. 8, the system includes a set top box playback client, a CDN streaming server, and a clock synchronization server.
  • the clock synchronization server serves as the clock source for the entire system.
  • the set-top box playback client and the CDN streaming media server are clock synchronized with the clock synchronization server to ensure complete synchronization of the clock between the set-top box playing client and the CDN streaming server.
  • the CDN streaming media server provides the source of the HLS live channel, provides the m3u8 index file of the channel and the download service of the channel media file fragment, and repeatedly updates according to the live broadcast process. M3u8 indexing, as well as creating new media file shards.
  • the set top box playing client includes: a downloading module, a codec module, and a video rendering module.
  • the download module is responsible for downloading and parsing the m3u8 index file, and downloading the media file fragment described in the m3u8 index file;
  • the codec module is responsible for decoding the ts format of the media file fragmentation, so that the video rendering module can display the screen. Displayed to the user, at the same time the codec module is also responsible for speeding up the decoding work when the whole point check finds that there is a delay in playback progress, in order to catch up with the playback progress.
  • an optional embodiment of the present application further provides a method for synchronizing HLS live channel playback pictures. The method will be described below with reference to the following examples of index files, FIG. 9 and FIG.
  • an example of an index file is as follows:
  • the CDN streaming server increases the generation time description information of each media file fragment in the m3u8 index file of the provided HLS live channel, and generates time description information using the #EXT-X-PROGRAM-DATE-TIME parameter description.
  • the time description information is generated, which will serve as a reference for ensuring the synchronization of the playback screen when the different set-top box playback client plays after the download is completed, and will also serve as a reference for the set-top box playback client to keep the playback screen synchronized during the continuous playback.
  • FIG. 9 shows a business process when the set-top box playing client enters the HLS live channel according to the user instruction.
  • the set-top box playing client queries the CDN streaming server for the playing address of the HLS live channel; and the CDN streaming server returns the file transfer protocol (FTP, File Transfer Protocol) of the m3u8 index file of the HLS live channel according to the request.
  • FTP File Transfer Protocol
  • the set-top box playing client downloads the first m3u8 index file according to the FTP download address; the set-top box playing client parses the first m3u8 index file, obtains the media file fragment of the HLS live channel described in the index file, and each media The playback duration of the file fragment, the generation time of each media file fragmentation (ie, the EXT-X-PROGRAM-DATE-TIME time described above); the set-top box playback client subtracts t0 according to its own system time (for example, the value of t0 can be selected) As the starting time of the two media files, as the starting time of the current playback; the set-top box playing client opens the first media file fragment, and jumps to the starting moment to start playing.
  • t5>t0 it means that the set-top box playing client has a delay in the current HLS channel playing process, and needs to accelerate the decoding display.
  • the set-top box playing client controls the codec module to discard a certain number of video frames according to the strategy according to the difference between t5 and t0 to catch up with the playing progress.
  • the above strategies include:
  • A1 Do not repeatedly discard frames between two adjacent I frames
  • the number of dropped frames is calculated according to the difference between t5 and t0 and the compression ratio of the media file;
  • the frame loss is matched to the playback progress, and the impact on the user's playback experience can be neglected, and there is no obvious misalignment on the video.
  • t5 ⁇ t0, it means that the playback progress of the set-top box playing client caused by the frame skipping during the current HLS playback is too fast, and the playback progress needs to be delayed.
  • the set top box plays the client according to t0 and
  • the difference of t5 controls the codec module to compensate for a certain number of video frames according to the strategy to delay the waiting for playing progress.
  • the so-called compensation means that a certain frame is repeatedly played.
  • the above strategies include:
  • each original frame can only be compensated once
  • the original frame compensated may be an I frame, a P frame or a B frame, and there is no mandatory requirement;
  • the number of compensation frames in this time is calculated according to the difference between t0 and t5 and the compression ratio of the media file;
  • the playback progress synchronization is realized, and the influence on the user's playing experience can be neglected, and there is no obvious jump or delay in the video.
  • the method provided by the optional embodiment of the present application is used to solve the unsynchronized playback scene of the HLS live channel.
  • Different embodiments of the problem The following will be introduced one by one.
  • the client 1 and the client 2 are set top boxes of the same model.
  • Client 1 in the network bandwidth 1 condition; client 2, in the network bandwidth 2 condition.
  • the client 1 and the client 2 initiate a viewing request for the same HLS live channel at the same time t1. Due to the bandwidth difference, the client 1 downloads the m3u8 index file of the HLS live channel and the described description relatively quickly at time t2.
  • the first two media files are fragmented; the client 2 downloads the m3u8 index file of the HLS live channel and the first two media file fragments described at t3 relatively slowly.
  • the client 1 subtracts the fixed duration t0 (as described above) from the current time t2 of the client 1, that is, plays from t2-t0, and reaches the client at time t3.
  • the playback is performed at t0, which coincides with the playback position of the client 1. This ensures that the client 1 and the client 2 synchronize the playback picture when entering the same HLS live channel under different network bandwidth conditions.
  • client 1 and client 2 are two identical models and are on the same network. Under the condition of bandwidth 1.
  • the client 1 starts to request a certain HLS live channel at an earlier time t1, and completes the download of the m3u8 index file and the first two media file fragments described therein at time t3; the client 2 requests the same HLS at a later time t2.
  • the live channel completes the download of the m3u8 index file and the first two media file fragments described therein at time t4.
  • the playback time of client 1 is t3-t0.
  • the playback position of the end 1 is the same. This ensures that the client 1 and the client 2 are synchronized to the playback screen when playing the same HLS live channel at different times under the same network bandwidth condition.
  • client 1 and client 2 are two identical models and are in the same network bandwidth 1 condition.
  • Client 1 starts to request the HD version of a certain HLS live channel at time t1, and completes the download of the m3u8 index file and the first two HD media file fragments described therein at time t3; client 2 requests the same at the same time t1.
  • the standard definition version of the HLS live channel because the SD media segment file is small, takes up a short download time, so the m3u8 index file and the download of the first two SD media file segments described therein are completed at t2 before t3.
  • the playback time of client 2 is t2-t0.
  • the playback position of the end 2 is the same. This ensures that Client 1 and Client 2 synchronize the playback pictures of the HD and SD channels of the same HLS live channel under the same network bandwidth conditions.
  • client 1 and client 2 are two set top boxes of the same model.
  • Client 1 under the condition of network bandwidth 1 with normal bandwidth conditions; client 2, under the condition of better bandwidth of network bandwidth 2.
  • Both clients are watching the same HLS live channel, and at time t1, the two clients play the same position and the pictures are synchronized.
  • the client 2 is in the normal play position, and the client 1 is relatively lagging. At this time, the play picture between the two is out of sync.
  • the client 1 checks that the playback position is delayed compared with the current device time (t2) minus the fixed duration (t0) at the hour, and the client 1 itself speeds up the decoding and plays.
  • the normal playback progress is consistent with the standard playback screen.
  • modules or steps of the present application described above can be implemented with a general purpose computing device that can be centralized on a single computing device or distributed across multiple computations.
  • they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different
  • the steps shown or described herein are performed sequentially, or they are separately fabricated into a single integrated circuit module, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the application is not limited to any particular combination of hardware and software.
  • the embodiment of the present invention provides a live channel playing method, device, and system, which solves the problem that the live channel playback screen based on the HLS is not synchronized, so that the playback screen can be synchronized, and the user experience is improved.

Landscapes

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

Abstract

A playing method for a live streaming channel comprises: a player acquires segment information of media file segments, wherein the segment information comprises a start time point of the media file segments; the player determines, on the basis of the start time point, a play location corresponding to a first time point in the acquired media file segments; the player starts playing of the live streaming channel from the play location, wherein a time difference between a current time of the player and the first time point is a predetermined time duration, and the current time is synchronized with the time of a device generating the media file segments. Via the above solution, the present invention addresses the asynchronicity problem of play frames of an HLS-based live streaming channel, such that the play frames are synchronized to improve user experience.

Description

直播频道播放方法、装置及系统Live channel playing method, device and system 技术领域Technical field
本申请涉及但不限于通信领域,尤其涉及一种直播频道播放方法、装置及系统。The present application relates to, but is not limited to, the field of communications, and in particular, to a live channel playing method, apparatus, and system.
背景技术Background technique
数字多媒体和网络的发展,方便了用户获取资讯或者娱乐的体验。人们可以通过多种途径观看直播频道,比如卫星电视、有线电视、网络电视等。在互联网上提供视频直播业务,也有多种不同的方法,比如基于实时流传输协议(Real Time Streaming Protocol,简称为RTSP)和基于超文本传输协议(HTTP,Hyper Text Transfer Protocol)的流媒体网络传输协议(Http Live Streaming,简称为HLS)等。The development of digital multimedia and networks facilitates users' access to information or entertainment experiences. People can watch live channels in a variety of ways, such as satellite TV, cable TV, Internet TV and more. There are many different methods for providing live video services on the Internet, such as Real Time Streaming Protocol (RTSP) and Hypertext Transfer Protocol (HTTP) based streaming media network transmission. Protocol (Http Live Streaming, referred to as HLS).
HLS协议是苹果公司(Apple Inc.)实现的基于HTTP的流媒体传输协议,可实现流媒体的直播和点播,主要应用在iOS系统,为iOS设备(如iPhone、iPad、Mac等)提供音视频直播和点播方案。The HLS protocol is an HTTP-based streaming media transfer protocol implemented by Apple Inc., which enables live streaming and on-demand streaming. It is mainly used in iOS systems to provide audio and video for iOS devices (such as iPhone, iPad, Mac, etc.). Live and on-demand programs.
对于HLS直播,由于其技术特点要求,实际是属于渐进下载式播放。客户端获取到的,并不是一个完整的数据流。服务器端将直播数据流切割成多个连续的、时长很短(例如,10秒)的媒体文件分片(例如,MPEG-TS格式),并通过不断更新的索引文件(m3u8格式文本)来描述。客户端则不断地下载、分析索引文件后,根据索引文件提示下载其中所描述的媒体文件分片,并从下载得到的第一个媒体文件分片开始,连续播放这些媒体文件分片;因为服务器端会将最新的直播数据切割生成新的小的媒体文件分片,这样客户端只要不停地按顺序播放从服务器端获取到的媒体文件分片,就实现了连续不间断的直播业务。For HLS live broadcast, due to its technical characteristics, it is actually progressive download. What the client gets is not a complete data stream. The server side cuts the live stream into multiple consecutive media files (eg, 10 seconds) (eg, MPEG-TS format) and is described by an constantly updated index file (m3u8 formatted text). . After continuously downloading and analyzing the index file, the client downloads the media file fragment described in the index file according to the index file prompt, and starts to play the first media file fragment from the download, and continuously plays the media file fragments; The end will cut the latest live data to generate a new small media file fragment, so that the client can continuously and continuously play the media file fragment obtained from the server in order, thus realizing continuous uninterrupted live broadcast service.
对于IPTV(Internet Protocol Television,网络协议电视)/OTT(Over The Top)系统中提供的HLS直播频道业务,当机顶盒进入频道时,首先从提供HLS直播服务的内容分发网络(Content Delivery Network,简称为CDN)流媒体服务器中下载和分析该频道当前的m3u8索引文件,然后根据索引文件 顺序下载得到至少两个媒体文件分片后,从第一个媒体文件分片开始,进行逐个媒体文件分片的连续展示播放。然而,这就造成一个问题:由于媒体文件分片有固定时长,这里以10秒为例,因此索引文件也是10秒更新一次。那么同样网络带宽条件下的两个相同型号的机顶盒,先后(比如相隔2秒)进入同一个频道时,获取到的索引文件是相同的,分别下载完前两个媒体文件分片后进行播放,这就导致这两个机顶盒在同一时刻对于同一频道所展示的直播播放画面不同步,存在时间差异,这个差异就是进入频道的时间差。For the HLS live channel service provided in the IPTV (Internet Protocol Television)/OTT (Over The Top) system, when the set-top box enters the channel, the content delivery network (Content Delivery Network, which is referred to as the content delivery network) Download and analyze the current m3u8 index file of the channel in the CDN) streaming server, and then according to the index file After the sequential downloading obtains at least two media file fragments, starting from the first media file fragmentation, continuous display playback of the media file fragments is performed. However, this poses a problem: Since the media file fragmentation has a fixed duration, here is 10 seconds, so the index file is also updated in 10 seconds. Then, two set-top boxes of the same model under the same network bandwidth condition, when successively enter the same channel (for example, 2 seconds apart), the obtained index files are the same, and the first two media files are downloaded after being downloaded separately. This causes the two set-top boxes to be out of sync with the live broadcast screen displayed on the same channel at the same time. There is a time difference. This difference is the time difference of entering the channel.
此外,对于处于不同带宽条件下的两个相同型号的机顶盒,同时进入同一个HLS直播频道观看时,由于下载m3u8索引文件和媒体文件分片的带宽差异,耗时有长短,这也导致这两个机顶盒对于同一个直播播放画面出现不同步。In addition, when two set-top boxes of the same model under different bandwidth conditions are simultaneously viewed in the same HLS live channel, the bandwidth difference between downloading the m3u8 index file and the media file fragment is time-consuming, which also causes these two The set-top boxes are out of sync for the same live broadcast screen.
针对相关技术中基于HLS的直播频道播放画面不同步的问题,目前尚未提出有效的解决方案。In view of the problem that the HLS-based live channel playback pictures are not synchronized in the related art, an effective solution has not been proposed yet.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供了一种直播频道播放方法、装置及系统,以至少解决相关技术中基于HLS的直播频道播放画面不同步的问题。The embodiment of the invention provides a live channel playing method, device and system, so as to at least solve the problem that the HLS-based live channel playing screen is not synchronized in the related art.
根据本发明实施例的一个方面,提供了一种直播频道播放方法,包括:播放器获取媒体文件分片的分片信息,其中,所述分片信息包括:媒体文件分片的起始时间;所述播放器以所述起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;所述播放器从所述播放位置开始进行直播频道的播放;其中,所述播放器的当前时间与所述第一时间的时间差值为预设时长;所述当前时间与生成所述媒体文件分片的设备的时间是同步的。According to an aspect of the present invention, a live channel playing method is provided, including: a player acquiring fragmentation information of a media file fragment, where the fragmentation information includes: a start time of a media file fragmentation; The player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment; the player starts playing the live channel from the play position; The time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the media file fragmentation.
可选地,所述播放器以所述起始时间为基准,确定获取到的所述媒体文件分片中与所述第一时间对应的所述播放位置包括:所述播放器根据所述当前时间和所述预设时长,确定所述第一时间;所述播放器以所述起始时间为基准,并结合所述媒体文件分片的帧率,确定所述媒体文件分片中与所述第 一时间对应的播放位置。Optionally, the player determines, according to the start time, that the played position corresponding to the first time in the obtained media file fragment includes: the player according to the current Determine the first time according to the time and the preset duration; the player determines, according to the start time, a frame rate of the media file fragment, and determines the media file fragmentation Narrative The corresponding playback position at a time.
可选地,在所述播放器从所述播放位置开始进行直播频道的播放之后,所述方法还包括:所述播放器判断预设时间是否到达;在判断到预设时间到达的情况下,所述播放器根据所述预设时间和所述预设时长,矫正对所述直播频道的播放进度。Optionally, after the player starts playing the live channel from the playing position, the method further includes: the player determining whether the preset time is reached; and determining that the preset time arrives, The player corrects the playing progress of the live channel according to the preset time and the preset duration.
可选地,所述播放器根据所述预设时间和所述预设时长,矫正对所述直播频道的播放进度包括:所述播放器在所述预设时间确定当前播放位置对应的第二时间;所述播放器比较所述预设时间与所述第二时间的实际时间差值与所述预设时长的大小关系;在判断到所述实际时间差值大于所述预设时长的情况下,所述播放器按照第一预设策略加快对所述直播频道的播放;在判断到所述实际时间差值小于所述预设时长的情况下,所述播放器按照第二预设策略减慢对所述直播频道的播放。Optionally, the correcting the playing progress of the live channel according to the preset time and the preset duration includes: determining, by the player, the second corresponding to the current playing position at the preset time The player compares the relationship between the actual time difference between the preset time and the second time and the preset duration; when it is determined that the actual time difference is greater than the preset duration The player accelerates the playing of the live channel according to the first preset policy; and if it is determined that the actual time difference is less than the preset duration, the player follows the second preset policy. Slow down the playback of the live channel.
可选地,所述第一预设策略包括:在对所述媒体文件分片进行解码的过程中,在所述媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据所述实际时间差值与所述预设时长之间的差值确定的。Optionally, the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in a process of decoding the media file fragment; The P frame is preferentially discarded, and the P frame is discarded without the B frame; the number of discarded frames is determined according to at least a difference between the actual time difference and the preset duration.
可选地,所述第二预设策略包括:对所述媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据所述预设时长与所述实际时间差值之间的差值确定的,所述特定帧包括以下至少之一:I帧、P帧、B帧。Optionally, the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least according to the preset duration and the actual The difference between the time differences is determined, and the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
根据本发明实施例的另一个方面,还提供了一种直播频道播放装置,应用于播放器,包括:处理模块,设置为获取媒体文件分片的分片信息,其中,所述分片信息包括:媒体文件分片的起始时间;确定模块,设置为以所述起始时间为基准,确定获取到的所述媒体文件分片中与第一时间对应的播放位置;播放模块,设置为从所述播放位置开始进行直播频道的播放;其中,所述播放器的当前时间与所述第一时间的时间差值为预设时长;所述当前时间与生成所述媒体文件分片的设备的时间是同步的。According to another aspect of the present invention, a live channel playback device is further provided, which is applied to a player, and includes: a processing module, configured to obtain fragmentation information of a media file fragment, wherein the fragmentation information includes And a determining module, configured to determine, according to the starting time, a playback position corresponding to the first time in the obtained media file fragment; the playing module is set to be The playing position starts to play the live channel; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time is related to the device that generates the media file fragmentation The time is synchronized.
可选地,所述确定模块包括:第一确定单元,设置为根据所述当前时间和所述预设时长,确定所述第一时间;第二确定单元,设置为以所述起始时 间为基准,并结合所述媒体文件分片的帧率,确定所述媒体文件分片中与所述第一时间对应的播放位置。Optionally, the determining module includes: a first determining unit, configured to determine the first time according to the current time and the preset duration; and the second determining unit is configured to be at the start time The playback position corresponding to the first time in the media file fragment is determined according to a frame rate of the media file fragment.
可选地,所述装置还包括:判断模块,设置为判断预设时间是否到达;矫正模块,设置为在判断到预设时间到达的情况下,根据所述预设时间和所述预设时长,矫正对所述直播频道的播放进度。Optionally, the device further includes: a determining module, configured to determine whether the preset time is reached; and a correction module configured to determine, according to the preset time and the preset duration, that the preset time is reached Correcting the progress of playing the live channel.
可选地,所述矫正模块包括:第三确定单元,设置为在所述预设时间确定当前播放位置对应的第二时间;比较单元,设置为比较所述预设时间与所述第二时间的实际时间差值与所述预设时长的大小关系;第一处理单元,设置为在判断到所述实际时间差值大于所述预设时长的情况下,按照第一预设策略加快对所述直播频道的播放;第二处理单元,设置为在判断到所述实际时间差值小于所述预设时长的情况下,按照第二预设策略减慢对所述直播频道的播放。Optionally, the correction module includes: a third determining unit configured to determine a second time corresponding to the current playing position at the preset time; and a comparing unit configured to compare the preset time with the second time The relationship between the actual time difference and the preset duration; the first processing unit is configured to speed up the location according to the first preset policy when it is determined that the actual time difference is greater than the preset duration The playing of the live channel is performed. The second processing unit is configured to slow down the playing of the live channel according to the second preset policy if it is determined that the actual time difference is less than the preset duration.
可选地,所述第一预设策略包括:在对所述媒体文件分片进行解码的过程中,在所述媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据所述实际时间差值与所述预设时长之间的差值确定的。Optionally, the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in a process of decoding the media file fragment; The P frame is preferentially discarded, and the P frame is discarded without the B frame; the number of discarded frames is determined according to at least a difference between the actual time difference and the preset duration.
可选地,所述第二预设策略包括:对所述媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据所述预设时长与所述实际时间差值之间的差值确定的,所述特定帧包括以下至少之一:I帧、P帧、B帧。Optionally, the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least according to the preset duration and the actual The difference between the time differences is determined, and the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
根据本发明实施例的另一个方面,还提供了一种直播频道播放系统,包括:机顶盒、内容分发网络、时间同步源,其中,所述内容分发网络,与所述机顶盒连接,设置为根据直播源生成媒体文件分片和索引文件,并向所述机顶盒提供所述媒体文件分片的下载和所述索引文件的更新;其中,所述索引文件中描述有所述媒体文件分片的分片信息,所述分片信息包括:媒体文件分片的起始时间;所述机顶盒,设置为从所述内容分发网络获取索引文件,并解析所述分片信息;根据所述分片信息,获取所述媒体文件分片;以所述起始时间为基准,确定所述媒体文件分片中与第一时间对应的播放位置;以及从所述播放位置开始进行直播频道的播放;其中,所述机顶盒的当前时间 与所述第一时间的时间差值为预设时长;所述时间同步源,分别与所述内容分发网络和所述机顶盒连接,设置为同步所述机顶盒与所述内容分发网络的时间。According to another aspect of the present invention, a live channel playing system is further provided, including: a set top box, a content distribution network, and a time synchronization source, wherein the content distribution network is connected to the set top box and configured to be based on a live broadcast. Generating a media file fragment and an index file, and providing the set top box with the download of the media file fragment and the update of the index file; wherein the index file describes the fragmentation of the media file fragment Information, the fragmentation information includes: a start time of the media file fragmentation; the set top box is configured to acquire an index file from the content distribution network, and parse the fragmentation information; and obtain the fragmentation information according to the fragmentation information Decoding the media file; determining, according to the start time, a play position corresponding to the first time in the media file segment; and playing the live channel from the play position; wherein Current time of the set top box The time difference from the first time is a preset time length; the time synchronization source is respectively connected to the content distribution network and the set top box, and is set to synchronize the time of the set top box and the content distribution network.
本发明实施例还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述直播频道播放方法。The embodiment of the invention further provides a computer readable storage medium storing computer executable instructions, which are implemented when the computer executable instructions are executed.
通过本发明实施例,采用播放器获取媒体文件分片的分片信息,其中,分片信息包括:媒体文件分片的起始时间;播放器以起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;播放器从播放位置开始进行直播频道的播放;其中,播放器的当前时间与第一时间的时间差值为预设时长;当前时间与生成媒体文件分片的设备的时间是同步的,解决了基于HLS的直播频道播放画面不同步的问题,使得播放画面可以同步,提升了用户体验。According to the embodiment of the present invention, the fragmentation information of the media file fragment is obtained by using the player, where the fragmentation information includes: a start time of the media file fragmentation; and the player determines the obtained media file based on the start time. a playback position corresponding to the first time in the fragment; the player starts playing the live channel from the playback position; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time and the generated media file The time of the fragmented device is synchronized, which solves the problem that the HLS-based live channel playback screen is out of sync, so that the playback screen can be synchronized, which improves the user experience.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1是根据本发明实施例的直播频道播放方法的流程图;1 is a flowchart of a live channel playing method according to an embodiment of the present invention;
图2是根据本发明实施例的直播频道播放装置的结构示意图;2 is a schematic structural diagram of a live channel playing device according to an embodiment of the present invention;
图3是根据本发明实施例的直播频道播放装置的可选结构示意图一;3 is a schematic structural diagram 1 of an optional structure of a live channel playing device according to an embodiment of the present invention;
图4是根据本发明实施例的直播频道播放装置的可选结构示意图二;4 is a second schematic diagram of an optional structure of a live channel playing device according to an embodiment of the present invention;
图5是根据本发明实施例的直播频道播放装置的可选结构示意图三;FIG. 5 is a third schematic diagram of an optional structure of a live channel playing device according to an embodiment of the present invention; FIG.
图6是根据本发明实施例的直播频道播放系统的结构示意图;6 is a schematic structural diagram of a live channel playing system according to an embodiment of the present invention;
图7是根据本申请可选实施例的HLS直播频道播放画面同步系统的示意图一;7 is a first schematic diagram of an HLS live channel playback screen synchronization system according to an alternative embodiment of the present application;
图8是根据本申请可选实施例的HLS直播频道播放画面同步系统的示意 图二;FIG. 8 is a schematic diagram of an HLS live channel playback screen synchronization system according to an alternative embodiment of the present application. Figure II;
图9是根据本申请可选实施例的HLS直播频道播放画面同步方法的流程图一;9 is a flowchart 1 of a method for synchronizing an HLS live channel playback screen according to an alternative embodiment of the present application;
图10是根据本申请可选实施例的HLS直播频道播放画面同步方法的流程图二;FIG. 10 is a second flowchart of a method for synchronizing an HLS live channel playback screen according to an alternative embodiment of the present application; FIG.
图11是根据本申请可选实施例的HLS直播频道画面同步的场景示意图一;11 is a schematic diagram 1 of a scene of HLS live channel picture synchronization according to an alternative embodiment of the present application;
图12是根据本申请可选实施例的HLS直播频道画面同步的场景示意图二;FIG. 12 is a second schematic diagram of a scenario of HLS live channel picture synchronization according to an alternative embodiment of the present application; FIG.
图13是根据本申请可选实施例的HLS直播频道画面同步的场景示意图三;FIG. 13 is a third schematic diagram of a scenario of HLS live channel picture synchronization according to an alternative embodiment of the present application; FIG.
图14是根据本申请可选实施例的HLS直播频道画面同步的场景示意图四。FIG. 14 is a fourth schematic diagram of a scene of HLS live channel picture synchronization according to an alternative embodiment of the present application.
本发明的实施方式Embodiments of the invention
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The present application will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or order.
在本实施例中提供了一种直播频道播放方法,图1是根据本发明实施例的直播频道播放方法的流程图,如图1所示,该方法包括如下步骤:In this embodiment, a live channel playing method is provided. FIG. 1 is a flowchart of a live channel playing method according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
步骤S102,播放器获取媒体文件分片的分片信息,其中,分片信息包括:媒体文件分片的起始时间;In step S102, the player obtains the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
步骤S104,播放器以起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;Step S104: The player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
步骤S106,播放器从播放位置开始进行直播频道的播放;其中,播放器 的当前时间与第一时间的时间差值为预设时长;当前时间与生成媒体文件分片的设备的时间是同步的。Step S106, the player starts playing the live channel from the playing position; wherein the player The time difference between the current time and the first time is a preset duration; the current time is synchronized with the time of the device that generated the media file fragmentation.
通过上述步骤,由于播放器的当前时间与生成媒体文件分片的设备的时间是同步的,在生成媒体文件分片时,记录媒体文件分片的起始时间;那么,在播放器获取到媒体文件分片的起始时间后,就可以以该起始时间为基准,确定媒体文件分片中第一时间对应的播放位置,并从该播放位置开始播放直播频道;其中,播放器的当前时间与第一时间的时间差值为预设时长,使得播放器无论在何时开始播放,其播放位置对应的时间始终与实际时间相比滞后了一个固定的时间量,从而保证了多个播放器在播放直播频道时的画面同步。可见,通过上述步骤,解决了基于HLS的直播频道播放画面不同步的问题,使得播放画面可以同步,提升了用户体验。Through the above steps, since the current time of the player is synchronized with the time of the device for generating the media file fragmentation, when the media file fragment is generated, the start time of the media file fragmentation is recorded; then, the media is acquired by the player. After the start time of the file fragmentation, the playback time corresponding to the first time in the media file fragment can be determined based on the start time, and the live channel is played from the play position; wherein, the current time of the player The time difference from the first time is the preset time length, so that when the player starts playing, the time corresponding to the playback position always lags the actual time by a fixed amount of time, thereby ensuring multiple players. The screen is synchronized when playing a live channel. It can be seen that through the above steps, the problem that the live channel playback screen based on HLS is not synchronized is solved, so that the playback screen can be synchronized, and the user experience is improved.
可选地,在基于HLS的渐进式直播系统中,媒体文件分片的分片信息通过索引文件下发并更新给播放器,该索引文件为m3u8索引文件;此外,播放器根据下发或者更新的索引文件中描述的媒体文件分片的分片信息获取媒体文件分片。上述的媒体文件分片的起始时间是指生成该媒体文件分片的真实时间,或者说是媒体文件分片记录的内容所代表的实际时间。例如,对于1个10秒的媒体文件分片,假设其记录的实际内容是8:00:00~8:00:10之间的直播画面,则上述的媒体文件分片的起始时间即为8:00:00。Optionally, in the HLS-based progressive live broadcast system, the fragmentation information of the media file fragment is sent and updated to the player through the index file, and the index file is an m3u8 index file; in addition, the player is delivered or updated according to the identifier. The fragmentation information of the media file fragmentation described in the index file obtains the media file fragmentation. The start time of the media file fragmentation refers to the real time of generating the media file fragment, or the actual time represented by the content of the media file fragmentation record. For example, for a 10-second media file fragmentation, assuming that the actual content recorded is a live broadcast between 8:00:00 and 8:00:10, the start time of the above-mentioned media file fragmentation is 8:00:00.
帧率代表了单位时间内帧的数量;即,已知帧率的媒体流,单位时间内的帧的数量也是已知的。可选地,在步骤S104中,播放器可以根据当前时间和预设时长,确定第一时间;播放器以起始时间为基准,并结合媒体文件分片的帧率,确定媒体文件分片中与第一时间对应的播放位置。The frame rate represents the number of frames per unit time; that is, the media stream of known frame rate, the number of frames per unit time is also known. Optionally, in step S104, the player may determine the first time according to the current time and the preset duration; the player determines the media file fragmentation based on the start time and combined with the frame rate of the media file fragmentation. The playback position corresponding to the first time.
可选地,在播放器从播放位置开始进行直播频道的播放之后,播放器还可以判断预设时间是否到达;在判断到预设时间到达的情况下,播放器根据预设时间和预设时长,矫正对直播频道的播放进度。在媒体流的播放过程中,由于网络原因等,可能会出现丢帧或者重复解析等问题,导致在一定播放时间之后,播放画面出现滞后或者超前。采用上述的矫正方式,可以在预设时间到达时对播放进度进行矫正;其中,上述的预设时间可以自由设置,既可以设置为固定播放时长之后的一个时刻,例如,每直播半小时进行一次矫正; 也可以设置为一个固定时间点,例如,每个整点或者半点到达时进行一次矫正。Optionally, after the player starts playing the live channel from the playing position, the player may further determine whether the preset time is reached; and when determining that the preset time arrives, the player according to the preset time and the preset duration Correct the progress of the live channel. During the playback of the media stream, due to network reasons, etc., problems such as frame dropping or repeated parsing may occur, resulting in a delay or advancement of the playback screen after a certain playback time. By adopting the above correction method, the playback progress can be corrected when the preset time arrives; wherein the preset time can be freely set, and can be set to a time after the fixed play duration, for example, once every half hour of the live broadcast. Correction It can also be set to a fixed point in time, for example, once every hour or half arrives.
可选地,播放器根据预设时间和预设时长,矫正对直播频道的播放进度包括:播放器在预设时间确定当前播放位置对应的第二时间;播放器比较预设时间与第二时间的实际时间差值与预设时长的大小关系;在判断到实际时间差值大于预设时长的情况下,播放器按照第一预设策略加快对直播频道的播放;在判断到实际时间差值小于预设时长的情况下,播放器按照第二预设策略减慢对直播频道的播放。Optionally, the player corrects the playing progress of the live channel according to the preset time and the preset duration: the player determines the second time corresponding to the current playing position at the preset time; the player compares the preset time with the second time The actual time difference is related to the preset duration; if it is determined that the actual time difference is greater than the preset duration, the player speeds up the playback of the live channel according to the first preset policy; If the duration is less than the preset duration, the player slows down the playback of the live channel according to the second preset policy.
可选地,第一预设策略是指丢弃帧的策略。例如,在对媒体文件分片进行解码的过程中,在媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据实际时间差值与预设时长之间的差值确定的。通过上述策略,可以加快对直播频道的播放,而且,由于在上述策略中,在媒体文件分片中不相邻的2个I帧之间重复丢弃帧,使得这种加快播放是平滑的,不会影响到用户的观看体验。Optionally, the first preset policy refers to a policy of dropping frames. For example, in the process of decoding a media file fragment, the frame is repeatedly discarded between two non-adjacent I frames in the media file fragment; wherein, the B frame is preferentially discarded, and is discarded without the B frame. P frame; the number of discarded frames is determined based at least on the difference between the actual time difference and the preset duration. Through the above strategy, the playback of the live channel can be speeded up, and, in the above strategy, the frame is repeatedly discarded between two I frames that are not adjacent in the media file fragment, so that the accelerated playback is smooth, not Will affect the user's viewing experience.
可选地,第二预设策略是指重复播放特定帧的策略。例如,对媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据预设时长与实际时间差值之间的差值确定的,特定帧包括以下至少之一:I帧、P帧、B帧。同样地,在上述策略中,由于对于特定帧只进行一次重复播放,因此,这种减慢播放也是平滑的,不会影响到用户的观看体验。Optionally, the second preset policy refers to a policy of repeatedly playing a specific frame. For example, performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is determined according to a difference between the preset duration and the actual time difference, and the specific frame includes at least the following One: I frame, P frame, B frame. Similarly, in the above strategy, since the playback is performed only once for a specific frame, the slow playback is smooth and does not affect the user's viewing experience.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请每个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM). The instructions include a number of instructions for causing a terminal device (which may be a cell phone, computer, server, or network device, etc.) to perform the methods described in each embodiment of the present application.
在本实施例中还提供了一种直播频道播放装置,该装置应用于播放器,用于实现上述实施例及可选实施方式,已经进行过说明的不再赘述。如以下 所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a live channel playing device is also provided, and the device is applied to the player, and is used to implement the foregoing embodiments and optional embodiments. As below As used, the term "module" can implement a combination of software and/or hardware for a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图2是根据本发明实施例的直播频道播放装置的结构框图,如图2所示,该装置包括:处理模块22、确定模块24和播放模块26;处理模块22,设置为获取索引文件,并解析索引文件中描述的媒体文件分片的分片信息,其中,分片信息包括:媒体文件分片的起始时间;确定模块24,耦合至处理模块22,设置为以起始时间为基准,确定媒体文件分片中与第一时间对应的播放位置;播放模块26,耦合至确定模块24,设置为从播放位置开始进行直播频道的播放;其中,播放器的当前时间与第一时间的时间差值为预设时长;当前时间与生成媒体文件分片的设备的时间是同步的。2 is a structural block diagram of a live channel playing device according to an embodiment of the present invention. As shown in FIG. 2, the device includes: a processing module 22, a determining module 24, and a playing module 26; and a processing module 22 configured to obtain an index file, and Parsing the fragmentation information of the media file fragmentation described in the index file, where the fragmentation information includes: a start time of the media file fragmentation; the determining module 24 is coupled to the processing module 22, and is set to be based on the start time. Determining a play position corresponding to the first time in the media file fragmentation; the playing module 26 is coupled to the determining module 24, configured to play the live channel from the play position; wherein, the current time of the player and the time of the first time The difference is the preset duration; the current time is synchronized with the time of the device that generated the fragmentation of the media file.
通过上述模块的综合作用,解决了基于HLS的直播频道播放画面不同步的问题,使得播放画面可以同步,提升了用户体验。Through the comprehensive function of the above modules, the problem that the live channel playback screen based on HLS is not synchronized is solved, so that the playback screen can be synchronized and the user experience is improved.
图3是根据本发明实施例的直播频道播放装置的可选结构框图一,在图2所示的直播频道播放装置的基础上,如图3所示,可选地,确定模块24包括:第一确定单元242,设置为根据当前时间和预设时长,确定第一时间;第二确定单元244,耦合至第一确定单元242,设置为以起始时间为基准,并结合媒体文件分片的帧率,确定媒体文件分片中与第一时间对应的播放位置。FIG. 3 is a block diagram of an optional structure of a live channel playing device according to an embodiment of the present invention. On the basis of the live channel playing device shown in FIG. 2, as shown in FIG. 3, optionally, the determining module 24 includes: a determining unit 242 is configured to determine the first time according to the current time and the preset duration; the second determining unit 244 is coupled to the first determining unit 242, and is set to be based on the starting time and combined with the media file fragmentation. The frame rate determines the playback position corresponding to the first time in the media file fragment.
图4是根据本发明实施例的直播频道播放装置的可选结构框图二,在图2所示的直播频道播放装置的基础上,如图4所示,可选地,所述装置还包括:判断模块42,耦合至播放模块26,设置为判断预设时间是否到达;矫正模块44,耦合至判断模块42,设置为在判断到预设时间到达的情况下,根据预设时间和预设时长,矫正对直播频道的播放进度。4 is a block diagram of an optional structure of a live channel playing device according to an embodiment of the present invention. On the basis of the live channel playing device shown in FIG. 2, as shown in FIG. 4, the device further includes: The determining module 42 is coupled to the playing module 26 and configured to determine whether the preset time is reached. The correcting module 44 is coupled to the determining module 42 and configured to determine the preset time and the preset time according to the preset time and the preset time length. Correct the progress of the live channel.
图5是根据本发明实施例的直播频道播放装置的可选结构框图三,在图4所示的直播频道播放装置的基础上,如图5所示,可选地,矫正模块44包括:第三确定单元442,设置为在预设时间确定当前播放位置对应的第二时间;比较单元444,耦合至第三确定单元442,设置为比较预设时间与第二时间的实际时间差值与预设时长的大小关系;第一处理单元446,耦合至比较单元444,设置为在判断到实际时间差值大于预设时长的情况下,按照第一 预设策略加快对直播频道的播放;第二处理单元448,耦合至比较单元444,设置为在判断到实际时间差值小于预设时长的情况下,按照第二预设策略减慢对直播频道的播放。FIG. 5 is a block diagram 3 of an optional structure of a live channel playing device according to an embodiment of the present invention. On the basis of the live channel playing device shown in FIG. 4, as shown in FIG. 5, optionally, the correcting module 44 includes: The third determining unit 442 is configured to determine a second time corresponding to the current playing position at the preset time; the comparing unit 444 is coupled to the third determining unit 442, and is configured to compare the actual time difference between the preset time and the second time with the pre-predetermined time The first processing unit 446 is coupled to the comparison unit 444, and is configured to be configured according to the first step when it is determined that the actual time difference is greater than the preset duration. The preset policy speeds up the playing of the live channel; the second processing unit 448 is coupled to the comparing unit 444, and is configured to slow down the live channel according to the second preset policy if it is determined that the actual time difference is less than the preset duration Play.
可选地,第一预设策略包括:在对媒体文件分片进行解码的过程中,在媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据实际时间差值与预设时长之间的差值确定的。Optionally, the first preset policy includes: repeatedly discarding frames between two non-adjacent I frames in the media file fragment in the process of decoding the media file fragment; wherein, preferentially discarding the B frame P frames are discarded without B frames; the number of discarded frames is determined based at least on the difference between the actual time difference and the preset duration.
可选地,第二预设策略包括:对媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据预设时长与实际时间差值之间的差值确定的,特定帧包括以下至少之一:I帧、P帧、B帧。Optionally, the second preset policy includes: performing a repeated play on a specific frame in the media file fragmentation; wherein, the number of the specific frames that are repeatedly played is at least a difference between the preset duration and the actual time difference. Determining, the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
可选地,上述的播放器包括:具有帧解析功能的播放装置,例如:机顶盒等。Optionally, the player described above includes: a playback device having a frame parsing function, such as a set top box or the like.
本实施例还提供了一种直播频道播放系统,图6是根据本发明实施例的直播频道播放系统的结构示意图,如图6所示,该系统包括:机顶盒62、内容分发网络64、时间同步源66,其中:This embodiment also provides a live channel playing system. FIG. 6 is a schematic structural diagram of a live channel playing system according to an embodiment of the present invention. As shown in FIG. 6, the system includes: a set top box 62, a content distribution network 64, and time synchronization. Source 66, where:
内容分发网络64,与机顶盒62连接,设置为根据直播源生成媒体文件分片和索引文件,并向机顶盒62提供媒体文件分片的下载和索引文件的更新;其中,索引文件中描述有媒体文件分片的分片信息,分片信息包括:媒体文件分片的起始时间;The content distribution network 64 is connected to the set top box 62 and configured to generate a media file fragment and an index file according to the live broadcast source, and provide the set top box 62 with the download of the media file fragment and the update of the index file; wherein the index file describes the media file. The fragmentation information of the fragment, the fragmentation information includes: the start time of the fragmentation of the media file;
机顶盒62,设置为从内容分发网络64获取索引文件,并解析分片信息;根据分片信息,获取媒体文件分片;以起始时间为基准,确定媒体文件分片中与第一时间对应的播放位置;以及从播放位置开始进行直播频道的播放;其中,机顶盒62的当前时间与第一时间的时间差值为预设时长;The set top box 62 is configured to obtain an index file from the content distribution network 64, and parse the fragmentation information; obtain the media file fragment according to the fragmentation information; and determine, according to the start time, the media file fragment corresponding to the first time. a playback position; and playing the live channel from the playback position; wherein the time difference between the current time of the set top box 62 and the first time is a preset duration;
时间同步源66,分别与内容分发网络64和机顶盒62连接,设置为同步机顶盒62与内容分发网络64的时间。The time synchronization source 66 is connected to the content distribution network 64 and the set top box 62, respectively, and is set to synchronize the time of the set top box 62 and the content distribution network 64.
此外,上述的机顶盒62还用于实现上述直播频道播放方法,在此将不再赘述。In addition, the set top box 62 is also used to implement the above-mentioned live channel playing method, and details are not described herein again.
需要说明的是,上述每个模块是可以通过软件或硬件来实现的,对于后 者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。It should be noted that each of the above modules can be implemented by software or hardware, and The foregoing may be implemented by, but not limited to, the above modules are all located in the same processor; or, the above modules are respectively located in multiple processors.
本发明实施例还提供了一种软件,该软件用于执行上述实施例及可选实施方式中描述的技术方案。The embodiment of the present invention further provides a software for executing the technical solutions described in the foregoing embodiments and optional implementation manners.
本发明实施例还提供了一种计算机可读存储介质。在本实施例中,上述计算机可读存储介质可以被设置为存储用于执行以下步骤的程序代码:The embodiment of the invention further provides a computer readable storage medium. In the present embodiment, the computer readable storage medium described above may be arranged to store program code for performing the following steps:
步骤S1,播放器获取媒体文件分片的分片信息,其中,分片信息包括:媒体文件分片的起始时间;In step S1, the player obtains the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
步骤S2,播放器以起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;Step S2, the player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
步骤S3,播放器从播放位置开始进行直播频道的播放;其中,播放器的当前时间与第一时间的时间差值为预设时长;当前时间与生成媒体文件分片的设备的时间是同步的。Step S3: The player starts playing the live channel from the playing position; wherein, the time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the media file fragmentation. .
可选地,在本实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the computer readable storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), and a mobile device. A variety of media that can store program code, such as hard disks, disks, or optical disks.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
下面结合可选实施例进行描述和说明。Description and description are made below in conjunction with alternative embodiments.
本申请可选实施例提供了一种解决HLS直播频道播放画面不同步问题的方法和系统,以提升用户对于HLS频道的观看体验。其中,本可选实施例提供的方法包括如下步骤:An optional embodiment of the present application provides a method and system for solving the problem that the HLS live channel playback screen is out of synchronization, so as to enhance the user's viewing experience for the HLS channel. The method provided by this alternative embodiment includes the following steps:
步骤1,CDN流媒体服务器(相当于上述内容分发网络)、机顶盒播放客户端(相当于上述的播放器),都与同一个时钟同步源进行时钟同步,确保两者之间时间完全一致。Step 1. The CDN streaming server (equivalent to the content distribution network described above) and the set-top box playing client (corresponding to the above-mentioned player) perform clock synchronization with the same clock synchronization source to ensure that the time between the two is completely the same.
步骤2,CDN流媒体服务器在进行媒体文件切割并更新m3u8索引文件时,为每个媒体文件分片增加分片创建时间属性,该分片创建时间属性表示 该媒体文件分片的实际起始时间。Step 2: When the media file is cut and the m3u8 index file is updated, the CDN streaming server adds a fragment creation time attribute for each media file fragment, and the fragment creation time attribute representation The actual start time of the media file fragmentation.
步骤3,机顶盒播放客户端进入HLS频道播放时,下载完前两个媒体文件分片后不再从第一个媒体文件分片头开始播放,而是从机顶盒播放客户端当前系统时间减去某一固定时长(比如选取两个媒体文件分片的时长)t0处来开始播放。这就有效解决了不同机顶盒播放客户端进入频道的时间差,或者由于不同网络带宽差异情况下下载快慢产生的时间差,所引起HLS频道直播画面不同步问题。Step 3: When the set-top box playing client enters the HLS channel for playing, after the first two media files are downloaded, the first media file segmentation is no longer started, but the current system time of the client is subtracted from the set-top box. The fixed duration (such as the length of the two media file fragments) t0 starts to play. This effectively solves the time difference between the different set-top box playing client entering the channel, or the time difference caused by the download speed of different network bandwidth differences, which causes the HLS channel live picture to be out of sync.
可选地,在每个整点时刻,机顶盒播放客户端按照系统本地时间减去t0的播放位置矫正,如果有滞后,那么就加快解码,直到完成滞后时间的矫正,通过这种矫正机制实现由于卡顿或者网络传输导致的播放不同步问题。Optionally, at each hour, the set-top box playing client corrects the playing position of the t0 according to the local time of the system, and if there is a lag, the decoding is accelerated until the lag time is corrected, and the correcting mechanism is implemented. The problem of playback is not synchronized caused by Caton or network transmission.
为了实现上述方法,本申请可选实施例还提供一种解决HLS直播频道播放画面不同步问题的系统,该系统包括:切割媒体文件分片以及更新索引文件的CDN流媒体服务器、下载播放并矫正不同步问题的机顶盒播放客户端,以及两者之间做时钟同步的时钟同步服务器(相当于上述时间同步源)。In order to implement the above method, an optional embodiment of the present application further provides a system for solving the problem of non-synchronization of the HLS live channel playback screen, the system comprising: cutting a media file fragment and updating the index file of the CDN streaming server, downloading and correcting The set-top box that does not synchronize the problem plays the client, and the clock synchronization server (which is equivalent to the above-mentioned time synchronization source) that performs clock synchronization between the two.
本申请可选实施例提供的解决HLS直播频道播放画面不同步问题的方法和系统,通过在CDN流媒体服务端、机顶盒播放客户端之间增加同步策略,来实现多个机顶盒播放客户端之间的直播频道画面同步,能够实现不同机顶盒播放客户端、不同网络带宽条件下,对于同一个HLS直播频道的画面同步矫正,为用户带来画面实时感更强的观看体验。The method and system for solving the problem of non-synchronization of the HLS live channel playback screen provided by the optional embodiment of the present application, by adding a synchronization policy between the CDN streaming media server and the set-top box playing client, to implement a plurality of set-top box playing clients The live channel picture synchronization can realize the synchronization correction of the picture of the same HLS live channel under different conditions of different set-top box playing client and different network bandwidth, and bring a more real-time viewing experience to the user.
下面结合附图和场景对本申请可选实施例进行描述和说明。The following describes the exemplary embodiments of the present application with reference to the accompanying drawings and the drawings.
本申请可选实施例记载一种HLS直播频道播放画面同步系统,如图7和图8所示,该系统包括机顶盒播放客户端、CDN流媒体服务器和时钟同步服务器。An optional embodiment of the present application describes an HLS live channel playback screen synchronization system. As shown in FIG. 7 and FIG. 8, the system includes a set top box playback client, a CDN streaming server, and a clock synchronization server.
其中,时钟同步服务器作为整个系统的时钟源。机顶盒播放客户端、CDN流媒体服务器都与时钟同步服务器进行时钟同步,确保机顶盒播放客户端、CDN流媒体服务器之间时钟的完全同步。Among them, the clock synchronization server serves as the clock source for the entire system. The set-top box playback client and the CDN streaming media server are clock synchronized with the clock synchronization server to ensure complete synchronization of the clock between the set-top box playing client and the CDN streaming server.
CDN流媒体服务器提供HLS直播频道的节目源,对外提供频道的m3u8索引文件以及频道媒体文件分片的下载服务,同时根据直播进程反复更新 m3u8索引,以及创建新的媒体文件分片。The CDN streaming media server provides the source of the HLS live channel, provides the m3u8 index file of the channel and the download service of the channel media file fragment, and repeatedly updates according to the live broadcast process. M3u8 indexing, as well as creating new media file shards.
如图8所示,机顶盒播放客户端包括:下载模块、编解码模块和视频呈现模块。其中,下载模块负责m3u8索引文件的下载、解析,以及m3u8索引文件中所描述的媒体文件分片的下载;编解码模块负责将媒体文件分片的ts格式进行解码,以便视频呈现模块能够将画面展现给用户,同时编解码模块还负责在整点校验发现有播放进度滞后时,做加快解码工作,以便赶上播放进度。As shown in FIG. 8, the set top box playing client includes: a downloading module, a codec module, and a video rendering module. The download module is responsible for downloading and parsing the m3u8 index file, and downloading the media file fragment described in the m3u8 index file; the codec module is responsible for decoding the ts format of the media file fragmentation, so that the video rendering module can display the screen. Displayed to the user, at the same time the codec module is also responsible for speeding up the decoding work when the whole point check finds that there is a delay in playback progress, in order to catch up with the playback progress.
基于上述的系统,本申请可选实施例还提供了一种HLS直播频道播放画面同步的方法,下面将结合以下的索引文件的示例、图9和图10对该方法进行说明。Based on the above system, an optional embodiment of the present application further provides a method for synchronizing HLS live channel playback pictures. The method will be described below with reference to the following examples of index files, FIG. 9 and FIG.
其中,索引文件的示例如下所示:Among them, an example of an index file is as follows:
Figure PCTCN2016092714-appb-000001
Figure PCTCN2016092714-appb-000001
CDN流媒体服务器在提供的HLS直播频道的m3u8索引文件中,增加每个媒体文件分片的生成时间描述信息,生成时间描述信息采用#EXT-X-PROGRAM-DATE-TIME参数描述。生成时间描述信息,将作为不同机顶盒播放客户端在完成下载后进行播放时保证播放画面同步的基准,也将作为机顶盒播放客户端在持续播放过程中保持播放画面同步的基准。The CDN streaming server increases the generation time description information of each media file fragment in the m3u8 index file of the provided HLS live channel, and generates time description information using the #EXT-X-PROGRAM-DATE-TIME parameter description. The time description information is generated, which will serve as a reference for ensuring the synchronization of the playback screen when the different set-top box playback client plays after the download is completed, and will also serve as a reference for the set-top box playback client to keep the playback screen synchronized during the continuous playback.
图9所示为机顶盒播放客户端根据用户指令进入HLS直播频道播放时的业务流程。如图9所示,首先,机顶盒播放客户端向CDN流媒体服务器查询HLS直播频道的播放地址;CDN流媒体服务器根据请求返回HLS直播频道的m3u8索引文件的文件传输协议(FTP,File Transfer Protocol)下载地址; 机顶盒播放客户端根据FTP下载地址下载第一个m3u8索引文件;机顶盒播放客户端对第一个m3u8索引文件进行解析,获得索引文件中所描述的HLS直播频道的媒体文件分片,以及每个媒体文件分片的播放时长、每个媒体文件分片的生成时间(即上述的EXT-X-PROGRAM-DATE-TIME时间);机顶盒播放客户端根据自身系统时间减去t0(例如可以选取t0的值为两个媒体文件分片的时长),作为出本次播放的起始时刻;机顶盒播放客户端打开第一个媒体文件分片,跳转到该起始时刻开始播放。FIG. 9 shows a business process when the set-top box playing client enters the HLS live channel according to the user instruction. As shown in FIG. 9, first, the set-top box playing client queries the CDN streaming server for the playing address of the HLS live channel; and the CDN streaming server returns the file transfer protocol (FTP, File Transfer Protocol) of the m3u8 index file of the HLS live channel according to the request. download link; The set-top box playing client downloads the first m3u8 index file according to the FTP download address; the set-top box playing client parses the first m3u8 index file, obtains the media file fragment of the HLS live channel described in the index file, and each media The playback duration of the file fragment, the generation time of each media file fragmentation (ie, the EXT-X-PROGRAM-DATE-TIME time described above); the set-top box playback client subtracts t0 according to its own system time (for example, the value of t0 can be selected) As the starting time of the two media files, as the starting time of the current playback; the set-top box playing client opens the first media file fragment, and jumps to the starting moment to start playing.
如图10所示,机顶盒播放客户端在正常播放HLS频道的媒体文件分片过程中,遇到时钟整点时,校验媒体文件当前播放位置与机顶盒播放客户端自身系统时间的差异,是否存在播放延时。如当前正在播放某媒体文件分片至t1位置处,则取该媒体文件分片的生成时间t2(前述EXT-X-PROGRAM-DATE-TIME时间属性),则当前播放位置即为t3=t2+t1。比较机顶盒播放客户端自身系统时间t4与t3之间的差值t5=t4-t3,与图9中t0相比较:As shown in FIG. 10, in the process of media file fragmentation of the normal playing HLS channel, the set-top box playing client checks whether the current playing position of the media file and the system time of the set-top box playing the client itself are different when the clock is in the whole point. Playback delay. If a media file fragment is currently being played to the t1 position, the generation time t2 of the media file fragment (the aforementioned EXT-X-PROGRAM-DATE-TIME time attribute) is taken, and the current playback position is t3=t2+. T1. Compare the difference between the set-top box playback client's own system time t4 and t3 t5=t4-t3, compared with t0 in Figure 9:
A、如果t5>t0,则表示该机顶盒播放客户端在当前HLS频道播放过程中存在延时,需要加速解码展示。机顶盒播放客户端根据t5与t0的差值,控制编解码模块按照策略丢弃一定数量的视频帧来赶上播放进度。A. If t5>t0, it means that the set-top box playing client has a delay in the current HLS channel playing process, and needs to accelerate the decoding display. The set-top box playing client controls the codec module to discard a certain number of video frames according to the strategy according to the difference between t5 and t0 to catch up with the playing progress.
可选地,上述的策略包括:Optionally, the above strategies include:
a1、不在相邻的2个I帧之间重复丢弃帧;A1: Do not repeatedly discard frames between two adjacent I frames;
a2、每次丢帧,优先丢弃最近的B帧;没有B帧的情况下,丢弃P帧;A2, each time the frame is dropped, the nearest B frame is discarded first; if there is no B frame, the P frame is discarded;
a3、本次丢帧数量,根据t5与t0之间的差值,与媒体文件压缩比计算出来;A3. The number of dropped frames is calculated according to the difference between t5 and t0 and the compression ratio of the media file;
根据该策略实现丢帧赶上播放进度,对用户的播放体验的影响可以忽略,视频上不会出现明显的错位感。According to the strategy, the frame loss is matched to the playback progress, and the impact on the user's playback experience can be neglected, and there is no obvious misalignment on the video.
B、如果t5=t0,则表示该机顶盒播放客户端在当前HLS频道播放过程中不存在延时,不需要额外同步调整,正常下载和播放即可。B. If t5=t0, it means that the set-top box playing client does not have a delay during the current HLS channel playing, and does not need additional synchronization adjustment, and can normally download and play.
C、如果t5<t0,则表示该机顶盒播放客户端在当前HLS播放过程中存在跳帧导致的播放进度过快,需要延缓播放进度。机顶盒播放客户端根据t0与 t5的差值,控制编解码模块按照策略补偿一定数量的视频帧来延缓等待播放进度,其中,所谓补偿,即对某一帧做一次重复播放。C. If t5 < t0, it means that the playback progress of the set-top box playing client caused by the frame skipping during the current HLS playback is too fast, and the playback progress needs to be delayed. The set top box plays the client according to t0 and The difference of t5 controls the codec module to compensate for a certain number of video frames according to the strategy to delay the waiting for playing progress. The so-called compensation means that a certain frame is repeatedly played.
可选地,上述的策略包括:Optionally, the above strategies include:
c1,每一个原始帧,只能做一次补偿;C1, each original frame can only be compensated once;
c2,所补偿的原始帧,可以是I帧、P帧或B帧,没有强制要求;C2, the original frame compensated may be an I frame, a P frame or a B frame, and there is no mandatory requirement;
c3,本次补偿帧的数量,根据t0与t5之间的差值,与媒体文件压缩比计算出来;C3, the number of compensation frames in this time is calculated according to the difference between t0 and t5 and the compression ratio of the media file;
根据以上丢弃帧或补偿帧策略实现播放进度同步,对用户的播放体验的影响可以忽略,视频上不会出现明显的跳跃或延时感。According to the above discarding frame or compensating frame strategy, the playback progress synchronization is realized, and the influence on the user's playing experience can be neglected, and there is no obvious jump or delay in the video.
如图11至图14所示,为不同机顶盒播放客户端(简称客户端),在不同网络带宽条件下的多个组合,通过本申请可选实施例提供的方法解决HLS直播频道播放画面不同步问题的不同实施例。下面将逐一介绍。As shown in FIG. 11 to FIG. 14 , for a different set-top box playing client (referred to as a client), multiple combinations under different network bandwidth conditions, the method provided by the optional embodiment of the present application is used to solve the unsynchronized playback scene of the HLS live channel. Different embodiments of the problem. The following will be introduced one by one.
图11所示例,客户端1和客户端2是相同型号的机顶盒。客户端1,处于网络带宽1条件下;客户端2,处于网络带宽2条件下。客户端1与客户端2在同一时刻t1发起对同一个HLS直播频道的观看请求,由于带宽差异,客户端1相对较快地于t2时刻下载完该HLS直播频道的m3u8索引文件以及所描的前两个媒体文件分片;客户端2相对较慢地于t3时刻下载完该HLS直播频道的m3u8索引文件以及所描的前两个媒体文件分片。In the example shown in FIG. 11, the client 1 and the client 2 are set top boxes of the same model. Client 1, in the network bandwidth 1 condition; client 2, in the network bandwidth 2 condition. The client 1 and the client 2 initiate a viewing request for the same HLS live channel at the same time t1. Due to the bandwidth difference, the client 1 downloads the m3u8 index file of the HLS live channel and the described description relatively quickly at time t2. The first two media files are fragmented; the client 2 downloads the m3u8 index file of the HLS live channel and the first two media file fragments described at t3 relatively slowly.
如果这两个客户端都从所下载到的第一个媒体文件分片的开头处进行播放,势必出现客户端1的播放画面比客户端2的播放画面更早的不同步问题。If both clients are playing from the beginning of the first media file fragment downloaded, it is inevitable that the playback screen of the client 1 is earlier than the playback screen of the client 2.
采用本发明实施例的方法,客户端1在t2时刻完成下载后,从客户端1当前时刻t2减去固定时长t0(如前述),即从t2-t0处进行播放,到了t3时刻,客户端1的播放画面位于t2-t0+(t3-t2)=t3-t0位置;此时客户端2正好完成下载,并从客户端2当前时刻t3减去固定时长t0(如前述),即从t3-t0处进行播放,正好与客户端1的播放位置一致。这就保证了客户端1和客户端2在不同网络带宽条件下,同时进入同一个HLS直播频道时的播放画面同步。With the method of the embodiment of the present invention, after completing the download at time t2, the client 1 subtracts the fixed duration t0 (as described above) from the current time t2 of the client 1, that is, plays from t2-t0, and reaches the client at time t3. The playback screen of 1 is located at t2-t0+(t3-t2)=t3-t0; at this time, client 2 just completes the download, and subtracts the fixed duration t0 (as described above) from the current time t3 of client 2, that is, from t3- The playback is performed at t0, which coincides with the playback position of the client 1. This ensures that the client 1 and the client 2 synchronize the playback picture when entering the same HLS live channel under different network bandwidth conditions.
图12所示例,客户端1和客户端2,是两个相同型号的且处于相同网络 带宽1条件下。客户端1于较早时刻t1开始请求某一HLS直播频道,于t3时刻完成m3u8索引文件以及其中所描述的前两个媒体文件分片的下载;客户端2于较晚时刻t2开始请求同一HLS直播频道,于t4时刻完成m3u8索引文件以及其中所描述的前两个媒体文件分片的下载。客户端1的播放时刻是t3-t0,到达t4时刻时,客户端1的播放位置是t3-t0+(t4-t3)=t4-t0;客户端2的播放时刻是t4-t0,正好与客户端1的播放位置一致。这就保证了客户端1和客户端2在处于相同网络带宽条件下,不同时刻进入同一个HLS直播频道播放时的播放画面同步。In the example shown in Figure 12, client 1 and client 2 are two identical models and are on the same network. Under the condition of bandwidth 1. The client 1 starts to request a certain HLS live channel at an earlier time t1, and completes the download of the m3u8 index file and the first two media file fragments described therein at time t3; the client 2 requests the same HLS at a later time t2. The live channel completes the download of the m3u8 index file and the first two media file fragments described therein at time t4. The playback time of client 1 is t3-t0. When it reaches time t4, the playback position of client 1 is t3-t0+(t4-t3)=t4-t0; the playback time of client 2 is t4-t0, just like the client. The playback position of the end 1 is the same. This ensures that the client 1 and the client 2 are synchronized to the playback screen when playing the same HLS live channel at different times under the same network bandwidth condition.
图13所示例,客户端1和客户端2,是两个相同型号的且处于相同网络带宽1条件下。客户端1于t1时刻开始请求某一HLS直播频道的高清版,于t3时刻完成m3u8索引文件以及其中所描述的前两个高清媒体文件分片的下载;客户端2于相同时刻t1开始请求同一HLS直播频道的标清版,由于标清版媒体分片文件较小,占用下载时间较短,因此于t3时刻之前的t2完成m3u8索引文件以及其中所描述的前两个标清媒体文件分片的下载。客户端2的播放时刻是t2-t0,到达t3时刻时,客户端2的播放位置是t2-t0+(t3-t2)=t3-t0;客户端1的播放时刻是t3-t0,正好与客户端2的播放位置一致。这就保证了客户端1和客户端2在处于相同网络带宽条件下,对同一HLS直播频道的高清和标清版频道的播放画面同步。In the example shown in FIG. 13, client 1 and client 2 are two identical models and are in the same network bandwidth 1 condition. Client 1 starts to request the HD version of a certain HLS live channel at time t1, and completes the download of the m3u8 index file and the first two HD media file fragments described therein at time t3; client 2 requests the same at the same time t1. The standard definition version of the HLS live channel, because the SD media segment file is small, takes up a short download time, so the m3u8 index file and the download of the first two SD media file segments described therein are completed at t2 before t3. The playback time of client 2 is t2-t0. When t3 is reached, the playback position of client 2 is t2-t0+(t3-t2)=t3-t0; the playback time of client 1 is t3-t0, just like the client. The playback position of the end 2 is the same. This ensures that Client 1 and Client 2 synchronize the playback pictures of the HD and SD channels of the same HLS live channel under the same network bandwidth conditions.
图14所示例,客户端1和客户端2,是两个相同型号的机顶盒。客户端1,处于带宽条件一般的网络带宽1条件下;客户端2,处于带宽条件更好网络带宽2条件下。两个客户端都在观看同一个HLS直播频道,且在t1时刻,两个客户端的播放位置相同,画面同步。经过一段时间后,由于网络带宽1的带宽限制,出现了下载跟不上,播放进度滞后的状况。在某一整点时刻t2,客户端2处于正常播放位置,而客户端1相对滞后,此时出现了两者之间的播放画面不同步。采用本发明实施例的方法,客户端1在整点时刻,检查发现播放位置与当前设备时间(t2)减去固定时长(t0)相比存在滞后,则客户端1自身加快解码播放,赶上正常播放进度,保持与标准播放画面一致。In the example shown in FIG. 14, client 1 and client 2 are two set top boxes of the same model. Client 1, under the condition of network bandwidth 1 with normal bandwidth conditions; client 2, under the condition of better bandwidth of network bandwidth 2. Both clients are watching the same HLS live channel, and at time t1, the two clients play the same position and the pictures are synchronized. After a period of time, due to the bandwidth limitation of the network bandwidth 1, there is a situation in which the download cannot keep up and the playback progress is delayed. At a certain hour t2, the client 2 is in the normal play position, and the client 1 is relatively lagging. At this time, the play picture between the two is out of sync. With the method of the embodiment of the present invention, the client 1 checks that the playback position is delayed compared with the current device time (t2) minus the fixed duration (t0) at the hour, and the client 1 itself speeds up the decoding and plays. The normal playback progress is consistent with the standard playback screen.
本领域的技术人员应该明白,上述的本申请的模块或步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算 装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成单个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Those skilled in the art will appreciate that the modules or steps of the present application described above can be implemented with a general purpose computing device that can be centralized on a single computing device or distributed across multiple computations. Optionally, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different The steps shown or described herein are performed sequentially, or they are separately fabricated into a single integrated circuit module, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the application is not limited to any particular combination of hardware and software.
以上所述仅为本申请的可选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only an optional embodiment of the present application, and is not intended to limit the present application, and various changes and modifications may be made to the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application are intended to be included within the scope of the present application.
工业实用性Industrial applicability
本申请实施例提供一种直播频道播放方法、装置及系统,解决了基于HLS的直播频道播放画面不同步的问题,使得播放画面可以同步,提升了用户体验。 The embodiment of the present invention provides a live channel playing method, device, and system, which solves the problem that the live channel playback screen based on the HLS is not synchronized, so that the playback screen can be synchronized, and the user experience is improved.

Claims (13)

  1. 一种直播频道播放方法,包括:A live channel playing method includes:
    播放器获取媒体文件分片的分片信息,其中,所述分片信息包括:媒体文件分片的起始时间;The player obtains the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
    所述播放器以所述起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;The player determines, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
    所述播放器从所述播放位置开始进行直播频道的播放;The player starts playing of a live channel from the playing position;
    其中,所述播放器的当前时间与所述第一时间的时间差值为预设时长;所述当前时间与生成所述媒体文件分片的设备的时间是同步的。The time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the fragmentation of the media file.
  2. 根据权利要求1所述的方法,其中,所述播放器以所述起始时间为基准,确定获取到的所述媒体文件分片中与所述第一时间对应的所述播放位置包括:The method of claim 1, wherein the player determines, according to the start time, that the played position corresponding to the first time in the obtained media file fragment comprises:
    所述播放器根据所述当前时间和所述预设时长,确定所述第一时间;Determining, by the player, the first time according to the current time and the preset duration;
    所述播放器以所述起始时间为基准,并结合所述媒体文件分片的帧率,确定所述媒体文件分片中与所述第一时间对应的播放位置。The player determines, according to the start time, a playback position corresponding to the first time in the media file fragment according to a frame rate of the media file fragment.
  3. 根据权利要求1所述的方法,在所述播放器从所述播放位置开始进行直播频道的播放之后,所述方法还包括:The method according to claim 1, after the player starts playing the live channel from the playback position, the method further includes:
    所述播放器判断预设时间是否到达;The player determines whether the preset time has arrived;
    在判断到预设时间到达的情况下,所述播放器根据所述预设时间和所述预设时长,矫正对所述直播频道的播放进度。When it is determined that the preset time arrives, the player corrects the playing progress of the live channel according to the preset time and the preset duration.
  4. 根据权利要求3所述的方法,其中,所述播放器根据所述预设时间和所述预设时长,矫正对所述直播频道的播放进度包括:The method according to claim 3, wherein the player corrects the progress of playing the live channel according to the preset time and the preset duration:
    所述播放器在所述预设时间确定当前播放位置对应的第二时间;Determining, by the player, the second time corresponding to the current playing position at the preset time;
    所述播放器比较所述预设时间与所述第二时间的实际时间差值与所述预设时长的大小关系;The player compares the actual time difference between the preset time and the second time and the size relationship of the preset duration;
    在判断到所述实际时间差值大于所述预设时长的情况下,所述播放器按照第一预设策略加快对所述直播频道的播放; When it is determined that the actual time difference is greater than the preset duration, the player speeds up playing of the live channel according to the first preset policy;
    在判断到所述实际时间差值小于所述预设时长的情况下,所述播放器按照第二预设策略减慢对所述直播频道的播放。When it is determined that the actual time difference is less than the preset duration, the player slows down the playing of the live channel according to the second preset policy.
  5. 根据权利要求4所述的方法,其中,所述第一预设策略包括:在对所述媒体文件分片进行解码的过程中,在所述媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据所述实际时间差值与所述预设时长之间的差值确定的。The method according to claim 4, wherein the first preset policy comprises: in the process of decoding the media file fragment, two non-adjacent I in the media file fragment Repeatingly discarding frames between frames; wherein, the B frames are preferentially discarded, and the P frames are discarded without the B frames; the number of discarded frames is at least based on the difference between the actual time difference and the preset duration The value is determined.
  6. 根据权利要求4所述的方法,其中,所述第二预设策略包括:对所述媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据所述预设时长与所述实际时间差值之间的差值确定的,所述特定帧包括以下至少之一:I帧、P帧、B帧。The method according to claim 4, wherein the second preset policy comprises: performing a repeated play of a specific frame in the media file fragment; wherein the number of specific frames repeatedly played is at least according to the method Determining, by the difference between the preset duration and the actual time difference, the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
  7. 一种直播频道播放装置,应用于播放器,包括:A live channel playing device is applied to a player, including:
    处理模块,设置为获取媒体文件分片的分片信息,其中,所述分片信息包括:媒体文件分片的起始时间;The processing module is configured to obtain the fragmentation information of the fragment of the media file, where the fragmentation information includes: a start time of the fragmentation of the media file;
    确定模块,设置为以所述起始时间为基准,确定获取到的媒体文件分片中与第一时间对应的播放位置;a determining module, configured to determine, according to the start time, a play position corresponding to the first time in the obtained media file fragment;
    播放模块,设置为从所述播放位置开始进行直播频道的播放;a playing module, configured to start playing a live channel from the playing position;
    其中,所述播放器的当前时间与所述第一时间的时间差值为预设时长;所述当前时间与生成所述媒体文件分片的设备的时间是同步的。The time difference between the current time of the player and the first time is a preset duration; the current time is synchronized with the time of the device that generates the fragmentation of the media file.
  8. 根据权利要求7所述的装置,其中,所述确定模块包括:The apparatus of claim 7, wherein the determining module comprises:
    第一确定单元,设置为根据所述当前时间和所述预设时长,确定所述第一时间;a first determining unit, configured to determine the first time according to the current time and the preset duration;
    第二确定单元,设置为以所述起始时间为基准,并结合所述媒体文件分片的帧率,确定所述媒体文件分片中与所述第一时间对应的播放位置。The second determining unit is configured to determine, according to the start time, a playback position corresponding to the first time in the media file fragment, in combination with a frame rate of the media file fragment.
  9. 根据权利要求7所述的装置,所述装置还包括:The apparatus of claim 7 further comprising:
    判断模块,设置为判断预设时间是否到达;The judging module is configured to determine whether the preset time has arrived;
    矫正模块,设置为在判断到预设时间到达的情况下,根据所述预设时间 和所述预设时长,矫正对所述直播频道的播放进度。a correction module configured to determine, according to the preset time, that the preset time is reached, according to the preset time And the preset duration, correcting the playing progress of the live channel.
  10. 根据权利要求9所述的装置,其中,所述矫正模块包括:The apparatus of claim 9 wherein said correcting module comprises:
    第三确定单元,设置为在所述预设时间确定当前播放位置对应的第二时间;a third determining unit, configured to determine a second time corresponding to the current playing position at the preset time;
    比较单元,设置为比较所述预设时间与所述第二时间的实际时间差值与所述预设时长的大小关系;a comparison unit, configured to compare a size relationship between the actual time difference between the preset time and the second time and the preset duration;
    第一处理单元,设置为在判断到所述实际时间差值大于所述预设时长的情况下,按照第一预设策略加快对所述直播频道的播放;The first processing unit is configured to speed up playing of the live channel according to the first preset policy if it is determined that the actual time difference is greater than the preset duration;
    第二处理单元,设置为在判断到所述实际时间差值小于所述预设时长的情况下,按照第二预设策略减慢对所述直播频道的播放。The second processing unit is configured to slow down the playing of the live channel according to the second preset policy if it is determined that the actual time difference is less than the preset duration.
  11. 根据权利要求10所述的装置,其中,所述第一预设策略包括:在对所述媒体文件分片进行解码的过程中,在所述媒体文件分片中的不相邻的2个I帧之间重复丢弃帧;其中,优先丢弃B帧,在没有B帧的情况下丢弃P帧;所丢弃的帧的数量至少是根据所述实际时间差值与所述预设时长之间的差值确定的。The apparatus according to claim 10, wherein the first preset policy comprises: in the process of decoding the media file fragment, two non-adjacent I in the media file fragment Repeatingly discarding frames between frames; wherein, the B frames are preferentially discarded, and the P frames are discarded without the B frames; the number of discarded frames is at least based on the difference between the actual time difference and the preset duration The value is determined.
  12. 根据权利要求10所述的装置,其中,所述第二预设策略包括:对所述媒体文件分片中的特定帧进行一次重复播放;其中,重复播放的特定帧的数量至少是根据所述预设时长与所述实际时间差值之间的差值确定的,所述特定帧包括以下至少之一:I帧、P帧、B帧。The apparatus according to claim 10, wherein the second preset policy comprises: performing a repeated play of a specific frame in the media file fragment; wherein the number of specific frames repeatedly played is at least according to the Determining, by the difference between the preset duration and the actual time difference, the specific frame includes at least one of the following: an I frame, a P frame, and a B frame.
  13. 一种直播频道播放系统,包括:机顶盒、内容分发网络、时间同步源,其中,A live channel playing system includes: a set top box, a content distribution network, and a time synchronization source, wherein
    所述内容分发网络,与所述机顶盒连接,设置为根据直播源生成媒体文件分片和索引文件,并向所述机顶盒提供所述媒体文件分片的下载和所述索引文件的更新;其中,所述索引文件中描述有所述媒体文件分片的分片信息,所述分片信息包括:媒体文件分片的起始时间;The content distribution network is connected to the set top box, and is configured to generate a media file fragment and an index file according to the live broadcast source, and provide the set top box with the download of the media file fragment and the update of the index file; The fragment file includes the fragmentation information of the media file fragment, where the fragmentation information includes: a start time of the media file fragmentation;
    所述机顶盒,设置为从所述内容分发网络获取索引文件,并解析所述分片信息;根据所述分片信息,获取所述媒体文件分片;以所述起始时间为基准,确定所述媒体文件分片中与第一时间对应的播放位置;以及从所述播放 位置开始进行直播频道的播放;其中,所述机顶盒的当前时间与所述第一时间的时间差值为预设时长;The set top box is configured to obtain an index file from the content distribution network, and parse the fragmentation information; obtain the fragment of the media file according to the fragmentation information; and determine the location based on the start time a playback position corresponding to the first time in the media file fragment; and from the playing The location starts to play the live channel; wherein, the time difference between the current time of the set top box and the first time is a preset duration;
    所述时间同步源,分别与所述内容分发网络和所述机顶盒连接,设置为同步所述机顶盒与所述内容分发网络的时间。 The time synchronization source is respectively connected to the content distribution network and the set top box, and is set to synchronize the time of the set top box and the content distribution network.
PCT/CN2016/092714 2015-08-18 2016-08-01 Playing method, device and system for live streaming channel WO2017028675A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510509039.0A CN106470352B (en) 2015-08-18 2015-08-18 Live channel playing method, device and system
CN201510509039.0 2015-08-18

Publications (1)

Publication Number Publication Date
WO2017028675A1 true WO2017028675A1 (en) 2017-02-23

Family

ID=58051858

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/092714 WO2017028675A1 (en) 2015-08-18 2016-08-01 Playing method, device and system for live streaming channel

Country Status (2)

Country Link
CN (1) CN106470352B (en)
WO (1) WO2017028675A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112004132A (en) * 2020-09-02 2020-11-27 北京猿力未来科技有限公司 Video synchronous playing method and device
CN115086714A (en) * 2022-06-13 2022-09-20 京东科技信息技术有限公司 Data processing method, device, equipment and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106998478B (en) * 2017-03-15 2020-12-11 海信视像科技股份有限公司 Offset correction method and device for current playlist of smart television
CN108696762A (en) * 2017-04-12 2018-10-23 中兴通讯股份有限公司 A kind of synchronous broadcast method, device and system
CN107426629B (en) * 2017-06-19 2020-06-23 网宿科技股份有限公司 Streaming media file processing method and live broadcast system
CN107277558B (en) * 2017-06-19 2020-03-31 网宿科技股份有限公司 Player client, system and method for realizing synchronization of live video
CN108260024B (en) * 2018-04-12 2020-06-12 腾讯科技(深圳)有限公司 Live broadcast data processing method and device, computer equipment and storage medium
CN108769734B (en) * 2018-05-15 2020-09-04 安徽赛安安全技术有限公司 Method for adjusting live broadcast real-time progress based on BS (browser/server) structure network and control system thereof
CN111031338B (en) * 2019-12-17 2021-09-28 杭州当虹科技股份有限公司 Method for improving on-line information source rate abnormity
CN113696728A (en) * 2021-08-24 2021-11-26 中国第一汽车股份有限公司 Alarm control method, device, equipment and storage medium for vehicle instrument

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685554A (en) * 2012-05-24 2012-09-19 北京国双科技有限公司 Method and device for processing video play
CN104661041A (en) * 2013-11-25 2015-05-27 乐视网信息技术(北京)股份有限公司 Live broadcast time shift positioning method, server, terminal and communication system
US9066131B1 (en) * 2003-04-30 2015-06-23 The Directv Group, Inc. Advertising spots for fast-forward play

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491430B (en) * 2012-06-12 2016-12-14 联想(北京)有限公司 Streaming medium data processing method and electronic equipment
CN103685264A (en) * 2013-12-06 2014-03-26 乐视致新电子科技(天津)有限公司 Method, client side and system for broadcasting media fragmentations in turn
US9560312B2 (en) * 2013-12-11 2017-01-31 Cellco Partnership Time synchronization of video and data inside a mobile device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9066131B1 (en) * 2003-04-30 2015-06-23 The Directv Group, Inc. Advertising spots for fast-forward play
CN102685554A (en) * 2012-05-24 2012-09-19 北京国双科技有限公司 Method and device for processing video play
CN104661041A (en) * 2013-11-25 2015-05-27 乐视网信息技术(北京)股份有限公司 Live broadcast time shift positioning method, server, terminal and communication system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112004132A (en) * 2020-09-02 2020-11-27 北京猿力未来科技有限公司 Video synchronous playing method and device
CN115086714A (en) * 2022-06-13 2022-09-20 京东科技信息技术有限公司 Data processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106470352A (en) 2017-03-01
CN106470352B (en) 2020-04-07

Similar Documents

Publication Publication Date Title
WO2017028675A1 (en) Playing method, device and system for live streaming channel
JP6783293B2 (en) Synchronizing multiple over-the-top streaming clients
US10230958B2 (en) Audio splitting with codec-enforced frame sizes
CN109714634B (en) Decoding synchronization method, device and equipment for live data stream
EP2391086B1 (en) Method and apparatus for playing live content
US11758209B2 (en) Video distribution synchronization
US9438657B2 (en) Efficient video delivery
US9148707B2 (en) System and method to provide out-of-band broadcast trigger synchronization and communication to insertion devices
US10638180B1 (en) Media timeline management
US20200045384A1 (en) Viewer importance adaptive bit rate delivery
US11201903B1 (en) Time synchronization between live video streaming and live metadata
US10887646B2 (en) Live streaming with multiple remote commentators
US11750675B2 (en) Low latency media streaming
WO2018103696A1 (en) Media file playback method, server, client, and system
CN111447455A (en) Live video stream playback processing method and device and computing equipment
WO2015192683A1 (en) Content distribution method, device and system based on adaptive streaming technology
US20200037017A1 (en) Viewer importance adaptive bit rate delivery
WO2017185601A1 (en) Method and device for providing and downloading video
US11838451B2 (en) Reduction of startup time in remote HLS
CN113727199A (en) HLS slice rapid playing starting method
CN106331763B (en) Method for seamlessly playing fragmented media file and device for implementing method
US20170013037A1 (en) Media fragment rotation method, client and system
CN110933476A (en) HLS first screen time optimization scheme based on Relay
CN108156490B (en) Method, system and storage medium for playing back live television by using mobile terminal
KR101690153B1 (en) Live streaming system using http-based non-buffering video transmission method

Legal Events

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

Ref document number: 16836539

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16836539

Country of ref document: EP

Kind code of ref document: A1