[go: up one dir, main page]

CN106470352B - Live channel playing method, device and system - Google Patents

Live channel playing method, device and system Download PDF

Info

Publication number
CN106470352B
CN106470352B CN201510509039.0A CN201510509039A CN106470352B CN 106470352 B CN106470352 B CN 106470352B CN 201510509039 A CN201510509039 A CN 201510509039A CN 106470352 B CN106470352 B CN 106470352B
Authority
CN
China
Prior art keywords
time
playing
media file
preset
player
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510509039.0A
Other languages
Chinese (zh)
Other versions
CN106470352A (en
Inventor
陈志中
李锐
朱兴昌
刘学安
朱伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510509039.0A priority Critical patent/CN106470352B/en
Priority to PCT/CN2016/092714 priority patent/WO2017028675A1/en
Publication of CN106470352A publication Critical patent/CN106470352A/en
Application granted granted Critical
Publication of CN106470352B publication Critical patent/CN106470352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/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/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/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

Landscapes

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

Abstract

The invention provides a method, a device and a system for playing a live channel, wherein the method comprises the following steps: the player acquires the fragment information of the media file fragment, wherein the fragment information comprises: the starting time of the media file fragment; the player determines a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference; the player starts playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment. According to the invention, the problem that the playing pictures of the live channel based on the HLS are not synchronous is solved, so that the playing pictures can be synchronous, and the user experience is improved.

Description

Live channel playing method, device and system
Technical Field
The invention relates to the field of communication, in particular to a live channel playing method, device and system.
Background
The development of digital multimedia and networks has facilitated the user's experience of obtaining information or entertainment. People can watch live channels in a variety of ways, such as satellite television, cable television, web television, and the like. There are also various methods for providing a live video service on the internet, such as Real Time Streaming Protocol (RTSP) based Streaming media Protocol (HTTP) and HTTP based Streaming media Protocol (HTTP) based Streaming media Protocol (HLS).
The HLS protocol is a streaming media transmission protocol based on HTTP and realized by Apple Inc., can realize live broadcast and on-demand of streaming media, is mainly applied to an iOS system, and provides audio and video live broadcast and on-demand schemes for iOS equipment (such as iPhone, iPad, Mac and the like).
For HLS live broadcast, the technical characteristic requirements actually belong to progressive download type playing. The client side does not acquire a complete data stream. The server side cuts the live data stream into a plurality of continuous media file fragments (for example, in MPEG-TS format) with short duration (for example, 10 seconds), and describes the fragments through an index file (m3u8 format text) which is continuously updated. The client continuously downloads and analyzes the index file, downloads the media file fragments described in the index file according to the prompt of the index file, and continuously plays the media file fragments from the first media file fragment obtained by downloading; the server side can cut the latest live broadcast data into new small media file fragments, so that the client side can realize continuous and uninterrupted live broadcast service as long as the media file fragments obtained from the server are continuously played in sequence.
For the HLS live broadcast channel service provided in the IPTV/OTT system, when a set-top box enters a channel, a current m3u8 index file of the channel is downloaded and analyzed from a Content Delivery Network (CDN) streaming media server providing the HLS live broadcast service, and then at least 2 media file fragments are obtained by sequentially downloading the index file, and after that, continuous display and play of the media file fragments one by one is performed from the first media file fragment. This poses a problem: since the media file fragments have a fixed duration, here 10 seconds for example, the index file is also updated once in 10 seconds. Then, when 2 set-top boxes with the same model under the same network bandwidth condition enter the same channel in sequence (for example, every 2 seconds), the obtained index files are the same, and the obtained index files are played after the previous 2 media files are downloaded separately, which causes that the live broadcast pictures displayed by the 2 set-top boxes on the same channel are not synchronous at the same time, and there is a time difference, which is the time difference for entering the channel.
In addition, when 2 set top boxes with the same model under different bandwidth conditions enter the same HLS live broadcast channel to watch, due to the bandwidth difference between the downloaded m3u8 index file and the media file fragments, the consumed time is long, and the 2 set top boxes are asynchronous to the same live broadcast picture.
Aiming at the problem that playing pictures of a live channel based on HLS in the related technology are not synchronous, an effective solution is not provided at present.
Disclosure of Invention
The invention provides a live channel playing method, a live channel playing device and a live channel playing system, which are used for at least solving the problem that live channel playing pictures based on HLS in the related technology are not synchronous.
According to an aspect of the present invention, a method for playing a live channel is provided, including: the method comprises the steps that a player obtains fragmentation information of media file fragments, wherein the fragmentation information comprises: the starting time of the media file fragment; the player determines a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference; the player starts playing a live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with a time of a device that generated the media file segment.
Preferably, the determining, by the player, the playing position corresponding to the first time in the acquired media file segment with the start time as a reference includes: the player determines the first time according to the current time and the preset duration; and the player determines a playing position corresponding to the first time in the media file fragment by taking the starting time as a reference and combining with the frame rate of the media file fragment.
Preferably, after the player starts playing the live channel from the playing position, the method further includes: the player judges whether preset time is up; and under the condition that the preset time is judged to be reached, the player corrects the playing progress of the live channel according to the preset time and the preset duration.
Preferably, the correcting, by the player, the playing progress of the live channel according to the preset time and the preset duration includes: the player determines second time corresponding to the current playing position in the preset time; the player compares the actual time difference value of the preset time and the second time with the preset time length; under the condition that the actual time difference is judged to be larger than the preset time length, the player accelerates the playing of the live channel according to a first preset strategy; and when the actual time difference is judged to be smaller than the preset time length, the player slows down the playing of the live channel according to a second preset strategy.
Preferably, the first preset policy includes: in the process of decoding the media file fragment, repeatedly discarding frames between non-adjacent 2I frames in the media file fragment; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of discarded frames is determined at least based on the difference between the actual time difference and the preset time duration.
Preferably, the second preset policy includes: repeatedly playing a specific frame in the media file fragment for one time; wherein the number of specific frames repeatedly played is determined at least according to a difference between the preset time length and the actual time difference, and the specific frames include at least one of the following: i frame, P frame, B frame.
According to another aspect of the present invention, there is also provided a live channel playing apparatus, applied to a player, including: the processing module is configured to acquire segment information of a media file segment, where the segment information includes: the starting time of the media file fragment; the determining module is used for determining a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference; the playing module is used for playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with a time of a device that generated the media file segment.
Preferably, the determining module comprises: the first determining unit is used for determining the first time according to the current time and the preset time length; and the second determining unit is used for determining the playing position corresponding to the first time in the media file fragment by taking the starting time as a reference and combining the frame rate of the media file fragment.
Preferably, the apparatus further comprises: the judging module is used for judging whether the preset time is up or not; and the correction module is used for correcting the playing progress of the live channel according to the preset time and the preset duration under the condition of judging that the preset time is up.
Preferably, the orthotic module comprises: the third determining unit is used for determining second time corresponding to the current playing position in the preset time; the comparison unit is used for comparing the size relation between the actual time difference value of the preset time and the second time and the preset duration; the first processing unit is used for accelerating the playing of the live channel according to a first preset strategy under the condition that the actual time difference is judged to be larger than the preset time length; and the second processing module is used for slowing down the playing of the live channel according to a second preset strategy under the condition that the actual time difference is judged to be smaller than the preset time length.
Preferably, the first preset policy includes: in the process of decoding the media file fragment, repeatedly discarding frames between non-adjacent 2I frames in the media file fragment; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of discarded frames is determined at least based on the difference between the actual time difference and the preset time duration.
Preferably, the second preset policy includes: repeatedly playing a specific frame in the media file fragment for one time; wherein the number of specific frames repeatedly played is determined at least according to a difference between the preset time length and the actual time difference, and the specific frames include at least one of the following: i frame, P frame, B frame.
According to another aspect of the present invention, there is also provided a live channel playing system, including: the system comprises a set top box, a content distribution network and a time synchronization source, wherein the content distribution network is connected with the set top box and is used for generating media file fragments and index files according to a live broadcast source and providing the set top box with downloading of the media file fragments and updating of the index files; wherein, the index file describes the segment information of the media file segment, and the segment information includes: the starting time of the media file fragment; the set top box is used for acquiring an index file from the content distribution network and analyzing the fragment information; acquiring the media file fragments according to the fragment information; determining a playing position corresponding to first time in the media file fragment by taking the starting time as a reference; and starting to play the live channel from the playing position; the time difference value between the current time of the set top box and the first time is a preset time length; the time synchronization source is respectively connected with the content distribution network and the set-top box and is used for synchronizing the time of the set-top box and the content distribution network.
By the invention, the player is adopted to obtain the fragmentation information of the media file fragmentation, wherein the fragmentation information comprises: the starting time of the media file fragment; the player determines a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference; the player starts playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronous with the time of the equipment for generating the media file fragments, so that the problem that the playing pictures of the live broadcast channel based on the HLS are not synchronous is solved, the playing pictures can be synchronous, and the user experience is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
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 apparatus according to an embodiment of the present invention;
fig. 3 is a first schematic diagram of a preferred structure of a live channel playing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a preferred structure of a live channel playing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a preferred structure of a live channel playing apparatus 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 a synchronization system for playing pictures of HLS live channels according to a preferred embodiment of the present invention;
FIG. 8 is a second schematic diagram of a synchronization system for playing pictures of HLS live channels in accordance with a preferred embodiment of the present invention;
FIG. 9 is a schematic diagram of an index file in accordance with a preferred embodiment of the present invention;
fig. 10 is a first flowchart of a method for synchronizing the playing frames of the HLS live channel according to a preferred embodiment of the present invention;
FIG. 11 is a flowchart II of a method for synchronizing the playing frames of the HLS live channel according to the preferred embodiment of the present invention;
fig. 12 is a first view of a scene of the picture synchronization of the HLS live channel according to the preferred embodiment of the present invention;
FIG. 13 is a diagram illustrating a second scenario of picture synchronization of a HLS live channel in accordance with a preferred embodiment of the present invention;
FIG. 14 is a third view of a scene of picture synchronization of a HLS live channel in accordance with a preferred embodiment of the present invention;
fig. 15 is a diagram illustrating a fourth scenario of picture synchronization of the HLS live channel according to a preferred embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In this embodiment, a live channel playing method is provided, and 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 process includes the following steps:
step S102, the player obtains the slicing information of the media file slicing, wherein the slicing information comprises: the starting time of the media file fragment;
step S104, the player determines a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference;
step S106, the player starts to play the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment.
Through the steps, because the current time of the player is synchronous with the time of the equipment for generating the media file fragments, the starting time of the media file fragments is recorded when the media file fragments are generated; then, after the player acquires the start time of the media file segment, the player can determine a playing position corresponding to the first time in the media file segment by taking the start time as a reference, and start playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length, so that the time corresponding to the playing position of the player always lags behind the actual time by a fixed time amount whenever the player starts playing, and the picture synchronization of a plurality of players during playing of live channels is ensured. Therefore, through the steps, the problem that the playing pictures of the live broadcast channel based on the HLS are not synchronous is solved, the playing pictures can be synchronous, and the user experience is improved.
Preferably, in the HLS-based progressive live broadcast system, the fragment information of the media file fragment is issued and updated to the player through an index file, where the index file is an m3u8 index file; in addition, the player acquires the media file fragments according to the fragment information of the media file fragments described in the issued or updated index file. The start time of the media file segment refers to the real time of generating the media file segment, or the actual time represented by the content recorded in the media file segment. For example, for 1 media file slice of 10 seconds, assume that the actual content recorded is 8: 00: 00-8: 00: 10, the start time of the media file segment is 8: 00: 00.
the frame rate represents the number of frames per unit time; i.e. a media stream with a known frame rate, the number of frames per unit time is also known. Preferably, in step S104, the player may determine a first time according to the current time and a preset duration; the player determines a playing position corresponding to the first time in the media file fragment by taking the starting time as a reference and combining the frame rate of the media file fragment.
Preferably, after the player starts playing the live channel from the playing position, the player can also judge whether the preset time is reached; and under the condition that the preset time is judged to be reached, the player corrects the playing progress of the live channel according to the preset time and the preset duration. In the process of playing the media stream, problems such as frame loss or repeated analysis may occur due to network reasons, etc., so that the playing picture lags or leads after a certain playing time. By adopting the correction mode, the playing progress can be corrected when the preset time is up; the preset time can be freely set, and can be set to a moment after the fixed playing time duration, for example, correction is performed every half hour of live broadcasting; it is also possible to set a fixed time point, for example, for correction to be carried out every full or half point.
Preferably, the correcting, by the player, the playing progress of the live channel according to the preset time and the preset duration includes: the player determines a second time corresponding to the current playing position at a preset time; the player compares the actual time difference value of the preset time and the second time with the preset duration; under the condition that the actual time difference is judged to be larger than the preset time length, the player accelerates the playing of the direct broadcasting channel according to a first preset strategy; and when the actual time difference is judged to be smaller than the preset time length, the player slows down the playing of the live broadcast channel according to a second preset strategy.
Preferably, the first preset policy refers to a policy of dropping frames. For example, in decoding a media file slice, frames are repeatedly dropped between non-adjacent 2I frames in the media file slice; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of frames discarded is determined at least based on the difference between the actual time difference and the preset time duration. Through the strategy, the playing of the direct broadcasting channel can be accelerated, and meanwhile, because the frame is repeatedly discarded among the nonadjacent 2I frames in the media file fragment, the accelerated playing is smooth, and the watching experience of a user cannot be influenced.
Preferably, the second preset strategy refers to a strategy of repeatedly playing a specific frame. For example, a particular frame in a slice of a media file is played back once; the number of the specific frames which are repeatedly played is at least determined according to the difference value between the preset time length and the actual time difference value, and the specific frames comprise at least one of the following frames: i frame, P frame, B frame. Likewise, in the above strategy, since the playback is repeated only once for a particular frame, the slowing down of the playback is also smooth and does not affect the viewing experience of the user.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a live channel playing apparatus is further provided, where the apparatus is applied to a player, and is used to implement the foregoing embodiment and the preferred embodiment, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a block diagram of a live channel playing apparatus according to an embodiment of the present invention, and as shown in fig. 2, the apparatus includes: a processing module 22, a determining module 24 and a playing module 26; the processing module 22 is configured to acquire the index file and analyze fragment information of a media file fragment described in the index file, where the fragment information includes: the starting time of the media file fragment; a determining module 24, coupled to the processing module 22, configured to determine, based on the start time, a playing position corresponding to the first time in the media file segment; a playing module 26, coupled to the determining module 24, for starting playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment.
Through the comprehensive action of the modules, the problem that the playing pictures of the live channel based on the HLS are not synchronous is solved, so that the playing pictures can be synchronous, and the user experience is improved.
Fig. 3 is a block diagram of a preferred structure of a live channel playing apparatus according to an embodiment of the present invention, as shown in fig. 3, preferably, the determining module 24 includes: a first determining unit 242, configured to determine a first time according to the current time and a preset duration; the second determining unit 244 is coupled to the first determining unit 242, and configured to determine, based on the start time and in combination with the frame rate of the media file segment, a playing position corresponding to the first time in the media file segment.
Fig. 4 is a block diagram of a preferred structure of a live channel playing apparatus according to an embodiment of the present invention, as shown in fig. 4, preferably, the apparatus further includes: a determining module 42, coupled to the playing module 26, for determining whether the preset time is reached; and the correcting module 44 is coupled to the judging module 42, and is configured to correct the playing progress of the direct broadcast channel according to the preset time and the preset duration when the preset time is judged to be reached.
Fig. 5 is a block diagram of a preferred structure of a live channel playing apparatus according to an embodiment of the present invention, and as shown in fig. 5, preferably, the rectification module 44 includes: a third determining unit 442, configured to determine a second time corresponding to the current playing position at a preset time; a comparing unit 444, coupled to the third determining unit 442, for comparing a magnitude relationship between an actual time difference between the preset time and the second time and the preset duration; the first processing unit 446, coupled to the comparing unit 444, configured to accelerate playing of the direct broadcast channel according to a first preset policy when it is determined that the actual time difference is greater than the preset time duration; the second processing module 448 is coupled to the comparing unit 444, and configured to slow down the broadcast of the broadcast channel according to a second preset policy when it is determined that the actual time difference is smaller than the preset time duration.
Preferably, the first preset strategy comprises: in the process of decoding the media file fragments, repeatedly discarding frames between non-adjacent 2I frames in the media file fragments; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of frames discarded is determined at least based on the difference between the actual time difference and the preset time duration.
Preferably, the second preset strategy comprises: repeatedly playing a specific frame in the media file fragment once; the number of the specific frames which are repeatedly played is at least determined according to the difference value between the preset time length and the actual time difference value, and the specific frames comprise at least one of the following frames: i frame, P frame, B frame.
Preferably, the player described above includes: a playback apparatus having a frame parsing function, for example: set-top boxes, etc.
Fig. 6 is a schematic structural diagram of a live channel playing system according to an embodiment of the present invention, and as shown in fig. 6, the system includes: a set-top box 62, a content distribution network 64, a time synchronization source 66, wherein:
a content distribution network 64 connected to the set-top box 62 and configured to generate media file fragments and index files according to a live source, and provide the set-top box 62 with downloads of the media file fragments and updates of the index files; wherein, the index file describes the fragment information of the media file fragment, and the fragment information includes: the starting time of the media file fragment;
the set top box 62 is used for acquiring the index file from the content distribution network 64 and analyzing the fragment information; acquiring media file fragments according to the fragment information; determining a playing position corresponding to the first time in the media file fragments by taking the starting time as a reference; starting to play the live channel from the playing position; wherein, the time difference between the current time and the first time of the set-top box 62 is a preset time length;
a time synchronization source 66, respectively connected to the content distribution network 64 and the set-top box 62, for synchronizing the time of the set-top box 62 with the content distribution network 64.
In addition, the set-top box 62 is further configured to implement the live channel playing method, which will not be described herein again.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in a plurality of processors.
The embodiment of the present invention also provides software for executing the technical solutions described in the above embodiments and preferred embodiments.
The embodiment of the invention also provides a storage medium. In the present embodiment, the storage medium described above may be configured to store program code for performing the steps of:
s1, the player obtains the slicing information of the media file slicing, wherein the slicing information includes: the starting time of the media file fragment;
s2, the player determines the playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference;
s3, the player starts playing the live channel from the playing position; the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
In order that the description of the embodiments of the invention will be more apparent, reference is now made to the preferred embodiments for illustration.
The preferred embodiment of the invention provides a method and a system for solving the problem of asynchronous playing pictures of HLS live channels, so as to improve the watching experience of users on the HLS channels. The method provided by the preferred embodiment comprises the following steps:
step 1, a CDN streaming media server (equivalent to the content delivery network) and a set-top box playing client (equivalent to the player) are all clock-synchronized with the same clock synchronization source, so as to ensure that the time between the two is completely consistent.
Step 2, when the CDN streaming media server cuts the media file and updates the m3u8 index file, adding a segment creation time attribute to each media file segment, where the segment creation time attribute indicates an actual start time of the media file segment.
And 3, when the set top box playing client enters the HLS channel playing, after the first 2 media files are downloaded, the set top box does not start playing from the first media file fragment head, but starts playing by subtracting a certain fixed time length (for example, the time length for selecting 2 media files) from the current system time of the set top box playing client at t 0. The problem that live broadcast pictures of HLS channels are not synchronous due to time difference of different set top boxes entering the channels or time difference generated by downloading speed under the condition of different network bandwidth differences is effectively solved.
Preferably, at each integral point, the playing position correction of t0 is subtracted from the system local time by the set-top box playing client, if there is a lag, the decoding is accelerated until the correction of the lag time is completed, and the problem of playing asynchronization caused by jamming or network transmission is solved through the correction mechanism.
In order to implement the foregoing method, a preferred embodiment of the present invention further provides a system for solving the problem of asynchronous playing pictures of HLS live channels, where the system includes: a CDN streaming media server that cuts media file fragments and updates index files, a set-top box playing client that downloads and plays and corrects the problem of asynchronism, and a clock synchronization server (equivalent to the time synchronization source) that performs clock synchronization between the two.
The method and the system for solving the problem of asynchronous playing pictures of the HLS live broadcast channel provided by the preferred embodiment of the invention realize the picture synchronization of the live broadcast channels among a plurality of set top boxes by adding the synchronization strategy between the CDN media server and the set top box client, can realize the picture synchronization correction of the same HLS live broadcast channel under the conditions of different clients and different network bandwidths, and bring stronger watching experience of picture real-time sense to users.
The preferred embodiments of the present invention will be described and illustrated with reference to the accompanying drawings and scenarios.
A preferred embodiment of the present invention describes a synchronization system for playing pictures of HLS live channels, and as shown in fig. 7 and 8, the system includes a set-top box playing client, a CDN streaming media server, and a clock synchronization server.
The clock synchronization server is used as a clock source of the whole system. The set top box playing client and the CDN streaming media server are in clock synchronization with the clock synchronization server, so that complete synchronization of clocks between the set top box playing client and the CDN streaming media server is ensured.
The CDN streaming media server provides a program source of an HLS live channel, downloads an m3u8 index file of an externally provided channel and a channel media file fragment, repeatedly updates the m3u8 index according to a live process, and creates a new media file fragment.
As shown in fig. 8, the set-top box playing client includes: the device comprises a downloading module, an encoding and decoding module and a video presenting module. The downloading module is responsible for downloading and analyzing the m3u8 index file and downloading the media file fragment described in the m3u8 index file; the coding and decoding module is responsible for decoding the ts format of the media file fragments so that the video presentation module can present the picture to the user, and simultaneously, the coding and decoding module is also responsible for accelerating the decoding work when the integral point check shows that the playing progress is delayed so as to catch up with the playing progress.
Based on the above system, the preferred embodiment of the present invention further provides a method for synchronizing playing frames of HLS live channels, which will be described below with reference to fig. 9, fig. 10, and fig. 11.
As shown in fig. 9, the CDN streaming media server adds the generation TIME description information of each media file segment in the m3u8 index file of the HLS live channel provided, where the generation TIME description information is described by using a # EXT-X-PROGRAM-DATE-TIME parameter. And generating description information which is used as a reference for ensuring the synchronization of the playing pictures when the playing clients of different set top boxes play after finishing downloading, and is also used as a reference for keeping the synchronization of the playing pictures in the continuous playing process of the playing clients of the set top boxes.
As shown in fig. 10, the set-top box playing client enters a service flow when playing the HLS live channel according to a user instruction. Firstly, a set top box playing client inquires a playing address of an HLS live channel from a streaming media server; the CDN streaming media server returns a File Transfer Protocol (FTP) download address of an m3u8 index file of the HLS live channel according to the request; the set-top box playing client downloads a first m3u8 index file according to the FTP download address; the set-top box playing client analyzes the first m3u8 index file to obtain media file fragments of the HLS live channel described in the index file, the playing TIME of each media file fragment, and the generation TIME of each media file fragment (i.e., EXT-X-PROGRAM-DATE-TIME in fig. 9); the set-top box playing client subtracts t0 (for example, the value of t0 can be selected as the duration of 2 media file fragments) according to the system time of the set-top box playing client, and the starting time of the playing is taken; the set-top box playing client opens the first media file fragment and skips to the starting time to start playing.
As shown in fig. 11, when the set-top box playing client encounters an integral point of the clock in the process of normally playing the media file fragment of the HLS channel, it is checked whether there is a playing delay between the current playing position of the media file and the system time of the set-top box playing client. If a certain media file segment is currently played to the position t1, the generation TIME t2 of the media file segment (the EXT-X-PROGRAM-DATE-TIME attribute) is taken, and the current playing position is t3, which is t2+ t 1. Comparing the difference t5 between the playing client system time t4 and t3 of the set top box, namely t4-t3, with t0 in fig. 10:
A. if t5> t0, it indicates that there is a delay in the playing process of the current HLS channel by the set-top box playing client, and it is necessary to accelerate the decoding presentation. And the set-top box playing client controls the decoding module to discard a certain number of video frames according to the strategy to catch up with the playing progress according to the difference value between t5 and t 0.
Preferably, the above strategies include:
a1, not repeatedly dropping frames between adjacent 2I frames;
a2, discarding the nearest B frame preferentially every time of frame loss; discarding the P frame under the condition of no B frame;
a3, calculating the frame loss quantity at this time according to the difference between t5 and t0 and the compression ratio of the media file;
according to the strategy, the frame loss is achieved to catch up with the playing progress, the influence on the playing experience of a user can be ignored, and the obvious dislocation feeling cannot occur on the video.
B. If t5 is t0, it indicates that there is no delay in the playing process of the current HLS channel by the set-top box playing client, and normal downloading and playing are performed without extra synchronization adjustment.
C. If t5< t0, it indicates that the playing progress of the set-top box playing client due to frame skipping in the current HLS playing process is too fast, and the playing progress needs to be delayed. The set-top box playing client controls the decoding module to compensate a certain number of video frames according to a strategy to delay the waiting playing progress according to the difference value between t0 and t5, wherein compensation means that a certain frame is played repeatedly.
Preferably, the above strategies include:
c1, each original frame can only be compensated once;
c2, the compensated original frame can be I frame, P frame or B frame without mandatory requirement;
c3, calculating the number of the compensation frames at this time according to the difference between t0 and t5 and the compression ratio of the media file;
the playing progress synchronization is realized according to the strategy of discarding frames or compensating frames, the influence on the playing experience of a user can be ignored, and obvious jumping or delay feeling cannot occur on the video.
As shown in fig. 12 to fig. 15, different embodiments of the method provided by the preferred embodiment of the present invention for multiple combinations of different set-top box playing clients (clients for short) under different network bandwidth conditions solve the problem of asynchronous playing pictures of HLS live channels. One by one will be described below.
As illustrated in fig. 12, client 1 and client 2 are the same model set-top boxes. The client 1 is under the condition of network bandwidth 1; and the client 2 is under the condition of the network bandwidth 2. The client 1 and the client 2 initiate a viewing request for the same HLS live channel at the same time t1, and due to the bandwidth difference, the client 1 downloads the m3u8 index file of the HLS live channel and the first 2 described media file fragments at the time t2 relatively quickly; client 1 downloads the m3u8 index file of the HLS live channel and the first 2 described media file segments relatively slowly at time t 3.
If the 2 clients all play from the beginning of the downloaded first media file segment, the problem that the playing picture of the client 1 is closer and the playing picture of the client 2 is earlier asynchronous tends to occur.
After the client 1 finishes downloading at the time t2, subtracting a fixed time length t0 (as described above) from the current time t2 of the client 1, namely playing from the time t2 to t0, and when the time t3 is reached, the playing picture of the client 1 is located at the position t2 to t0+ (t3 to t2) ═ t3 to t 0; at this time, the client 2 just completes downloading, and subtracts the fixed duration t0 (as mentioned above) from the current time t3 of the client 2, i.e. playing from t3 to t0, just consistent with the playing position of the client 1. This ensures that the playing frames of the client 1 and the client 2 enter the same HLS live broadcast channel simultaneously and synchronously under different network bandwidths.
Fig. 13 illustrates that client 1 and client 2 are of the same model and are in the same network bandwidth 1 condition. Client 1 starts requesting a certain HLS live channel at earlier time t1, and completes downloading the m3u8 index file and the first 2 media file segments described therein at time t 3; client 2 starts requesting the same HLS live channel at a later time t2, and completes downloading the m3u8 index file and the first 2 media file segments described therein at time t 4. The playing time of the client 1 is t3-t0, and when the time t4 is reached, the playing position of the client 1 is t3-t0+ (t4-t3) ═ t4-t 0; the playing time of the client 2 is t4-t0, which exactly coincides with the playing position of the client 1. Therefore, the synchronization of playing pictures when the client 1 and the client 2 enter the same HLS live channel to play at different moments under the condition of the same network bandwidth is ensured.
Fig. 14 illustrates that client 1 and client 2 are of the same model and are in the same network bandwidth 1 condition. The client 1 starts to request a high-definition version of a certain HLS live channel at time t1, and completes downloading of the m3u8 index file and the first 2 high-definition media file segments described therein at time t 3; the client 2 starts to request the standard definition version of the same HLS live channel at the same time t1, and since the standard definition version media fragment file is smaller and occupies shorter download time, the m3u8 index file and the first 2 described therein are downloaded at t2 before the time t 3. The playing time of the client 2 is t2-t0, and when the time t3 is reached, the playing position of the client 2 is t2-t0+ (t3-t2) ═ t3-t 0; the playing time of the client 1 is t3-t0, which is exactly the same as the playing position of the client 2. Therefore, the client 1 and the client 2 are ensured to synchronize the playing pictures of the high-definition channel and the standard-definition channel of the same HLS live channel under the condition of the same network bandwidth.
Fig. 15 illustrates that client 1 and client 2 are two set-top boxes of the same model. The client 1 is under the condition of a network bandwidth 1 with a general bandwidth condition; the client 2 is in the network bandwidth 2 condition with better bandwidth condition. The two clients are watching the same HLS live channel, and at the time t1, the playing positions of the two clients are the same, and the pictures are synchronous. After a period of time, due to the bandwidth limitation of the network bandwidth 1, the conditions that the downloading cannot keep up and the playing progress is delayed occur. At some point in time t2, client 2 is in the normal playback position, and client 1 is relatively late, when the playback picture is out of sync between the two. By adopting the method of the invention, the client 1 checks and finds that the playing position is delayed compared with the current equipment time (t2) minus the fixed time length (t0) at the integral point time, so that the client 1 accelerates the decoding playing by itself, catches up with the normal playing progress and keeps consistent with the standard playing picture.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method for playing a streaming media network transport protocol HLS live channel is characterized by comprising the following steps:
the method comprises the steps that a player obtains fragmentation information of media file fragments, wherein the fragmentation information comprises: the starting time of the media file fragment refers to the real time for generating the media file fragment;
the player determines a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference;
the player starts playing a live channel from the playing position;
the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment;
the determining, by the player, the playing position corresponding to the first time in the acquired media file segment with the start time as a reference includes:
the player determines the first time according to the current time and the preset duration;
and the player determines a playing position corresponding to the first time in the media file fragment by taking the starting time as a reference and combining with the frame rate of the media file fragment.
2. The method of claim 1, wherein after the player starts playing the live channel from the playing position, the method further comprises:
the player judges whether preset time is up;
and under the condition that the preset time is judged to be reached, the player corrects the playing progress of the live channel according to the preset time and the preset duration.
3. The method of claim 2, wherein the player correcting the playing progress of the live channel according to the preset time and the preset duration comprises:
the player determines second time corresponding to the current playing position in the preset time;
the player compares the actual time difference value of the preset time and the second time with the preset time length;
under the condition that the actual time difference is judged to be larger than the preset time length, the player accelerates the playing of the live channel according to a first preset strategy;
and when the actual time difference is judged to be smaller than the preset time length, the player slows down the playing of the live channel according to a second preset strategy.
4. The method of claim 3, wherein the first predetermined policy comprises:
in the process of decoding the media file fragment, repeatedly discarding frames between non-adjacent 2I frames in the media file fragment; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of discarded frames is determined according to the difference between the actual time difference and the preset time duration.
5. The method of claim 3, wherein the second predetermined policy comprises:
repeatedly playing a specific frame in the media file fragment for one time; wherein the number of the specific frames repeatedly played is determined according to a difference between the preset time duration and the actual time difference, and the specific frames include one of: i frame, P frame, B frame.
6. A stream media network transmission protocol HLS live broadcast channel playing device is applied to a player and is characterized by comprising:
the processing module is configured to acquire segment information of a media file segment, where the segment information includes: the starting time of the media file fragment refers to the real time for generating the media file fragment;
the determining module is used for determining a playing position corresponding to the first time in the acquired media file fragments by taking the starting time as a reference;
the playing module is used for playing the live channel from the playing position;
the time difference value between the current time and the first time of the player is a preset time length; the current time is synchronized with the time of the device generating the media file segment;
the determining module comprises:
the first determining unit is used for determining the first time according to the current time and the preset time length;
and the second determining unit is used for determining the playing position corresponding to the first time in the media file fragment by taking the starting time as a reference and combining the frame rate of the media file fragment.
7. The apparatus of claim 6, further comprising:
the judging module is used for judging whether the preset time is up or not;
and the correction module is used for correcting the playing progress of the live channel according to the preset time and the preset duration under the condition of judging that the preset time is up.
8. The apparatus of claim 7, wherein the orthotic module comprises:
the third determining unit is used for determining second time corresponding to the current playing position in the preset time;
the comparison unit is used for comparing the size relation between the actual time difference value of the preset time and the second time and the preset duration;
the first processing unit is used for accelerating the playing of the live channel according to a first preset strategy under the condition that the actual time difference is judged to be larger than the preset time length;
and the second processing module is used for slowing down the playing of the live channel according to a second preset strategy under the condition that the actual time difference is judged to be smaller than the preset time length.
9. The apparatus of claim 8, wherein the first preset policy comprises:
in the process of decoding the media file fragment, repeatedly discarding frames between non-adjacent 2I frames in the media file fragment; preferentially discarding B frames, and discarding P frames under the condition of no B frames; the number of discarded frames is determined according to the difference between the actual time difference and the preset time duration.
10. The apparatus of claim 8, wherein the second predetermined policy comprises:
repeatedly playing a specific frame in the media file fragment for one time; wherein the number of the specific frames repeatedly played is determined according to a difference between the preset time duration and the actual time difference, and the specific frames include one of: i frame, P frame, B frame.
11. A stream media network transmission protocol HLS live broadcast channel playing system is characterized by comprising: a set-top box, a content distribution network, a time synchronization source, wherein,
the content distribution network is connected with the set top box and is used for generating media file fragments and index files according to a live broadcast source and providing the set top box with downloading of the media file fragments and updating of the index files; wherein, the index file describes the segment information of the media file segment, and the segment information includes: the starting time of the media file fragment refers to the real time for generating the media file fragment;
the set top box is used for acquiring an index file from the content distribution network and analyzing the fragment information; acquiring the media file fragments according to the fragment information; determining a playing position corresponding to first time in the media file fragment by taking the starting time as a reference; and starting to play the live channel from the playing position; the time difference value between the current time of the set top box and the first time is a preset time length;
the time synchronization source is respectively connected with the content distribution network and the set-top box and is used for synchronizing the time of the set-top box and the content distribution network.
CN201510509039.0A 2015-08-18 2015-08-18 Live channel playing method, device and system Active CN106470352B (en)

Priority Applications (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
PCT/CN2016/092714 WO2017028675A1 (en) 2015-08-18 2016-08-01 Playing method, device and system for live streaming channel

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN106470352A CN106470352A (en) 2017-03-01
CN106470352B true CN106470352B (en) 2020-04-07

Family

ID=58051858

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (12)

* 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
CN107277558B (en) * 2017-06-19 2020-03-31 网宿科技股份有限公司 Player client, system and method for realizing synchronization of live video
CN107426629B (en) * 2017-06-19 2020-06-23 网宿科技股份有限公司 Streaming media file processing method and live broadcast system
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
CN112004132B (en) * 2020-09-02 2022-10-21 北京猿力未来科技有限公司 Video synchronous playing method and device
CN113696728A (en) * 2021-08-24 2021-11-26 中国第一汽车股份有限公司 Alarm control method, device, equipment and storage medium for vehicle instrument
CN115086714B (en) * 2022-06-13 2024-08-16 京东科技信息技术有限公司 Data processing method, device, equipment and storage medium
CN116527981A (en) * 2023-05-30 2023-08-01 中国电信股份有限公司 Multipath video synchronization method, system, device and storage medium
CN118764657B (en) * 2024-06-24 2025-04-29 央视国际网络有限公司 Live broadcast method, system, device and storage medium based on media segment files

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491430A (en) * 2012-06-12 2014-01-01 联想(北京)有限公司 Streaming media data processing method and electronic device
CN103685264A (en) * 2013-12-06 2014-03-26 乐视致新电子科技(天津)有限公司 Method, client side and system for broadcasting media fragmentations in turn

Family Cites Families (4)

* 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
CN102685554B (en) * 2012-05-24 2015-09-30 北京国双科技有限公司 The processing method of video playback and device
CN104661041A (en) * 2013-11-25 2015-05-27 乐视网信息技术(北京)股份有限公司 Live broadcast time shift positioning method, server, terminal and communication system
US9560312B2 (en) * 2013-12-11 2017-01-31 Cellco Partnership Time synchronization of video and data inside a mobile device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103491430A (en) * 2012-06-12 2014-01-01 联想(北京)有限公司 Streaming media data processing method and electronic device
CN103685264A (en) * 2013-12-06 2014-03-26 乐视致新电子科技(天津)有限公司 Method, client side and system for broadcasting media fragmentations in turn

Also Published As

Publication number Publication date
CN106470352A (en) 2017-03-01
WO2017028675A1 (en) 2017-02-23

Similar Documents

Publication Publication Date Title
CN106470352B (en) Live channel playing method, device and system
CN109714634B (en) Decoding synchronization method, device and equipment for live data stream
US11758209B2 (en) Video distribution synchronization
US10638180B1 (en) Media timeline management
US11317171B2 (en) Viewer importance adaptive bit rate delivery
US9148707B2 (en) System and method to provide out-of-band broadcast trigger synchronization and communication to insertion devices
EP2665261A1 (en) Content reproduction device, content reproduction method, delivery system, content reproduction program, recording medium, and data structure
US11044507B2 (en) Viewer importance adaptive bit rate delivery
KR102469142B1 (en) Dynamic playback of transition frames while transitioning between media stream playbacks
CN109089130A (en) A kind of method and apparatus for the timestamp adjusting live video
US11750675B2 (en) Low latency media streaming
KR20170074866A (en) Receiving device, transmitting device, and data processing method
CN108092973A (en) Synchronous multiple OTT steaming transfer clients
EP2891323B1 (en) Rendering time control
KR20150027262A (en) Provision of a personalized media content
US9854019B2 (en) Method and apparatus for modifying a stream of digital content
CN113727199A (en) HLS slice rapid playing starting method
KR101610862B1 (en) Method and apparatus for inserting advertisement in streaming service
Köhnen et al. A DVB/IP streaming testbed for hybrid digital media content synchronization
CN105898435A (en) Data synchronizing method and device
CN114760485A (en) Video carousel method, system and related equipment
JP6596363B2 (en) Time mapping information generation apparatus, synchronized playback system, time mapping information generation method, and time mapping information generation program
US11856242B1 (en) Synchronization of content during live video stream
HK1212128B (en) Rendering time control

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant