CN106101752B - A kind of time shift time obtaining method and set-top box - Google Patents

A kind of time shift time obtaining method and set-top box Download PDF

Info

Publication number
CN106101752B
CN106101752B CN201610538439.9A CN201610538439A CN106101752B CN 106101752 B CN106101752 B CN 106101752B CN 201610538439 A CN201610538439 A CN 201610538439A CN 106101752 B CN106101752 B CN 106101752B
Authority
CN
China
Prior art keywords
time
packet
audio
video data
current
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
CN201610538439.9A
Other languages
Chinese (zh)
Other versions
CN106101752A (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.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia 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 Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201610538439.9A priority Critical patent/CN106101752B/en
Publication of CN106101752A publication Critical patent/CN106101752A/en
Application granted granted Critical
Publication of CN106101752B publication Critical patent/CN106101752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • 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
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
    • 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/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • 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/4305Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
    • 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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks

Landscapes

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

Abstract

The present invention relates to a kind of time shift time obtaining method and set-top boxes, wherein method includes: the benchmark audio and video data streams and benchmark time shift temporal information for receiving time-shifted service device and being sent according to time shifting broadcasting request;Receive the current audio and video data streams that the time-shifted service device issues automatically after the benchmark audio and video data streams;Determine the time difference of PCR value that the current audio and video data streams extract and the PCR value extracted in benchmark audio and video data streams;According to the time difference and the benchmark time shift temporal information, current time shift temporal information is determined.A kind of time shift time obtaining method disclosed by the invention, without frequently to the current time shift temporal information of time-shifted service device request, the phenomenon that mitigating the load of time-shifted service device, postponing so as to improve time-shifted service device return information reinforces the real-time of video window interface time refreshing.

Description

A kind of time shift time obtaining method and set-top box
Technical field
The present invention relates to time shift program technical field more particularly to a kind of time shift time obtaining methods and set-top box.
Background technique
With TV tech fast development, smart television progresses into the visual field of people, currently, the TV industry of smart television Business is divided into live television service and time shifted TV business, and live television service has synchronousness, misses some time point Program just can not review, and time shifted TV business is not limited by synchronousness, and pause, fast forward and fast reverse behaviour may be implemented Make.For example, user is watching live telecast, pressing Pause key at this time suspends picture, cuts TV programme by programme televised live Time shift program is changed to, when user restores to play again, TV programme then can continue to play in last time pause point.
In the prior art, during watching time shift program, the general lower section display program required at video window interface Time shift temporal information, wherein time shift temporal information includes time shift time range and current time shifting broadcasting time, wherein when Shift time range includes left margin time and right margin time.For example, after the live telecast that pause is being broadcast live, TV programme Time shift program is switched to by programme televised live, at this point, can show time shift time range on the video window interface of smart television Left margin time and right margin time, wherein the right margin time refers to the live streaming time of current television program, while video window Mouth interface can also show the current time shifting broadcasting time.Under normal conditions, set-top box sends RTSP (Real Time Streaming Protocol, real-time streaming transport) protocol instructions to time-shifted service device, thus obtain that time-shifted service device issues when Shift time range and current time shifting broadcasting time and the video window interface for being shown in smart television.For example, when pause live streaming section Mesh and when restoring again, alternatively, time-shifted service device is according to RTSP agreement when falling back on some time point fastly during programme televised live Time shift temporal information is sent to set-top box by instruction, and time shift temporal information is sent to smart television according to described instruction by set-top box And it is shown in video window interface, while the corresponding video frame of time shift temporal information is sequentially displayed in video window interface.For Time shift temporal information is accurately shown on video window interface, set-top box obtains time shift temporal information by RTSP protocol instructions When, set-top box can be constantly by sending RTSP protocol instructions request time shift temporal information to time-shifted service device, to refresh The time shift time range shown on video window interface and current time shifting broadcasting time.
But if set-top box travel frequently over RTSP protocol instructions to time-shifted service device request update time shift time range and The current time shifting broadcasting time, lead to the load down of time-shifted service device, while time-shifted service device load down causes time shift to take again Device information of being engaged in returns to delay, thus the real-time that the video window interface time for influencing smart television refreshes.Certainly, if time shift Server frequently receives the request of current time shifting broadcasting time that multiple set-top boxes are sent, and can further result in the negative of time-shifted service device It carries and aggravates, and then influence the real-time of video window interface time refreshing.
Summary of the invention
To overcome the problems in correlation technique, the present invention provides a kind of time shift time obtaining method and set-top box, To solve in the prior art when TV programme enter time shift program, when time-shifted service device travels frequently over the acquisition of RTSP protocol instructions Shift time information, the load down of server, meanwhile, server load causes server info to return to delay again when aggravating, from And the problem of influencing the real-time of video window interface time refreshing.
According to a first aspect of the embodiments of the present invention, a kind of time shift time obtaining method is provided, comprising:
Shift time when receiving benchmark audio and video data streams and benchmark of the time-shifted service device according to time shifting broadcasting request transmission Information;
Receive the current audio, video data that the time-shifted service device issues automatically after the benchmark audio and video data streams Stream;
The PCR for determining PCR value that the current audio and video data streams extract and being extracted in benchmark audio and video data streams The time difference of value;
According to the time difference and the benchmark time shift temporal information, current time shift temporal information is determined.
According to a second aspect of the embodiments of the present invention, a kind of set-top box is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to method described in claim 1.
The technical solution that the embodiment of the present invention provides can include the following benefits: when provided in an embodiment of the present invention Shift time acquisition methods include: to receive time-shifted service device according to the benchmark audio and video data streams and base of time shifting broadcasting request transmission Punctual shift time information;Receive the current sound view that the time-shifted service device issues automatically after the benchmark audio and video data streams Frequency data stream;The PCR for determining PCR value that the current audio and video data streams extract and being extracted in benchmark audio and video data streams The time difference of value;According to the time difference and the benchmark time shift temporal information, current time shift temporal information is determined.
Seen from the above description, time shift time obtaining method disclosed by the invention to the acquisition of time-shifted service device without frequently working as Preceding time shift temporal information sends time shifting broadcasting request, time shifting broadcasting request to time-shifted service device when entering time-shift playing state Simultaneously include obtain audio and video data streams request and benchmark time shift temporal information request, then receive benchmark audio and video data streams and Audio and video data streams later extract PCR value and as benchmark PCR value, from current audio-video from benchmark audio and video data streams PCR value is extracted in data flow, calculates the time difference between the PCR value extracted and benchmark PCR value, and the time difference is Time difference between benchmark audio and video data streams and current audio and video data streams, due to benchmark time shift temporal information and reference note Video data stream is corresponding, so, the benchmark current time shifting broadcasting time in benchmark time shift temporal information adds the time difference The as current time shifting broadcasting time, likewise, benchmark left margin time and benchmark right margin time can also be according to the times Difference calculates.
When without obtaining current time shift temporal information to time-shifted service device frequent requests, time-shifted service device can be mitigated naturally Load, thus reduce time-shifted service device return information delay the phenomenon that, and then reinforce the video window interface time refresh reality Shi Xing.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, for those of ordinary skill in the art Speech, without any creative labor, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of time shift time obtaining method provided in an embodiment of the present invention;
Fig. 2 is a kind of application scenarios structural schematic diagram provided in an embodiment of the present invention;
Fig. 3 is step S300 flow diagram provided in an embodiment of the present invention;
Fig. 4 is step S400 flow diagram provided in an embodiment of the present invention;
Fig. 5 is step S402 flow diagram provided in an embodiment of the present invention;
Fig. 6 is another time shift time obtaining method flow diagram provided in an embodiment of the present invention;
Fig. 7 is step S500 flow diagram provided in an embodiment of the present invention;
Fig. 8 is step S502 flow diagram provided in an embodiment of the present invention;
Fig. 9 is another time shift time obtaining method flow diagram provided in an embodiment of the present invention;
Figure 10 is another time shift time obtaining method flow diagram provided in an embodiment of the present invention;
Figure 11 is a kind of set-top box block diagram provided in an embodiment of the present invention;
Symbol indicates in figure:
1- time-shifted service device, 2- smart television, 3- video window interface, 4- set-top box, 401- processor, 402- storage Device, 403- power supply module, 404- multimedia component, 405- input/output interface, 406- communication component.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is after encoder carries out coding compression by the audio and video data streams that time-shifted service device end is sent to set top box side Data flow, be sent to the audio and video data streams of set top box side after decoder is decoded, extract audio and video data streams In audio/video frames, and successively play out.There is a system clock in audio/video coder, system clock is a 27MHz Clock, the sampling of signal, processing are based on this clock, this clock is used to generate the correct display of instruction audio-video With decoded timestamp.Wherein, PCR is to be placed on TS packet from the counter status sampling triggered to system clock pulse Head is transmitted from adaptation field.PCR accounts for 6Bytes altogether, and wherein 6bits is reserved, 42bits significance bit.It is two that the PCR of 42bits, which is divided to, Part: the PCR_Ext of the PCR_Base and 9bits of 33bits.PCR_Base is the 90kHz by 27MHz pulse after 300 frequency dividings Pulse-triggered counter, then counter status is sampled.PCR_Ext is by the direct flip-flop number of 27MHz pulse Device, then counter status is sampled.
Since PCR value is the sampling to the counter status of system clock pulse triggering, so PCR value indicates TS where it The corresponding encoder-side system time of audio, video data in packet, so, in time shift program, when can be calculated by PCR value The relative time that program plays is moved, to realize the update of time shift temporal information in time shift program.It is specific as follows:
Fig. 1 is a kind of flow chart of time shift time obtaining method shown according to an exemplary embodiment.
Fig. 2 is the application scenarios schematic diagram of this method.
Step S100 receives time-shifted service device according to the benchmark audio and video data streams and benchmark of time shifting broadcasting request transmission Time shift temporal information.
In conjunction with Fig. 2 it is found that when smart television 2 receives the request of the time shifting broadcasting from remote control under live state, intelligence Time shifting broadcasting request can be sent to set-top box 4 by TV 2, and time shifting broadcasting request is sent to time-shifted service device 1 by set-top box 4, The time shifting broadcasting request includes pause or fast rewinding request.For example, certain TV programme is being broadcast live when smart television 2, at this time by Pause key can be pressed in being busy with other things, the program that smart television 2 plays is switched to time shift program by programme televised live, wait finish Play button can be pressed after thing to continue to play from the place suspended just now;Alternatively, being saved during watching live streaming for live streaming Mesh is thought to watch again, at this point, can be reviewed by falling back on the realization of some time point fastly.During watching time shift program, need The video window interface 3 of smart television 2 shows time shift temporal information, and time shift temporal information includes current time shifting broadcasting time, a left side Boundary time and right margin time.
It is seamless switching between programme televised live and time shift program, the broadcasting of the imperceptible rear player of viewer is cut It changes, for example, picture suspends at this time when pressing Pause key during watching programme televised live, when after a period of time, recovery is played When, the place that TV programme can then be suspended continues to play.It is understood that programme televised live is real-time, and can not suspend, So to realize the seamless switching of programme televised live and time shift program, it is necessary to record having broadcast for a period of time at time-shifted service device end It puts program to be cached in server end, when being switched to time shift program by programme televised live, set-top box is directly obtained from time shift address Audio, video data is taken, and is sent to smart television.
The data of time-shifted service device end caching cache the sound of a hour using buffer time as unit of account under normal circumstances Video stream data, the data of caching are the audio, video datas of current live time previous hour, so, server end caching Audio, video data is dynamic change, and is changed with the variation of live streaming time.
When benchmark time shift temporal information includes benchmark current time shifting broadcasting time, benchmark left margin time and benchmark right margin Between.The benchmark current time shifting broadcasting time refers to time point being played in current time shift program, benchmark left margin time and base The quasi- right margin time is the time shift time range in video window interface display.Under normal circumstances, the benchmark left margin time is to work as At previous hour at the corresponding time point of preceding live streaming time, the benchmark right margin time is the current live time, if current time shift When play time and right margin time consistency, actual program is switched to programme televised live by time shift program.
When time shift server receives time shifting broadcasting request, time-shifted service device requests to send reference note according to time shifting broadcasting Video flowing and benchmark time shift temporal information, so, time shifting broadcasting requests while including obtaining audio and video data streams and acquisition base The request instruction of punctual shift time information, obtains audio and video data streams request and acquisition benchmark time shift temporal information request instruction is equal It is sent by RTSP agreement.Wherein, benchmark time shift temporal information is corresponding with benchmark audio/video flow, and broadcasts including the current time shift of benchmark Put time, benchmark left margin time and benchmark right margin time.When time shift server receives time shifting broadcasting request, time shift clothes Business device is sent to set-top box by the audio and video data streams pause point or rewind point, wherein first in audio and video data streams A audio and video data streams with PCR value are benchmark audio and video data streams, and benchmark time shift temporal information is and reference note video counts According to the corresponding time shift temporal information of stream.
Step S200 receives the current audio, video data that time-shifted service device issues automatically after benchmark audio and video data streams Stream.
When time-shifted service device receives time shifting broadcasting request, time-shifted service device can send next sound from trend set-top box Video data stream, meanwhile, set-top box also can constantly receive the audio and video data streams of time-shifted service device transmission.That is, working as When time-shifted service device receives time shifting broadcasting request, the played audio and video data streams of caching are sent machine by time-shifted service device In top box, in transmission process, first reference note video stream is gone out, then retransmits the sound view after benchmark audio/video flow Frequency flows, and the sequence for the audio and video data streams that set-top box can also be sent according to time-shifted service device successively receives and parses through audio-video number According to stream.
After receiving current audio and video data streams, extract PCR value from current audio and video data streams, and according to extracting The calculating of PCR value progress time difference.Step S300 determines PCR value and reference note view that current audio and video data streams extract The time difference of the PCR value extracted in frequency data stream.
When receiving benchmark audio and video data streams, PCR value is extracted from benchmark audio and video data streams.Regarded from reference note TCP packet is obtained in frequency data stream, and successively extracts TS packet from TCP packet, judges in current TS packet whether to include PCR value, when When including PCR value, PCR value is extracted as benchmark PCR value, if not including in current TS packet has PCR value, obtains next TS Packet continues to determine whether to include PCR value, until extracting benchmark PCR value.
According to the PCR extracted from the PCR value and benchmark audio and video data streams extracted in current audio and video data streams Value calculates time difference, since PCR value is the sampling of the timing to 27MHz system clock, from current audio and video data streams The PCR value extracted just corresponds to current audio and video data streams and benchmark audio and video data streams with the time difference of benchmark PCR value Time difference, so, by the time difference for calculating the PCR value and benchmark PCR value that extract from current audio and video data streams It can the real-time update current time shifting broadcasting time.
According to the method that the PCR value and benchmark PCR value that extract from current audio and video data streams calculate time difference, ginseng See Fig. 3, is a kind of step S300 flow diagram provided in an embodiment of the present invention.
Step S301 converts time value for PCR value and benchmark PCR value respectively.
From the foregoing, it can be understood that PCR is to be placed on the packet header TS from the counter status sampling triggered to system clock pulse Transmitted from adaptation field.PCR accounts for 6Bytes altogether, and wherein 6bits is reserved, 42bits significance bit.It is two that the PCR of 42bits, which is divided to, Point: the PCR_Ext of the PCR_Base and 9bits of 33bits.PCR_Base is the 90kHz arteries and veins by 27MHz pulse after 300 frequency dividings Flip-flop number is rushed, then counter status is sampled.PCR_Ext be by the direct flip-flop number of 27MHz pulse, Counter status is sampled again.Formula is as follows:
PCR_Time=PCR_Base × 300+PCR_Ext;
PCR_Ext=(system_clock_frequence) × T;
The effect of PCR_Base is to provide the initial value to decoder PCR counter when switching program, guarantees set-top box Audio-visual synchronization is held, the effect of PCR_Ext is the system clock by the phase-locked loop circuit revised decoding device of decoder end.This hair In the method that bright embodiment provides, calculate the current PCR value and benchmark PCR value extracted from current audio and video data streams when Between difference when, extract PCR value field in PCR_Base.
Such as: the calculating of field value of the System Clock time 07:12:45.56 by 27MHz pulse after 300 frequency dividings.
Time 07:12:45.56 is converted into the calculating of second:
(7 × 60+12) × 60+45.56=3285.56;
As shown from the above formula, PCR value can be converted to time value divided by 90000 for PCR value, the time value Unit is the second.
According to above-mentioned calculation formula, the PCR value extracted from current audio and video data streams and benchmark PCR value are removed respectively To be converted into corresponding time value after 90000.
The corresponding time value of PCR value time value corresponding with benchmark PCR value is made difference, obtains the time difference by step S302 Value.
By the current PCR value extracted in current audio and video data streams divided by the time value after 90000, benchmark PCR value is subtracted Divided by the time value after 90000, time difference is obtained, the time difference is working as of extracting from current audio and video data streams The time difference of the corresponding TS packet TS packet corresponding with benchmark PCR value of preceding PCR value.
For example, the PCR_Base=295700400 of benchmark PCR value, then the corresponding time value of benchmark PCR value is 3285.56s;
The PCR_Base=296410500 of the PCR value extracted from current audio and video data streams, by PCR_Base divided by After 90000, the corresponding time value of the PCR value extracted is 3293.45s.
The corresponding time value of the PCR value extracted in current audio and video data streams is subtracted into the benchmark PCR value corresponding time Value, it may be assumed that 3293.45-3285.56=7.89s, so the corresponding TS packet of the PCR value extracted from current audio and video data streams The time difference of TS packet corresponding with benchmark PCR value is 7.89s.
If it is corresponding that the corresponding time value of current PCR value extracted in current audio and video data streams subtracts benchmark PCR value Time value when being negative, illustrate that current time shift program is in fast reverse play state.
After obtaining time difference, in step S400, according to time difference and benchmark time shift temporal information, determine current Time shift temporal information.
After calculating the time difference between the PCR value extracted in benchmark PCR value and current audio and video data streams, by base Punctual shifting play time is the current time shifting broadcasting time plus the time difference, because benchmark PCR value and benchmark time shift are broadcast Time correspondence is put, so extracting according in time difference calculated current time shifting broadcasting time and current audio and video data streams PCR value it is corresponding.
Likewise, the benchmark left margin time obtains the current left margin time plus time difference, the benchmark right margin time adds The upper time difference obtains the current right margin time.Principle is identical as the calculating of current time shifting broadcasting time, no longer superfluous herein It states.
Specific embodiment is referring to fig. 4 step S400 flow diagram provided in an embodiment of the present invention.
Step S401, when respectively adding benchmark time shifting broadcasting time, benchmark left margin time and benchmark right margin time Between difference, obtain current time shifting broadcasting time, left margin time to be determined and right margin time to be determined to be determined.
Benchmark time shifting broadcasting time, benchmark left margin time and benchmark right margin time are added into time difference, theoretically Available current time shifting broadcasting time, left margin time and right margin time, still, if time shift program is in F.F. or fast When moving back state, the time difference of fast forward and fast reverse is greater than the time schedule under current live state, therefore will lead to current time shift Play time, current left margin time and current right margin time will consider the current live time when updating.So first will Benchmark time shifting broadcasting time, benchmark left margin time and benchmark right margin time add the time difference after value be determined as to Determine current time shifting broadcasting time, left margin time to be determined and right margin time to be determined.
Step S402, when according to current time shifting broadcasting time to be determined, left margin time to be determined and right margin to be determined Between, determine current time shift temporal information, wherein current time shift temporal information includes current time shifting broadcasting time, current left margin Time and current right margin time.
After determining current time shifting broadcasting time to be determined, left margin time to be determined and right margin time to be determined, lead to It crosses following step and determines current time shifting broadcasting time, current left margin time and current right margin time, be this hair referring to Fig. 5 The step S402 flow diagram that bright embodiment provides, specific as follows:
Step S4021 receives the present system time to set-top-box system request.
Set-top box is automatic real by NTP (Newwork Time Protocol, Network Time Protocol) after each plug-in Clock time in existing set-top box is synchronous with the local network time, and the local network time is system time.When set-top box After time and system time synchronization, present system time directly can be obtained to the clock request of set-top box, due to current It is present system time that the time, which is broadcast live, it is therefore not necessary to the time-shifted service device request current live time.
Step S4022, judges whether the right margin time to be determined is equal to or more than present system time.
Due under time-shift playing state, when speed F.F., the time difference of current time shifting broadcasting time each F.F. compared with Greatly, therefore, the current right margin time also can carry out F.F., and the speed ratio current live of F.F. with time difference described in the time Time speed is big, if the current right margin time is fast-forward to when being overlapped with the current live time, the current right margin time is at this time not It can be updated further according to the right margin time to be determined.
Step S4023 determines current the right when the right margin time to be determined being equal to or more than the current system live streaming time Boundary's time is that the time is broadcast live in current system.
When the right margin time to be determined being equal to or more than the current live time, more according to the right margin time to be determined When the current right margin time of new video window interface, the current right margin time alreadys exceed the audio-video of time-shifted service device caching The right margin time of data, so, when the right margin time to be determined being equal to or more than the current live time, when determining right margin Between be the current live time.
Step S4024, judges whether the current time shifting broadcasting time to be determined is equal to or more than present system time.
On the right boundary's time be equal to current live time state under, when speed F.F., the current time shifting broadcasting time with Speed F.F. can be more than the right margin time, and therefore, it is necessary to judge whether the current time shifting broadcasting time to be determined is equal to or more than the right side Boundary time.
Step S4025, when the current time shifting broadcasting time to be determined being equal to or more than present system time, when determining current Shifting play time is present system time.
If the time shifting broadcasting time to be determined be equal to or more than the current right margin time, illustrate if actual program via Time-shift playing state is switched to live state, and the current time shifting broadcasting time to be determined is determined as the current live time i.e. at this time It can.
Step S4026, judges whether the left margin time to be determined is less than or equal to time-shifted service device caching audio, video data The left margin time.
The length of audio, video data time of time-shifted service device end caching determines according to the memory of time-shifted service device, generally In the case of cache the audio, video data of hour.In method provided in this embodiment, when the time shift of video window interface display Between range be a hour, but time-shifted service device caching audio, video data time more than one hour, for example, time shift is taken The audio, video data time cached in business device is set as two hours, at this point, default in the left margin time that video clip is shown For current live time previous hour.
Time-shifted service device caches the left margin time of audio, video data by the time of time-shifted service device caching audio, video data And present system time has relationship, when the audio, video data time of time shift server buffer is two small, while current system The system time is Beijing time 9::00, then, the left margin time that time-shifted service device caches audio, video data is present system time It draws back two hours, i.e. the left margin time of time shift server buffer audio, video data is Beijing time 7:00.
Under time-shift playing state, when speed rewind, the meeting speed rewind of left margin time is fallen back on fastly when the left margin time When time-shifted service device caches the left margin time of audio, video data, when the current left margin time can not update than minimum left margin Between it is smaller.
Step S4027 is less than or equal to the left side of time-shifted service device caching audio, video data when the left margin time to be determined When boundary's time, determine that the current left margin time is the left margin time that time-shifted service device caches audio, video data.
When the left margin time to be determined being less than or equal to the left margin time of time-shifted service device caching audio, video data, this When left margin time to be determined exceeded the corresponding time range of the audio, video data cached in time-shifted service device, so, will be to Determine that the left margin time is determined as the left margin time of time-shifted service device caching audio, video data.
For example, the left margin time of time-shifted service device caching audio, video data is Beijing time 7:00, when benchmark left margin Time add time deviation after time value be Beijing time 6:58:50 when, illustrate that the updated current left margin time can not It updates to Beijing time 6:58:50, so, the current left margin time of video window interface display can be updated to north by set-top box Capital time 7:00.
It can be seen from the above, the audio, video data cached is sent to machine top by time-shifted service device under time-shift playing state In box, the period of the audio, video data cached in time-shifted service device is generally a hour, is also possible to two or more Hour, the data cached period is determined by the memory of time-shifted service device.When the data time section of time shift server buffer is two When a hour, wherein the right margin time of time-shifted service device buffer area is the current live time, with the progress of live streaming, Time-shifted service device can then cache on the basis of the audio, video data of caching, buffer circle is similar to, so time-shifted service The left margin time and right margin time of the audio, video data of device buffer area are also to change with live streaming, but in video window The time shift range shown on mouth interface is a hour, therefore, in time shift program playing process, with speed F.F. or fastly It moves back, needs in real time by being carried out with the left margin time of audio, video data and right margin time cached in time-shifted service device pair Than determining current time shifting broadcasting time, current left margin time and current right margin time.
Referring to Fig. 6, for another time shift time obtaining method flow diagram provided in an embodiment of the present invention.
As shown in the figure, further include step S500 before step S300, extract PCR from current audio and video data streams Value.After receiving current audio and video data streams, PCR value is extracted from current audio and video data streams, according to the PCR value extracted Time difference is calculated with the PCR value extracted in benchmark audio and video data streams.Certainly, with the continuous hair of audio and video data streams It send, PCR value is successively extracted from audio and video data streams.
The detailed process that PCR value is extracted from current audio and video data streams is provided in an embodiment of the present invention referring to Fig. 7 Step S500 flow diagram, specific as follows:
For audio, video data in encoder-side by encoding post package in TS packet, PCR value is sampled to system clock It is inserted into binary field of the TS packet from adaptation field afterwards.
TS packet is from adaptation field and count off by the packet header of 4 bytes and 184 bytes according to constituting, PCR value be inserted in from It is including PCR label and PCR value from adaptation field, wherein whether PCR identifies in TS packet comprising PCR in adaptation field Value indicates that there are PCR values in TS packet, when PCR is labeled as 0, indicate that PCR value is not present in TS packet when PCR is labeled as 1, this When just do not need to extract PCR value from TS packet.PCR value is the Optional Field in TS packet, that is to say, that is not in each TS packet It include PCR value.
PCR value is made of the binary field of 42bits, wherein PCR_Base be by 27MHz pulse through 300 frequency dividing after 90kHz pulse-triggered counter, then counter status is sampled.PCR_Ext is directly touched by 27MHz pulse Counter is sent out, then counter status is sampled.
Step S501, obtains the TCP packet in current audio and video data streams, and TCP packet includes multiple TS packets.
Time shifting broadcasting request is sent in time-shifted service by RTSP agreement, and RTSP agreement is application layer protocol, so TS packet is that the Transmission Control Protocol based on application layer is transmitted, so, TS packet can be encapsulated as TCP packet when application layer is transmitted, and one It include multiple TS packets in TCP packet, a TCP packet includes 7 TS packets in method provided in this embodiment.The transmission frequency of TCP packet Rate and interval are controlled by time-shifted service device, to guarantee the fluency of audio and video playing.Therefore, it needs first to obtain before extracting PCR value Take the TCP packet in audio and video data streams.
Step S502 extracts PCR value from all TS packets of TCP packet.
It include 7 TS packets in TCP packet in method provided in an embodiment of the present invention, when being obtained from audio and video data streams To after TCP packet, 7 TS packets are decoded from TCP packet, then extract PCR value from 7 TS packets.It, can be with when extracting PCR value The PCR value in all TS packets is extracted, the PCR value in one of TS packet can also be only extracted.In order to improve PCR value in TS packet Analyzing efficiency, a PCR value can be extracted in the TCP packet.Since PCR value is the sampling to system clock, institute With, general each regular hour can just extract a PCR value and be inserted into TS packet, certainly, between two neighboring PCR value when Between depending on coding rule.Therefore, there is PCR value in TS packet that may be all in a TCP packet, it is also possible to a PCR value Do not have yet.
The method that PCR value is extracted from TCP packet is step S502 process provided in an embodiment of the present invention referring specifically to Fig. 8 Schematic diagram.
Step S5021 successively obtains the TS packet in TCP packet.
After getting the TCP packet in current audio and video data streams, according to the arrangement order sequence or inverted order of TS packet in TCP packet TS packet is successively obtained, and successively parses TS packet.For example, successively extracting TS from top to bottom according to putting in order for TS packet in TCP packet Packet, when extracting first TS packet, parses first TS packet.
Whether step S5022 judges in TS packet to include PCR value.
It is above-mentioned text in it has been noted that TS packet include from adaptation field PCR mark, for indicating whether wrap in TS packet Contain PCR value.So being marked, being sentenced by the PCR in parsing TS packet when judging whether to include PCR value in TS packet in this step Disconnected PCR marks whether to be 1, includes PCR value in the TS packet, at this point, extracting in the TS packet when PCR is labeled as 1 PCR value.
Step S5023, when including PCR value in TS packet, determination extracts PCR value from any TS packet of TCP packet.
In order to improve the analyzing efficiency of TS packet, while the calculating speed of current time shift information is improved, from TCP packet in this method In extract a PCR value.Preferably, when parsing the TS packet in TCP packet, when extracting PCR value for the first time, just really It is scheduled in any TS packet of TCP packet and extracts PCR value, and determine that the PCR value extracted is current PCR value.It extracts for the first time PCR value be successively to parse in TS packet, the PCR value that occurs in TS packet for the first time.
Step S5024 judges whether TS packet is the last one TS in TCP packet when not including in TS packet has PCR value Packet.
If not including in current TS packet has PCR value, judge whether current TS packet is the last one TS in TCP packet Packet.When successively obtaining the TS packet in TCP packet, one TS packet of every acquisition will judge whether be surrounded by PCR in the TS packet extracted Value, if there is PCR value, then the PCR value in subsequent TS packet is not involved in the calculating of time difference, if in the TS packet extracted not Include PCR value, then judge the TS packet extracted whether be in TCP packet the last one packet.
Step S5025, when TS packet is not the last one TS packet in TCP packet, next TS packet of acquisition TS packet, and from PCR value is extracted in next TS packet of TS packet, until extracting PCR value.
When the TS packet extracted is not the last one packet in TCP packet, then, the arrangement according to TS packet in TCP packet is suitable Sequence obtains next TS packet, and executes above-mentioned steps, judges whether to include PCR value from the TS packet extracted, if comprising There is PCR value, extracts PCR value, and no longer need to judge whether there is PCR value in the TS packet extracted after this TS packet.By above-mentioned Step successively obtains TS packet, until extracting PCR value.
Step S5026 is determined from all TS packets of TCP packet not when TS packet is the last one TS packet in TCP packet Extract PCR value.
If when the TS packet extracted when the last one TS packet of TCP packet, determination does not mention from all TS packets of TCP packet Get PCR value.That is, not extracting PCR value from 7 TS packets when successively parsing 7 TS packets in TCP packet.
It can be seen from the above, Fig. 8 is that circulation obtains TS packet and extracts the process of PCR value in TCP packet the step of offer, mentioning During taking PCR value, may there be PCR value in each TS packet, it is also possible to which only having in second and the 5th TS packet has PCR When being worth, but calculating current time shift temporal information in this method, a PCR value is only extracted from TCP packet and is calculated, if its There are also PCR values in his TS packet, then the PCR value in other TS packets is not involved in the calculating of time difference.
The mode of the extraction PCR value provided in the embodiment of the present invention is that the PCR value extracted for the first time from TCP packet carries out Calculate, but the method is not intended as the restriction of the scope of the present invention, the mode of extraction PCR value from TCP packet, can be by The value that last time is extracted from TCP packet carries out the mode such as calculating.
Step S503, when extracting PCR value in any TS packet from TCP packet, determination is mentioned from all TS packets of TCP packet Take out PCR value.
In step shown in Fig. 8, it is described in detail for extracting PCR value from TCP packet, in step S3023, works as institute It states when including PCR value in TS packet, determination extracts PCR value from any TS packet of the TCP packet, when determination is from TCP packet When extracting PCR value in any TS packet, determination extracts PCR value from all TS packets of the TCP packet.
That is, successively extracting the TS packet in TCP packet when extracting PCR value from TCP packet and being extracted from TS packet PCR value, when extracting PCR value from any one TS packet, and determination extracts PCR value from TCP packet, at this point, in TCP packet Middle subsequent extracted to PCR value be no longer participate in the calculating of time difference.
Step S504 receives current audio and video data streams when not extracting PCR value in all TS packets from TCP packet Next audio and video data streams, and extract PCR value from next audio and video data streams of current audio and video data streams, until Extract PCR value.
In above-mentioned steps S5026, when TS packet is the last one TS packet in the TCP packet, the institute from TCP packet is determined Have in TS packet and does not extract PCR value.The TS packet in TCP packet is successively extracted, and is analyzed whether by PCR value in TS packet, when TCP packet In when PCR value is not present in all TS packet, determinations is to extract PCR value from TCP packet, is regarded then obtaining next sound TCP packet in frequency data stream continues successively to extract TS packet, and extracts PCR value from TS packet.
By the above-mentioned description to Fig. 7 and Fig. 8 it is found that Fig. 7 and Fig. 8 have been described in detail and extract PCR from audio and video data streams The process of value, the process that PCR value is extracted from audio and video data streams are as follows:
When receiving current audio and video data streams, TCP packet is obtained from audio and video data streams, due to including in TCP packet There are multiple TS packets, and PCR value is present in TS packet, so needing to extract PCR value, side provided in an embodiment of the present invention from TS packet It include 7 TS packets in method, in TCP packet.The TS packet in TCP packet is successively obtained, and by judging the label of the PCR in TS packet, is sentenced Whether include PCR value in disconnected TS packet, when PCR is labeled as 1, illustrates in current TS packet to include PCR value, extract current TS PCR value in packet, and the calculating of time shift difference is participated in, the TS packet after current TS packet still needs to continue in playing audio-video Audio, video data therein is parsed, only the PCR value in the TS packet after current TS packet is no longer participate in the calculating of time shift difference.
If the PCR in current TS packet is labeled as 0, illustrating not including in current TS packet has PCR value, then, it obtains next Lower TS packet, and whether continue to parse in next TS packet includes PCR value, and so on, until extracting the PCR for participating in calculating Value.As soon as it is every analyzed a TCP packet after, obtain next audio and video data streams, and extract from next audio and video data streams PCR value.
It seen from the above description, only need to be from TCP packet when extracting the calculating of PCR value participation time difference from TCP packet A PCR value is extracted, when being in this case not necessarily to parsing TS packet every time, PCR value is extracted from TS packet, reduces extraction Number, the equally also less number calculated.Also, since interval time is even micro- in millisecond between every two adjacent TS packets Second grade, so, time difference is calculated when only extracting a PCR value from TCP packet, without extracting the PCR value participation in other packets Calculate, the time deviation caused by the update of current time shift temporal information be also millisecond even microsecond pole, therefore, caused by the time Error is negligible.
When carrying out speed fast forward and fast reverse under time-shift playing state, due to the processing accuracy of server end PCR value, just When often playing, there is inconsistency in PCR coding, if the benchmark still to extract from benchmark audio and video data streams at this time in itself The calculating of time difference is carried out on the basis of PCR value, if, calculating time difference each time, there are the errors of 0.1ms, then with The calculating of multiple time difference, and when being updated according to the time difference, bigger time deviation will be caused.To understand The certainly above problem, the embodiment of the present invention also introduce alignment mechanism, the specific steps are as follows:
It is another time shift time obtaining method flow diagram provided in an embodiment of the present invention referring to Fig. 9.
Step S601 judges whether that receive time-shifted service device requests to send out according to the speed fast forward and fast reverse playback of set-top box The audio-video number stream sent, the transmission rate of audio and video data streams are corresponding with the speed fast forward and fast reverse playback request.
In speed fast forward and fast reverse, PCR value is easy to appear inconsistent, therefore, is receiving speed F.F. or fast operating When, start correction mechanism, correction mechanism provided in an embodiment of the present invention is to carry out a synchronous calibration with time-shifted service device.When connecing When receiving the audio and video data streams that time-shifted service device is sent according to the request of speed fast forward and fast reverse playback, time-shifted service device is according to again Fast fast forward and fast reverse requests to send audio and video data streams to set-top box, for example, speed rewind or fast reverse play request are fast for twice Into playing request, at this point, time-shifted service device sends audio and video data streams to set-top box with twice of transmission rate.
Step S602 moves the sound that server is sent according to the request of the speed fast forward and fast reverse playback of set-top box when received When video counts stream, whether real-time judge audio and video data streams transmission rate is restored to default regular transmission rate.
During speed transmits audio and video data streams, whether real-time judge audio video transmission rate is restored to normal transmission Rate.The transmission rate that obtains the transmission rate of current audio and video data streams by RTSP agreement, and will acquire and default normal Transmission rate compares.Aforesaid way connects suitable for time-shifted service device often receives a speed rewind or F.F. request, becomes A speed fast forward and fast reverse operation is carried out, corresponds to user when carrying out speed F.F. or fast operating using remote controler, often By a speed fast forward and fast reverse key, a speed fast forward and fast reverse movement is just carried out;Another situation is that when user presses When speed fast forward and fast reverse key, when pressing play button, time shift program just can normal play.For above-mentioned second situation, sentence It is disconnected whether to receive normal play request, when receiving normal play request, then calibrated.
Step S603, when audio and video data streams transmission rate is restored to default regular transmission rate, again to it is described when It moves server and sends time shifting broadcasting request.
For the first situation of speed fast forward and fast reverse, when audio and video data streams transmission rate is restored to default normal biography When defeated rate, time shifting broadcasting request is sent to time-shifted service device again, to receive benchmark audio and video data streams and benchmark again Time shift temporal information carries out the calculating of time deviation on the basis of the benchmark PCR value extracted again.
For the second situation of speed fast forward and fast reverse, when receiving normal play request, again to time-shifted service Device sends time shifting broadcasting request, and next process is as described above.
Another alignment mechanism is in normal play, for example, the time played in time shift program with normal speed When longer, it is also possible to which there are time offset issues, can also synchronize calibration with server at this time.
Detailed process is another time shift time obtaining method provided in an embodiment of the present invention referring to Figure 10.
It is poor to judge whether time difference is equal to preset time by step S604.
The calculation method of time difference is mentioned above, is updated in the playing process of time shift program according to time difference current Time shift temporal information, time difference refer to the time difference between current audio and video data streams and benchmark audio and video data streams, That is the difference between current time shifting broadcasting time and benchmark current time shifting broadcasting time.With the increase of time difference, when Move program it is current when shift time also constantly update.
Setting preset time is poor in set-top-box system, and preset time difference can be 15 minutes, 20 minutes or 30 minutes etc., Limitation of the time value of preset time difference not as the scope of the present invention.
Step S605 sends time shifting broadcasting request to time-shifted service device again when time difference is equal to preset time difference.
For example, preset time difference is 20 minutes, when time difference is equal to 20 minutes, retransmitted to time-shifted service device Time shifting broadcasting request, extracts benchmark PCR value, and reacquire the benchmark time shifting broadcasting time again.
Certainly, there is time difference in practical applications and be not up to 20 minutes integer values, therefore, when can be set default Between poor range send time shifting broadcasting if time difference is located within the scope of preset time difference to time-shifted service device again and request.
It can be seen from the above, time shift time obtaining method provided in an embodiment of the present invention, is updating current time shift temporal information When, without frequently obtaining current time shift temporal information to time-shifted service device, time shifting broadcasting request need to be only sent to time-shifted service device , time shifting broadcasting request sends or, receiving benchmark audio and video data streams and corresponding with benchmark audio and video data streams simultaneously Benchmark time shift temporal information.By the benchmark PCR value extracted from benchmark audio and video data streams, and from subsequently received sound The PCR value extracted in video data stream carries out difference calculating, obtains current audio and video data streams and benchmark audio and video data streams Time difference, so that the benchmark current time shifting broadcasting time is the current time shifting broadcasting time plus the time difference.Likewise, Current left margin time and current right margin time can also be updated according to time difference.By in audio and video data streams Time difference between PCR value and benchmark PCR value determines current time shift temporal information, without travel frequently over RTSP protocol instructions to The request of time-shifted service device updates time shift time range and current time shifting broadcasting time, thus mitigate the load of time-shifted service device, when The load reduction for moving server just reduces the phenomenon that time-shifted service device information returns to delay, and then reinforces video window interface The real-time that time refreshes.
The embodiment of the invention also discloses a kind of set-top box, affiliated set-top box includes processor and can for storage processor The memory executed instruction.
Processor be used for control and receive time-shifted service device transmission benchmark audio and video data streams, benchmark time shift temporal information with And current audio and video data streams, after receiving benchmark audio and video data streams, the PCR in benchmark audio and video data streams is extracted in control Value, and be stored in memory as benchmark PCR value, while the benchmark time shift temporal information received storage being made in memory On the basis of.
Processor continues control and extracts PCR value from current audio and video data streams, and by the PCR value extracted and benchmark PCR value carries out difference calculating, calculates time difference, in calculating process, processor is first by the PCR value extracted and benchmark PCR value is converted into time value, then does difference calculating.The benchmark current time shifting broadcasting time in benchmark time shift temporal information is added The upper time difference obtains the current time shifting broadcasting time.Meanwhile benchmark left margin time and benchmark right margin time add institute It states time difference and obtains left margin time and right margin time.
The concrete mode for executing operation about set-top box has been described in detail in the embodiment of method, Explanation will be not set forth in detail in this.
Figure 11 is the block diagram according to a kind of set-top box shown in exemplary embodiment.
The terminal of set-top box control provided in an embodiment of the present invention is smart television, when set-top box is disclosed according to the present invention When method calculates current time shift temporal information, current time shift temporal information is sent in time showing process by set-top box, and The video display interface of smart television is updated to current time shift temporal information.
The video of 401 controlling terminal of processor realizes, video rewind or F.F., program switching and when shifting state switching etc. Operation, in processing including the disparate modules for completing aforesaid operations, to facilitate interacting between set-top box and smart television.
Memory 402 is configured as storing various types of data to support the operation in terminal.The example of these data Instruction, calculation method including any application or method for being operated on smart television etc..Memory 402 can be by Any kind of volatibility or non-volatile memory device or their combination realization, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM) may be programmed Read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or CD.
Power supply module 403 provides electric power for the various assemblies of set-top box, and power supply module 403 may include power management system System, one or more power supplys and other with for set-top box generate, manage, and distribute the associated component of electric power.
Multimedia component 404 includes the output interface screen provided between set-top box and user.In some embodiments, Screen may include display screen or touch panel.If screen includes touch panel, screen can be implemented as touch screen, to receive Input signal from the user.Touch panel includes one or more touch sensors to sense touch, slide, and touch panel On gesture.The touch sensor can not only sense the boundary of a touch or slide action, but also detect and the touch Or the relevant duration and pressure of slide.Key has also can be set in set-top box, and user can be saved by key The functions such as mesh switching, speed fast forward and fast reverse, Volume Up or reduction.
Input/output interface 405 provides interface between processing component and peripheral interface module, and communication component 406 is matched It is set to convenient for the communication of wired or wireless way between set-top box and time-shifted service device.Set-top box can be accessed based on communication standard Wireless network, such as WiFi, 2G or 3G or their combination.In one exemplary embodiment, communication component 406 is via wide It broadcasts channel and receives broadcast singal or broadcast related information from external broadcasting management system.In one exemplary embodiment, The communication component 406 further includes near-field communication (NFC) module, to promote short range communication.For example, can be based on penetrating in NFC module Frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, bluetooth (BT) technology and other skills Art is realized.
In the exemplary embodiment, set-top box can be believed by one or more application specific integrated circuit (ASIC), number Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
Those skilled in the art will readily occur to of the invention its after considering specification and the disclosure invented here of practice Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. a kind of time shift time obtaining method is applied to set-top box characterized by comprising
Benchmark audio and video data streams and benchmark time shift temporal information that time-shifted service device is sent according to time shifting broadcasting request are received, Wherein, benchmark audio and video data streams are first audio and video data streams with PCR value, benchmark time shift in audio and video data streams Temporal information is time shift temporal information corresponding with benchmark audio and video data streams;
Receive the current audio and video data streams that the time-shifted service device issues automatically after the benchmark audio and video data streams;
Determine PCR value that the current audio and video data streams extract and the PCR value extracted in benchmark audio and video data streams Time difference;
According to the time difference and the benchmark time shift temporal information, current time shift temporal information is determined.
2. time shift time obtaining method according to claim 1, which is characterized in that the determination current audio-video number The time difference of the PCR value extracted in the PCR value and benchmark audio and video data streams extracted according to stream, comprising:
Time value is converted by PCR value and benchmark PCR value that the current audio and video data streams extract respectively;
The time value of the time value for the PCR value that the current audio and video data streams extract and the benchmark PCR value is made into difference, Obtain the time difference.
3. time shift time obtaining method according to claim 1, which is characterized in that wrapped in the benchmark time shift temporal information The time of time shifting broadcasting containing benchmark, benchmark left margin time and benchmark right margin time;
It is described according to the time difference and the benchmark time shift temporal information, determine current time shift temporal information, comprising:
The benchmark time shifting broadcasting time, benchmark left margin time and benchmark right margin time are added into the time difference respectively Value, obtains current time shifting broadcasting time, left margin time to be determined and right margin time to be determined to be determined;
According to current time shifting broadcasting time, left margin time to be determined and the right margin time to be determined to be determined, institute is determined State current time shift temporal information, wherein when the current time shift temporal information includes current time shifting broadcasting time, current left margin Between and the current right margin time.
4. time shift time obtaining method according to claim 3, which is characterized in that it is described according to it is described to be determined current when Play time, left margin time to be determined and right margin time to be determined are moved, determines the current time shift temporal information, comprising:
Receive the present system time to set-top-box system request;
Judge whether the right margin time to be determined is equal to or more than the present system time;
When the right margin time to be determined being equal to or more than the present system time, the current right margin time is determined For the present system time;
Judge whether the current time shifting broadcasting time to be determined is equal to or more than the present system time;
When the current time shifting broadcasting time to be determined being equal to or more than the present system time, the current time shift is determined Play time is present system time;
When judging whether the left margin time to be determined is less than or equal to the left margin of time-shifted service device caching audio, video data Between;
When the left margin time to be determined being less than or equal to the left margin time of time-shifted service device caching audio, video data, really The fixed current left margin time is the left margin time that time-shifted service device caches audio, video data.
5. time shift time obtaining method according to claim 1, which is characterized in that the method also includes working as from described PCR value is extracted in preceding audio and video data streams;
It is described to extract PCR value from the current audio and video data streams, it specifically includes:
The TCP packet in the current audio and video data streams is obtained, the TCP packet includes multiple TS packets;
PCR value is extracted from all TS packets of the TCP packet;
When extracting PCR value in any TS packet from the TCP packet, determination is extracted from all TS packets of the TCP packet PCR value;
When not extracting PCR value in all TS packets from the TCP packet, the next of the current audio and video data streams is received A audio and video data streams, and PCR value is extracted from next audio and video data streams of the current audio and video data streams, until mentioning Take out PCR value.
6. time shift time obtaining method according to claim 5, which is characterized in that all TS from the TCP packet PCR value is extracted in packet, comprising:
Successively obtain the TS packet in the TCP packet;
Judge in the TS packet whether to include PCR value;
When including PCR value in the TS packet, determination extracts PCR value from any TS packet of the TCP packet;
When not including in the TS packet has PCR value, judge whether the TS packet is the last one TS packet in the TCP packet;
When the TS packet is not for the last one TS packet in the TCP packet, next TS packet of the TS packet is obtained, and from institute It states in next TS packet of TS packet and extracts PCR value, until extracting PCR value;
When the TS packet is the last one TS packet in the TCP packet, determination does not mention from all TS packets of the TCP packet Take out PCR value.
7. time shift time obtaining method according to claim 6, which is characterized in that described successively to obtain in the TCP packet TS packet, comprising:
TS packet is obtained according to the arrangement order sequence of TS packet in the TCP packet;Alternatively, according to the arrangement of TS packet in current TCP packet Order inverted order obtains TS packet.
8. time shift time obtaining method according to claim 1, which is characterized in that the method also includes:
Judge whether to receive the audio-video number that time-shifted service device is sent according to the request of the speed fast forward and fast reverse playback of set-top box Stream, the transmission rate of the audio and video data streams are corresponding with the speed fast forward and fast reverse playback request;
It is real when moving the audio-video number stream that server is sent according to the request of the speed fast forward and fast reverse playback of set-top box when received When judge whether the audio and video data streams transmission rate is restored to default regular transmission rate;
When the audio and video data streams transmission rate is restored to default regular transmission rate, sent out again to the time-shifted service device Time shifting broadcasting is sent to request.
9. time shift time obtaining method according to claim 1, which is characterized in that the method also includes:
It is poor to judge whether the time difference is equal to preset time;
When the time difference is equal to preset time difference, time shifting broadcasting request is sent to the time-shifted service device again.
10. a kind of set-top box characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to method described in any one of claims 1 to 9.
CN201610538439.9A 2016-07-08 2016-07-08 A kind of time shift time obtaining method and set-top box Active CN106101752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610538439.9A CN106101752B (en) 2016-07-08 2016-07-08 A kind of time shift time obtaining method and set-top box

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610538439.9A CN106101752B (en) 2016-07-08 2016-07-08 A kind of time shift time obtaining method and set-top box

