CN110784737A - HLS protocol-based time-shifted television playing method, terminal and server - Google Patents

HLS protocol-based time-shifted television playing method, terminal and server Download PDF

Info

Publication number
CN110784737A
CN110784737A CN201911001482.1A CN201911001482A CN110784737A CN 110784737 A CN110784737 A CN 110784737A CN 201911001482 A CN201911001482 A CN 201911001482A CN 110784737 A CN110784737 A CN 110784737A
Authority
CN
China
Prior art keywords
time
video
request
terminal
file
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.)
Pending
Application number
CN201911001482.1A
Other languages
Chinese (zh)
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.)
Beijing Orient View Technology Co Ltd
Original Assignee
Beijing Orient View Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Orient View Technology Co Ltd filed Critical Beijing Orient View Technology Co Ltd
Priority to CN201911001482.1A priority Critical patent/CN110784737A/en
Publication of CN110784737A publication Critical patent/CN110784737A/en
Pending legal-status Critical Current

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/232Content retrieval operation locally within server, e.g. reading video streams from disk arrays
    • 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/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • 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, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Abstract

The embodiment of the invention provides a method, a terminal and a server for playing a time-shifted television based on an HLS protocol, wherein the method comprises the following steps: receiving a time-shifted television request periodically sent by a terminal, and recording on-demand information for representing on-demand time and channels in the time-shifted television request; acquiring corresponding video segments from a database according to a time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to a terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file; wherein, the video clips are stored in a database according to the sequence of the recording time; the live files are defined according to the standard in the HLS protocol for M3U8 files. The embodiment of the invention enables the terminal which originally only supports the HLS protocol to realize the time-shifted television service, and can greatly reduce the popularization difficulty and the popularization cost of the IPTV.

Description