Publications (2)

Publication Number Publication Date
CN106101752A CN106101752A (en) 2016-11-09
CN106101752B true CN106101752B (en) 2019-01-01

Family

ID=57213142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610538439.9A Active CN106101752B (en) 2016-07-08 2016-07-08 A kind of time shift time obtaining method and set-top box

Country Status (1)

Country Link
CN (1) CN106101752B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948668B (en) * 2017-12-08 2020-06-30 广州酷狗计算机科技有限公司 Live video recording method and device and computer storage medium
CN110209685B (en) * 2019-06-12 2020-04-21 北京九章云极科技有限公司 Real-time data processing method and system
CN112261445B (en) * 2020-10-21 2022-07-12 深圳市创维软件有限公司 Streaming media playing method, device, equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801929A (en) * 2005-12-08 2006-07-12 复旦大学 Method for network interaction television system realizing time-shift function
CN101202900A (en) * 2007-03-12 2008-06-18 深圳市同洲电子股份有限公司 Method for switching living broadcast and playback of digital television and video server
JP2008258665A (en) * 2007-03-30 2008-10-23 Toshiba Corp Stream reproducing device
CN101635847A (en) * 2009-09-02 2010-01-27 中兴通讯股份有限公司 Transmission method, video display device and terminal of streaming media
CN102355605A (en) * 2011-11-11 2012-02-15 烽火通信科技股份有限公司 Live time-shift processing method of IPTV (Internet Protocol Television) set-top box

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5277980B2 (en) * 2009-01-16 2013-08-28 日本電気株式会社 Time shift viewing system, time shift viewing method, time shift viewing apparatus and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801929A (en) * 2005-12-08 2006-07-12 复旦大学 Method for network interaction television system realizing time-shift function
CN101202900A (en) * 2007-03-12 2008-06-18 深圳市同洲电子股份有限公司 Method for switching living broadcast and playback of digital television and video server
JP2008258665A (en) * 2007-03-30 2008-10-23 Toshiba Corp Stream reproducing device
CN101635847A (en) * 2009-09-02 2010-01-27 中兴通讯股份有限公司 Transmission method, video display device and terminal of streaming media
CN102355605A (en) * 2011-11-11 2012-02-15 烽火通信科技股份有限公司 Live time-shift processing method of IPTV (Internet Protocol Television) set-top box