HLS protocol-based time-shifted television playing method, terminal and server
Technical Field
The present invention relates to the technical field of television broadcasting, and in particular, to a method, a terminal and a server for playing time-shifted television based on an HLS protocol.
Background
In the field of IPTV (interactive web television) systems, the HLS (http Live streaming) protocol is usually used to implement Live and on-demand services, and the HLS (protocol implements the effect of playing a stream as if it were by cutting the whole stream into small media files that can be downloaded via http (hypertext transfer protocol), and then providing a matching media list file to the client, so that the client can pull the media files sequentially to play the stream.
The time-shifted television refers to a television program missed before being selected by entering a time-shifted program list through a time-shifted menu when a viewer watches a dvb (digital Video broadcasting) digital television program, and can also perform time shifting by pressing a remote controller 'back/fast forward' key in a live television broadcast process, and also can select a television program several days ago.
Currently, the Time-shift television generally adopts an rtsp (real Time Streaming protocol) protocol, and cannot adopt an HLS protocol, so that if a set-top box supporting the HLS protocol can directly support a Time-shift television service without substantial modification, the popularization difficulty and the popularization cost of the IPTV are greatly reduced.
Disclosure of Invention
Embodiments of the present invention provide a method, a server and a terminal for playing time-shifted television based on HLS protocol, which overcome the above problems or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a method for playing time-shifted television based on an HLS protocol, which is applied to a server side, and the method includes:
receiving a time-shifted television request periodically sent by a terminal, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
acquiring corresponding video segments from a database according to the time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file;
wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
Preferably, the duration of the video segment is recorded in the live broadcast file, so that the period for controlling the transmission of the time-shifted television request by the terminal is less than the duration of the video segment.
Preferably, the receiving a time-shifted television request further comprises:
receiving a live broadcast source code stream of a channel to record a video;
segmenting the video according to preset duration to obtain a plurality of video segments, wherein the name of each video segment is related to the recording time of the video segment;
and establishing an index table according to the names of the video clips.
Preferably, the time-shifted television request includes a channel and a time offset time, and the time offset time is a period of time difference;
correspondingly, the obtaining of the corresponding video clip from the database according to the time-shifted television request specifically includes:
backing the time offset time recorded in the time-shifted television request by the current time to obtain the on-demand time;
and obtaining a corresponding video clip according to the on-demand time and the channel.
Preferably, the obtaining of the corresponding video segment according to the on-demand time and the channel specifically includes:
and acquiring a historical video clip of the channel, and if one video clip exists in the historical video clip, and the on-demand time is within the time range of the video clip, taking the video clip as a video clip corresponding to the on-demand time and the channel.
In a second aspect, an embodiment of the present invention provides a method for playing time-shifted television based on an HLS protocol, which is applied to a terminal, and the method includes:
periodically sending a time-shifting television request, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifting television request;
receiving a live broadcast file sent by a server according to the time-shifted television request, and downloading a video clip according to the live broadcast file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
Preferably, the period of sending the schematic television request by the terminal is half of the duration of the video clip recorded in the live file.
Preferably, the downloading the video clip according to the live broadcast file specifically includes:
comparing the live broadcast file obtained in the current period with the live broadcast file obtained in the previous period, and downloading the updated video clip if the video clip in the live broadcast file obtained in the current period is updated.
In a third aspect, an embodiment of the present invention provides a server, including:
the request receiving module is used for receiving a time-shifted television request periodically sent by a terminal, and on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
the file sending module is used for acquiring corresponding video segments from a database according to the time-shifted television request, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file;
wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
In a fourth aspect, an embodiment of the present invention provides a terminal, including:
the request sending module is used for periodically sending a time-shifted television request, and on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
the file receiving module is used for receiving a live broadcast file sent by the server according to the time-shifted television request and downloading a video clip according to the live broadcast file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
In a fifth aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method as provided in the first or second aspect.
In a sixth aspect, embodiments of the present invention provide a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method as provided in the first or second aspect.
According to the method, the terminal and the server for playing the time-shifted television based on the HLS protocol, the recorded video segments are stored in the database according to the time sequence, when the time-shifted television request periodically sent by the terminal is received, the video segments corresponding to the on-demand information are recorded in the M3U8 file in the HLS protocol mode by using the HLS protocol, so that the terminal downloads the related video segments, the terminal originally only supporting the HLS protocol realizes the time-shifted television service, namely, the protocol is not expanded, a new protocol is not redefined, and the popularization difficulty and the popularization cost of the IPTV can be greatly reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for playing time-shifted television based on HLS protocol at a server side according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for playing time-shifted television based on HLS protocol at a terminal side according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow diagram of a server-side method for playing time-shifted television based on HLS protocol according to an embodiment of the present invention, as shown in fig. 1, the method includes S101 and S102, specifically:
s101, receiving a time-shifted television request periodically sent by a terminal, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request.
It should be noted that, the server according to the embodiment of the present invention receives the time-shifted television request periodically transmitted by the terminal, and the terminal transmits the time-shifted television request, so as to achieve the purpose of informing the server that it is desired to play the time-shifted television. It can be understood that the on-demand time is a historical time, for example, the current time is 00 minutes 00 seconds at 9 o 'clock at 11 o' clock in 2019, the on-demand time is a time before the current time, the channel refers to a channel of a television program, for example, CCTV-1, CCTV-5, a south of lake satellite television and a sky satellite television all belong to the channel, and the server can know that the terminal wants to play a specific channel at a specific time by receiving a time-shift television request.
S102, acquiring corresponding video segments from a database according to the time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file.
It should be noted that the video segments of the embodiment of the present invention are stored in the database according to the sequence of the recording time, and it can be understood that each video segment corresponds to a moment during recording, so that the on-demand time required by the terminal is obtained through the time-shifted television request, and then the video segments of the corresponding time are found according to the on-demand time, so as to obtain the start segment, and then a certain number of video segments are collected from the start segment to construct the live broadcast file. For example, the on-demand time is learned by a time-shift television request to be 10/1/10 00/sec in 2019, the start time of a closest video segment is found in the database to be 59/55/sec at 9/1/10/01/05/sec at 2019, the video segment can be used as a start segment, and 5 video segments are collected from the video segment according to a time sequence, so that a live broadcast file is constructed.
The live file of the embodiment of the invention is defined according to the standard of the HLS protocol about the M3U8 file. The M3U8 file of HLS records a list of TS (transport stream) packets, that is, tells the terminal that these TS packets can be played, and the M3U8 file is also an address through which the terminal can download the relevant TS packets. In the embodiment of the present invention, one video clip is one TS packet.
According to the embodiment of the invention, the recorded video segments are stored in the database according to the time sequence, when a time-shifted television request periodically sent by the terminal is received, the video segments corresponding to the on-demand information are recorded in the M3U8 file in the HLS protocol mode by utilizing the HLS protocol, so that the terminal downloads the related video segments, the terminal originally only supporting the HLS protocol realizes the time-shifted television service, namely, the protocol is not expanded, a new protocol is not redefined, and the popularization difficulty and the popularization cost of the IPTV can be greatly reduced.
On the basis of the above embodiments, as an optional embodiment, the duration of the video segment is recorded in the live broadcast file, so that the period for controlling the transmission of the time-shift television request by the terminal is less than the duration of the video segment.
It should be noted that, when the existing HLS protocol is used for live broadcast and on-demand service, the terminal usually sends a request to the server based on a preset period, and the preset period does not change with the time length change of a video clip generated when the server records and broadcasts. If the duration of the video clip is longer than the preset period, an accident will not occur generally, but if the length of the video clip is shorter than the preset period, an accident will occur that the terminal has not yet requested the next video clip after the video clip is played, and then the terminal is played. Therefore, the embodiment of the invention can avoid the accidents by determining the period for sending the time-shifted television request according to the duration of the video segments, and the period for sending the time-shifted television request is less than the duration of the video segments.
On the basis of the above embodiments, as an alternative embodiment, before receiving the time-shifted television request, the method further includes:
receiving a live broadcast source code stream of a channel to record a video;
segmenting the video according to preset duration to obtain a plurality of video segments, wherein the name of each video segment is related to the recording time of the video segment;
and establishing an index table according to the names of the video clips.
It should be noted that the server according to the embodiment of the present invention segments the recorded video, so as to provide a basis for implementing time-shifted television based on the HLS protocol, and the name of each video segment is related to the recording time of the video segment, for example, the recording time of the first video frame of each video segment may be used as the name of the video segment.
On the basis of the above embodiments, as an alternative embodiment, the time-shifted television request includes a channel and a time offset time, and the time offset time is a time difference.
It should be noted that the time offset time is a time difference, i.e., a relative time. For example, the time offset time is 5000 seconds, which means that it is desired to acquire 5000 seconds of video before a certain time.
Correspondingly, the obtaining of the corresponding video clip from the database according to the time-shifted television request specifically includes:
backing the time offset time recorded in the time-shifted television request by the current time to obtain the on-demand time;
and obtaining a corresponding video clip according to the on-demand time and the channel.
It should be noted that, because the time-shifted tv request is continuously sent to the server, the current time obtained by the server each time changes, so that the on-demand time also changes.
In an optional embodiment, the obtaining of the corresponding video segment according to the on-demand time and the channel specifically includes: and acquiring a historical video clip of the channel, and if one video clip exists in the historical video clip, and the on-demand time is within the time range of the video clip, taking the video clip as a video clip corresponding to the on-demand time and the channel.
For example, the time of video clip 1 is 2019, 10, 14, 17: 14: 10 seconds, video segment 1 next to video segment, video segment 2 time is 17: 14: 20 seconds, if the time after the current time minus the time offset is 17: 14: at 5 seconds, 5 consecutive video segments starting from video segment 1 are returned, if the time after subtracting the time offset from the current time is 17: 14: at 21 seconds, 5 consecutive video segments beginning with video segment 2 are returned.
On the basis of the foregoing embodiments, the recording a video specifically includes: determining key frames in the live broadcast source code stream, and recording videos from the key frames.
It should be noted that the recording of the video in the embodiment of the present invention is started from the key frame, and the embodiment of the present invention does not limit the selection criteria of the key frame, for example, the key frame may be an I frame or an IDR frame.
Fig. 2 is a schematic flow diagram of a terminal side of a method for playing time-shifted television based on HLS protocol according to an embodiment of the present invention, as shown in fig. 2, including S201 and S202, specifically:
s201, periodically sending a time-shifting television request, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifting television request.
It should be noted that, in the time-shifted television request periodically sent by the terminal according to the embodiment of the present invention, the terminal sends the time-shifted television request to achieve the purpose of informing the server that it is desired to play the time-shifted television. It can be understood that the on-demand time is a historical time, for example, the current time is 00 minutes 00 seconds at 9 o 'clock at 11 o' clock in 2019, the on-demand time is a time before the current time, the channel refers to a channel of a television program, for example, CCTV-1, CCTV-5, a south of lake satellite television and a sky satellite television all belong to the channel, and the server can know that the terminal wants to play a specific channel at a specific time by receiving a time-shift television request.
S202, receiving a live broadcast file sent by a server according to the time-shifted television request, and downloading a video clip according to the live broadcast file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
It should be noted that the video segments of the embodiment of the present invention are stored in the database according to the sequence of the recording time, and it can be understood that each video segment corresponds to a moment during recording, so that the on-demand time required by the terminal is obtained through the time-shifted television request, and then the video segments of the corresponding time are found according to the on-demand time, so as to obtain the start segment, and then a certain number of video segments are collected from the start segment to construct the live broadcast file. For example, the on-demand time is learned by a time-shift television request to be 10/1/10 00/sec in 2019, the start time of a closest video segment is found in the database to be 59/55/sec at 9/1/10/01/05/sec at 2019, the video segment can be used as a start segment, and 5 video segments are collected from the video segment according to a time sequence, so that a live broadcast file is constructed.
The live file of the embodiment of the invention is defined according to the standard of the HLS protocol about the M3U8 file. The M3U8 file of HLS records a list of TS (transport stream) packets, that is, tells the terminal that these TS packets can be played, and the M3U8 file is also an address through which the terminal can download the relevant TS packets. In the embodiment of the present invention, one video clip is one TS packet.
The server of the embodiment of the invention records the video segments corresponding to the on-demand information in the M3U8 file by using the HLS protocol in the mode of the HLS protocol, so that the terminal downloads the related video segments, and the terminal which originally only supports the HLS protocol realizes the time-shifted television service, namely, the protocol is not expanded, and a new protocol is not redefined, thereby greatly reducing the popularization difficulty and the popularization cost of the IPTV.
On the basis of the above embodiments, the period in which the terminal sends the schematic television request is half of the duration of the video clip recorded in the live file.
It should be noted that, when the existing HLS protocol is used for live broadcast and on-demand service, the terminal usually sends a request to the server based on a preset period, and the preset period does not change with the time length change of a video clip generated when the server records and broadcasts. If the duration of the video clip is longer than the preset period, an accident will not occur generally, but if the length of the video clip is shorter than the preset period, an accident will occur that the terminal has not yet requested the next video clip after the video clip is played, and then the terminal is played. Therefore, the embodiment of the invention can avoid the accidents by determining the period for sending the time-shifted television request according to the duration of the video segments, and the period for sending the time-shifted television request is less than the duration of the video segments.
On the basis of the foregoing embodiments, as an optional embodiment, the downloading the video clip according to the live broadcast file specifically includes:
comparing the live broadcast file obtained in the current period with the live broadcast file obtained in the previous period, and downloading the updated video clip if the video clip in the live broadcast file obtained in the current period is updated.
It should be noted that, in the embodiment of the present invention, updating of the live file is determined by the server, but the terminal determines whether to download the live file according to the received live file.
Fig. 3 is a schematic structural diagram of a server according to an embodiment of the present invention, and as shown in fig. 3, the server includes: a request receiving module 301 and a file sending module 302, wherein:
a request receiving module 301, configured to receive a time-shifted television request periodically sent by a terminal, where on-demand information used for representing on-demand time and a channel is recorded in the time-shifted television request;
the file sending module 302 is configured to obtain corresponding video segments from a database according to the time-shifted television request, use the video segments as starting segments, collect a certain number of video segments from the starting segments to construct a live broadcast file, and return the live broadcast file to the terminal, so that the terminal downloads and plays the video segments recorded in the live broadcast file;
wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
The server provided in the embodiment of the present invention specifically executes the embodiment flow of the foregoing methods for playing time-shifted television based on the HLS protocol on the server side, and please refer to the content of the embodiment of the foregoing methods for playing time-shifted television based on the HLS protocol on the server side in detail, which is not described herein again. The server stores the recorded video segments in the database according to the time sequence, and when a time-shifted television request periodically sent by the terminal is received, the video segments corresponding to the on-demand information are recorded in the M3U8 file in the HLS protocol mode by using the HLS protocol, so that the terminal downloads the related video segments, the terminal originally only supporting the HLS protocol realizes the time-shifted television service, namely, the protocol is not expanded, a new protocol is not redefined, and the popularization difficulty and the popularization cost of the IPTV can be greatly reduced.
Fig. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention, and as shown in fig. 4, the terminal includes: a request sending module 401 and a file receiving module 402, wherein:
a request sending module 401, configured to periodically send a time-shifted television request, where on-demand information used for representing on-demand time and a channel is recorded in the time-shifted television request;
a file receiving module 402, configured to receive a live file sent by a server according to the time-shifted television request, and download a video segment according to the live file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
The terminal provided in the embodiment of the present invention specifically executes the embodiment flow of the foregoing method for playing time-shifted television based on the HLS protocol on the terminal side, and please refer to the content of the above embodiment of the method for playing time-shifted television based on the HLS protocol on the terminal side in detail, which is not described herein again.
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor)510, a communication Interface (Communications Interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may invoke a computer program stored on memory 530 and operable on processor 510 to perform the method for playing time-shifted television based on the HLS protocol provided by the above embodiments, including, for example: receiving a time-shifted television request periodically sent by a terminal, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request; acquiring corresponding video segments from a database according to the time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file; wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Embodiments of the present invention further provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the method for playing time-shifted television based on the HLS protocol provided in the foregoing embodiments, for example, the method includes: receiving a time-shifted television request periodically sent by a terminal, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request; acquiring corresponding video segments from a database according to the time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file; wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for playing time-shifted television based on HLS protocol is applied to a server side, and is characterized in that the method comprises the following steps:
receiving a time-shifted television request periodically sent by a terminal, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
acquiring corresponding video segments from a database according to the time-shifted television request, taking the video segments as initial segments, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file;
wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
2. The HLS protocol-based method for playing time-shifted television according to claim 1, wherein the duration of the video segment is recorded in the live file, so that the period for the terminal to control the transmission of the time-shifted television request is shorter than the duration of the video segment.
3. The HLS protocol based method for playing time-shifted tv as claimed in claim 1, wherein the receiving the request for time-shifted tv further comprises:
receiving a live broadcast source code stream of a channel to record a video;
segmenting the video according to preset duration to obtain a plurality of video segments, wherein the name of each video segment is related to the recording time of the video segment;
and establishing an index table according to the names of the video clips.
4. The method for playing time-shifted television according to claim 1 or 3, wherein the request for time-shifted television includes a channel and a time offset, and the time offset is a time difference;
correspondingly, the obtaining of the corresponding video clip from the database according to the time-shifted television request specifically includes:
backing the time offset time recorded in the time-shifted television request by the current time to obtain the on-demand time;
and obtaining a corresponding video clip according to the on-demand time and the channel.
5. The method for playing time-shifted television according to claim 4, wherein the obtaining the corresponding video segments according to the on-demand time and the channel specifically comprises:
and acquiring a historical video clip of the channel, and if one video clip exists in the historical video clip, and the on-demand time is within the time range of the video clip, taking the video clip as a video clip corresponding to the on-demand time and the channel.
6. A method for playing time-shifted television based on HLS protocol is applied to a terminal, and the method comprises the following steps:
periodically sending a time-shifting television request, wherein on-demand information used for representing on-demand time and channels is recorded in the time-shifting television request;
receiving a live broadcast file sent by a server according to the time-shifted television request, and downloading a video clip according to the live broadcast file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
7. The HLS protocol-based method for playing time-shifted television according to claim 6, wherein the period for sending the indication television request by the terminal is half of the duration of the video segment recorded in the live file.
8. The HLS protocol-based method for playing time-shifted television according to claim 6, wherein the downloading of the video segment according to the live file specifically comprises:
comparing the live broadcast file obtained in the current period with the live broadcast file obtained in the previous period, and downloading the updated video clip if the video clip in the live broadcast file obtained in the current period is updated.
9. A server, comprising:
the request receiving module is used for receiving a time-shifted television request periodically sent by a terminal, and on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
the file sending module is used for acquiring corresponding video segments from a database according to the time-shifted television request, collecting a certain number of video segments from the initial segments to construct a live broadcast file, and returning the live broadcast file to the terminal so that the terminal downloads and plays the video segments recorded in the live broadcast file;
wherein the video segments are stored in the database according to the sequence of recording times; the live file is defined according to the standard for M3U8 files in HLS protocol.
10. A terminal, comprising:
the request sending module is used for periodically sending a time-shifted television request, and on-demand information used for representing on-demand time and channels is recorded in the time-shifted television request;
the file receiving module is used for receiving a live broadcast file sent by the server according to the time-shifted television request and downloading a video clip according to the live broadcast file;
wherein the live file is defined according to the standard of the HLS protocol for M3U8 files.
CN201911001482.1A 2019-10-21 2019-10-21 HLS protocol-based time-shifted television playing method, terminal and server Pending CN110784737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911001482.1A CN110784737A (en) 2019-10-21 2019-10-21 HLS protocol-based time-shifted television playing method, terminal and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911001482.1A CN110784737A (en) 2019-10-21 2019-10-21 HLS protocol-based time-shifted television playing method, terminal and server

Publications (1)

Publication Number Publication Date
CN110784737A true CN110784737A (en) 2020-02-11

Family

ID=69386121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911001482.1A Pending CN110784737A (en) 2019-10-21 2019-10-21 HLS protocol-based time-shifted television playing method, terminal and server

Country Status (1)

Country Link
CN (1) CN110784737A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112423047A (en) * 2020-10-27 2021-02-26 深圳Tcl新技术有限公司 Television program sharing method and device, multimedia terminal and storage medium

Citations (8)

* 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
CN102883187A (en) * 2012-09-17 2013-01-16 华为技术有限公司 Time-shift program service method, equipment and system
CN103517157A (en) * 2013-09-27 2014-01-15 武汉市烽视威科技有限公司 Method and system for achieving HLS channel time-shifting playing
CN103618912A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Live telecast time shifting method and server
CN105072458A (en) * 2015-07-23 2015-11-18 浪潮软件集团有限公司 Method for realizing time shifting in live broadcasting process of set top box based on HLS protocol
CN106572358A (en) * 2016-11-11 2017-04-19 青岛海信宽带多媒体技术有限公司 Live broadcast time shift method and client
CN107707937A (en) * 2017-09-22 2018-02-16 烽火通信科技股份有限公司 Time shift optimization method and system based on HLS protocol
CN109040769A (en) * 2018-08-22 2018-12-18 广东省南方数字电视无线传播有限公司 Direct broadcast time-shift method and device based on HLS protocol

Patent Citations (8)

* 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
CN102883187A (en) * 2012-09-17 2013-01-16 华为技术有限公司 Time-shift program service method, equipment and system
CN103517157A (en) * 2013-09-27 2014-01-15 武汉市烽视威科技有限公司 Method and system for achieving HLS channel time-shifting playing
CN103618912A (en) * 2013-11-26 2014-03-05 乐视网信息技术(北京)股份有限公司 Live telecast time shifting method and server
CN105072458A (en) * 2015-07-23 2015-11-18 浪潮软件集团有限公司 Method for realizing time shifting in live broadcasting process of set top box based on HLS protocol
CN106572358A (en) * 2016-11-11 2017-04-19 青岛海信宽带多媒体技术有限公司 Live broadcast time shift method and client
CN107707937A (en) * 2017-09-22 2018-02-16 烽火通信科技股份有限公司 Time shift optimization method and system based on HLS protocol
CN109040769A (en) * 2018-08-22 2018-12-18 广东省南方数字电视无线传播有限公司 Direct broadcast time-shift method and device based on HLS protocol

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112423047A (en) * 2020-10-27 2021-02-26 深圳Tcl新技术有限公司 Television program sharing method and device, multimedia terminal and storage medium

Similar Documents

Publication Publication Date Title
CN103348322B (en) Message processing device, information processing method and program
US9615119B2 (en) Method and apparatus for providing timeshift service in digital broadcasting system and system thereof
EP2391086B1 (en) Method and apparatus for playing live content
EP2592809B1 (en) Method and device for supporting time shift review in dynamic hypertext transfer protocol streaming transmission solution
JP5990650B2 (en) Broadcast signal processing method and apparatus including interactive broadcast service
EP2773125A1 (en) Iptv server and recorded content play method
CN102714602A (en) System and method to deliver multimedia content for display through network
CN108063769B (en) Method and device for realizing content service and content distribution network node
CN110870280B (en) Method, system, receiver and program for delivering interrupted audio content
CN105704568A (en) Method and device for realizing live broadcast time shifting
US8850474B2 (en) Virtual content store in interactive services architecture
CN103763588A (en) Stream forwarding method, device, server and system for video advertising insertion
KR101829497B1 (en) Methods and apparatuses for resuming paused media
CN113727199A (en) HLS slice rapid playing starting method
CN111787404A (en) Live stream playing method and device
CN101803379B (en) Video on demand service method, video on demand receiver, and video on demand server
KR100889836B1 (en) Broadcast terminal with synchronizing data broadcast and method of synchronizing data broadcast using same
CN106612462B (en) Fast forward and fast backward processing method and terminal
CN105812831A (en) Network program recording method, device and system and recorded program playing method and device
CN114401430A (en) Video playback method, device, server, system and storage medium
CN110784737A (en) HLS protocol-based time-shifted television playing method, terminal and server
US9924239B2 (en) Video on demand over satellite
WO2017080152A1 (en) Data synchronization method and device
CN114760485B (en) Video carousel method, system and related equipment
EP2378758A1 (en) Method for broadcasting multimedia content

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200211