Also Published As

Publication number Publication date
CN106101752A (en) 2016-11-09

Similar Documents

Publication Publication Date Title
CN105453580B (en) Method of reseptance, sending method, reception device and sending device
KR101746165B1 (en) Method and apparatus for processing video images
US10511880B2 (en) Device synchronization
KR101932793B1 (en) Distributed control of synchronized content
US8775664B2 (en) Method and apparatus for use in tracking playback of media streams while in stand-by mode
CN105247437B (en) Synchronous multiple OTT streaming clients
CN103369410B (en) Play method, equipment and the computer readable storage medium of broadcasted content
EP3203754A1 (en) Method and system for realizing streaming media data seamlessly connecting in intelligent home
CN110636346B (en) Code rate self-adaptive switching method and device, electronic equipment and storage medium
US8931024B2 (en) Receiving apparatus and subtitle processing method
US20220400318A1 (en) Trick playback of video data
US11812103B2 (en) Dynamic playout of transition frames while transitioning between playout of media streams
CN106101752B (en) A kind of time shift time obtaining method and set-top box
JP2018530257A (en) Media content tag data synchronization
US8355450B1 (en) Buffer delay reduction
CN111601136B (en) Video data processing method and device, computer equipment and storage medium
CN103747317A (en) A smooth playing control method of a play database in an instable network
KR20140138763A (en) Method of buffer management for synchronization of correlated media presentations
US20160249109A1 (en) System and method for the detection of advertisements in television and other video programming
CN104080006A (en) Video processing device and method
WO2012028851A1 (en) Method and system for additional service synchronisation
CN102752669A (en) Transfer processing method and system for multi-channel real-time streaming media file and receiving device
TW201406139A (en) Provision of a personalized media content
CN114079813A (en) Picture synchronization method, coding method, video playing device and video coding device
JP4933145B2 (en) Network receiver

Legal Events

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