CN109996117A - A kind of method and apparatus obtaining streaming media playing duration - Google Patents
A kind of method and apparatus obtaining streaming media playing duration Download PDFInfo
- Publication number
- CN109996117A CN109996117A CN201910159296.4A CN201910159296A CN109996117A CN 109996117 A CN109996117 A CN 109996117A CN 201910159296 A CN201910159296 A CN 201910159296A CN 109996117 A CN109996117 A CN 109996117A
- Authority
- CN
- China
- Prior art keywords
- duration
- playing
- streaming media
- player
- system time
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
- H04N21/44204—Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
- H04N21/4424—Monitoring of the internal components or processes of the client device, e.g. CPU or memory load, processing speed, timer, counter or percentage of the hard disk space used
Abstract
The invention relates to Technology of Multimedia Stream Playing field more particularly to a kind of method and apparatus for obtaining streaming media playing duration, for improving the accuracy for obtaining streaming media playing duration.The first playing duration that player updates is obtained in the first system time;First playing duration is the played duration of Streaming Media that player is updated in the second system time, and the second system time is less than the first system time;Determine streaming media playing state of the player in first time period, time interval of the first time period between second system time and the first system time;Then, the streaming media playing state according to the first playing duration, player in first time period determines Streaming Media in the actual play duration of the first system time.In this way, the accuracy for obtaining actual play duration can be improved.
Description
Technical field
The invention relates to Technology of Multimedia Stream Playing field more particularly to a kind of sides for obtaining streaming media playing duration
Method and device.
Background technique
During streaming media playing, some applications (such as: YouTube) need the acquisition of player fast accurate currently to broadcast
It puts the time (current position), but since the call overhead of local player and relevant interface limits, leads to local
Player, which returns to the current play time of upper layer application and actual play time, certain offset, so that upper layer application obtains
The current play time inaccuracy arrived.When especially network environment is poor, the case where player frequently occurs buffering, upper layer application
The current play time got is just more inaccurate.
In existing solution, some smart television manufacturers can be by establishing timer, when calculating currently playing
Between offset, although this scheme compensates for time migration problem to a certain extent, setting timer will increase system
Operation expense, and the time point deviation for starting timer also results in calculated result and has certain deviation.
In conclusion needing a kind of scheme for obtaining streaming media playing duration, streaming media playing duration is obtained for improving
Accuracy.
Summary of the invention
The embodiment of the present application provides a kind of method and apparatus for obtaining streaming media playing duration, obtains Streaming Media for improving
The accuracy of playing duration.
In a first aspect, the embodiment of the present application provides a kind of method for obtaining streaming media playing duration, this method comprises: the
One system time obtains the first playing duration that player updates;Wherein, first playing duration is the player the
The Streaming Media that the two system time updates played duration, and the second system time is less than or equal to the first system time;
Determine that streaming media playing state of the player in first time period, the first time period are the second system time
With the time interval between the first system time;Then, according to first playing duration, the player at first
Between streaming media playing state in section, determine the Streaming Media in the actual play duration of the first system time.
Second aspect, the embodiment of the present application provide it is a kind of obtain streaming media playing duration device, including acquiring unit and
Processing unit.Wherein: acquiring unit, for obtaining the first playing duration that player updates in the first system time;Described
One playing duration is the played duration of Streaming Media that the player is updated in the second system time;The second system time is small
In or equal to the first system time;Processing unit, for determining that Streaming Media of the player in first time period is broadcast
Put state;According to the streaming media playing state of first playing duration, the player in first time period, determine described in
Actual play duration of the Streaming Media in the first system time;The first time period be the second system time with it is described
Time interval between the first system time.
The third aspect, the embodiment of the present application provide a kind of growth device when being used to obtain streaming media playing, and described device includes
Memory and processor, in which: the memory is for storing instruction;The processor, for executing the memory storage
Instruction, when the processor executes the instruction of memory storage, so that device executes following operation: in the first system
Time obtains the first playing duration that player updates;Wherein, first playing duration is the player in second system
The Streaming Media that time updates played duration, and the second system time is less than or equal to the first system time;Determine institute
State streaming media playing state of the player in first time period, the first time period be the second system time with it is described
Time interval between the first system time;Then, according to first playing duration, the player in first time period
Streaming media playing state, determine the Streaming Media in the actual play duration of the first system time.
Fourth aspect, the embodiment of the present application provide a kind of computer storage medium, finger are stored in computer storage medium
It enables, when run on a computer, so that computer executes any possible implementation of first aspect or first aspect
In method.
5th aspect, the embodiment of the present application provides a kind of computer program product comprising instruction, when its on computers
When operation, so that computer executes the method in any possible implementation of first aspect or first aspect.
In the embodiment of the present application, growth device obtains player in the first system time and updates when for obtaining streaming media playing
The first playing duration;Wherein, the first playing duration is the played duration of Streaming Media that player is updated in the second system time,
The second system time is less than the first system time;Streaming media playing state of the player in first time period is determined, when first
Between time interval of the section between second system time and the first system time;Then, existed according to the first playing duration, player
Streaming media playing state in first time period determines Streaming Media in the actual play duration of the first system time.In this way, true
When the actual play duration of streaming media not only allow for the first playing duration, it is also contemplated that the first system time and second system
The deviation of time and the streaming media playing state in this section of deviation time section, rather than directly will as the prior art
First playing duration is as actual play duration, so as to improve the accuracy for obtaining actual play duration.
Detailed description of the invention
Fig. 1 is a kind of stream media play system structural schematic diagram that the embodiment of the present application is applicable in;
Fig. 2 is a kind of flow diagram of method for obtaining streaming media playing duration provided by the embodiments of the present application;
Fig. 3 is a kind of normal play schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 4 is a kind of trick play schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 5 is another trick play schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 6 is another trick play schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 7 is another trick play schematic diagram of a scenario provided by the embodiments of the present application;
Fig. 8 be it is provided by the embodiments of the present application it is a kind of for obtaining streaming media playing when growth device structural schematic diagram;
Fig. 9 is the structural schematic diagram of another device for obtaining streaming media playing duration provided by the embodiments of the present application.
Specific embodiment
In order to keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application make into
One step it is described in detail.Concrete operation method in embodiment of the method also can be applied to Installation practice or system embodiment
In.
During streaming media playing, some applications (such as: YouTube) need the acquisition of player fast accurate currently to broadcast
Put the time.For example, thering is a test case to be used to test from the current of docking layer acquisition in 2019 verification process of YouTube
The accuracy of play time (i.e. current time), the current play time and video that this authentication requesting is obtained from docking layer
The gap for the current play time that actual play itself arrives is less than 32ms.
Fig. 1 illustrates a kind of applicable stream media play system structural schematic diagram of the embodiment of the present application, such as Fig. 1 institute
Show, which includes application layer 101, docking layer 102 and player 103.
Wherein, application layer 101 calls docking layer interface (such as getCurPosition interface) to obtain at regular intervals
The current play time of Streaming Media, that is, the actual play duration of player plays Streaming Media.For example, application layer 101 every
2ms calls a getCurPosition interface, when getting the corresponding actual play of player plays Streaming Media from docking layer
It is long.For example, by Streaming Media be one section of total duration for the video of 60min for, when the video playing is to 25min, application
The actual play duration 25min that layer 101 calls the getCurPosition interface that can get from docking layer 102.
The broadcast information for the Streaming Media that docking layer 102 is updated according to player, determines the actual play duration of Streaming Media.It is right
There are many modes for connecing the broadcast information that layer 102 obtains the Streaming Media that player updates.In a kind of implementation, layer 102 is docked
The broadcast information of the Streaming Media of the update of player 103 can be obtained at regular intervals, for example player is in last update
Streaming Media played duration.In another implementation, after player 103 updates the broadcast information of Streaming Media, to docking
Layer 102 sends the broadcast information for the Streaming Media that player 103 is updated.There are also in a kind of implementation, application layer 101 is called
When getCurPosition interface, docking layer 102 obtains the broadcast information of the Streaming Media updated from player 103.
Player 103 is used for playing stream media, and player 103 calls UpdateInfo interface to update one at regular intervals
The cache size of the played duration of secondary Streaming Media, for example, player 103 calls a UpdateInfo interface every 200ms, that
Player 103 is obtained with following broadcast information every 200ms: current play position (curPosition) information is broadcast
Put the corresponding played duration of device playing stream media process;Whether (isPaused) information is suspended, i.e. player 103 plays stream matchmaker
Placed in a suspend state whether body process;It updates system time (update_sys_time), i.e., what player 103 obtained currently broadcasts
Put the corresponding second system time t2 of position (curPosition) information.
In the embodiment of the present application, using the current play position for indicating Streaming Media for playing duration, it is of course also possible to
The current play position of Streaming Media or the information of other current play positions that can indicate Streaming Media are indicated using byte
It realizes method provided by the embodiments of the present application, is not herein repeating.
System architecture based on Fig. 1, in order to which how clearer introduction realizes acquisition stream matchmaker provided by the embodiments of the present application
The method of body playing duration is described in detail below with reference to normal play scene shown in Fig. 1.
As shown in Figure 1, player 103 calls a UpdateInfo interface every 200ms, a Streaming Media has been updated
The cache size of playing duration.Application layer 101 calls a getCurPosition interface every 2ms, to obtain from docking layer 102
Obtain the actual play duration of Streaming Media.A UpdateInfo interface also is called every 200ms according to player 103 in Fig. 3-7,
Application layer 101 is subsequent to repeat no more for 2ms calls a getCurPosition interface.
Calling the system time of getCurPosition interface in Fig. 1 with application layer 101 is t2, and docking layer 102, which receives, answers
When being called with layer 101, present system time t2 is recorded;And player 103 last update Streaming Media before time t 2
The system time of broadcast information is t1, is p1, isPaused than the current play position curPosition that player updates
Also it is 0 for 0 and is UnderFlow, illustrates that streaming media playing state is normal play.
If t1 is equal to t2, that is to say, that the p1 that player is updated when system time is t1 is actual play
Duration.So application layer 101 is when system time is that t2 calls getCurPosition interface to obtain the actual play of Streaming Media
Long p1.
If t1 is less than t2, broadcasting of the docking layer 102 in the system time t2 Streaming Media updated according to bottom player 1.3
Information, to calculate the actual play duration of Streaming Media.Distinguish below for the application and the scheme of use in the prior art
Illustrate:
In the prior art, docking layer 102 using player when system time is t1 the p1 that updates as actually broadcasting
Duration is put, application layer 101 is returned to, due to being normal play in system time t1 to the broadcast state between system time t2,
That is, player is in the playing duration p1 that system time is t1, in system time t1 to system time t2 this period
The actual play duration of Streaming Media can't rest on p1, so scheme in the prior art will lead to application layer 103 and get
Actual play duration inaccuracy.
In order to solve the problems, such as that scheme in the prior art exists, in the embodiment of the present application, layer 102 is docked according to player
In playing duration p1 of the system time by t1 and the playing to this period between system time t2 in system time t1
Duration, obtain actual play duration.Specifically, the actual play duration of Streaming Media can be indicated with following formula (1):
P=curPosition+playbackRate* (t2-t1) ... (1)
In above-mentioned formula (1), p is actual play duration, and curPosition is player having broadcast in system time t1
Duration is put, is p1 than curPosition as shown in figure 1;PlaybackRate is player plays rate, it is assumed that player is normally broadcast
The playback rate put is 1 speed, then playbackRate is 1;Assuming that playback rate is 2 speeds, then playbackRate
It is 2;T2 is the system time that application layer 101 calls getCurPosition interface.T1, which is that player 103 is the last, to be called
The system time of UpdateInfo interface.
The method provided by the embodiments of the present application for obtaining streaming media playing duration, by obtaining broadcasting for bottom player update
System time t1 and application layer when putting duration obtain system time t2 when actual play time, take difference between t2 and t1,
And a migration is calculated according to current playing rate, the playing duration updated with bottom player is superimposed, and reaches quick
Precisely obtain the effect of current play time.It should be noted that acquisition streaming media playing duration provided by the embodiments of the present application
Method, be applicable not only in t1 to t2 period under the scene of player normal play, apply also for network environment compared with
Player frequently occurs the scene and fast forwarding and fast rewinding (seek) operation scenario of buffering when poor, and wherein seek operation can be fast
Into operation, it is also possible to fast reverse operation.
Based on above content, Fig. 2 illustrates a kind of acquisition streaming media playing duration provided by the embodiments of the present application
Method, this method by for obtain streaming media playing when growth device execute, as shown in Fig. 2, this method comprises:
Step 201, the first playing duration that player updates is obtained in the first system time;First playing duration is to play
Device played duration in the Streaming Media that the second system time updates.
Herein, the second system time can be equal to the first system time, can determine that the first playing duration is exactly real in this way
Border playing duration.The second system time might be less that the first system time, execute step 202 and step 203 later.
Wherein, the first playing duration can be any calling UpdateInfo of the player before the first system time
What interface updated.
For example, the first playing duration is that the last calling UpdateInfo of the player before the first system time connects
Oral replacement, as shown in Figure 1, player played duration, the first system in the Streaming Media that the second system time (i.e. t1) updates
Time is t2, by player for the broadcast state in t1 to t2 this period is normal playing status, then first plays
Shi Changwei p1 and first time period (i.e. the sum of playing duration in t1 to t2).Specifically, the actual play duration of Streaming Media
It can be indicated with following formula (2):
P=p1+playbackRate* (t2-t1) ... (2)
In above-mentioned formula (2), p is actual play duration, and p1 is played duration of the player in system time t1;
PlaybackRate is playback rate of the player in t1 to t2 this period;T2 is the calling of application layer 101
The system time of getCurPosition interface.T1 is the last calling of the player 103 before system time t2
The system time of UpdateInfo interface.
For another example the first playing duration is that reciprocal n-th of the player before the first system time is called
What UpdateInfo interface updated, N is the integer greater than 1.As shown in figure 3, illustrating for normal play scene provided by the present application
Figure, by taking N is equal to 2 as an example, the Streaming Media that player is updated in the second system time (i.e. t3) a length of p2, the first system when played
Time is t2, by player for the broadcast state in t3 to t2 this period is normal playing status, then first plays
Shi Changwei p2 and first time period (i.e. the sum of playing duration in t3 to t2).Specifically, the actual play duration of Streaming Media
It can be indicated with following formula (3):
P=p2+playbackRate* (t2-t3) ... (3)
In above-mentioned formula (3), p is actual play duration, and p2 is played duration of the player in system time t3;
PlaybackRate is player plays rate;T2 is the system time that application layer 101 calls getCurPosition interface.t1
The system time of UpdateInfo interface is called in second from the bottom time for being player 103 before system time t2.
Certainly, in scene shown in Fig. 3, can also by taking N is equal to 1 as an example, to determine the actual play duration of Streaming Media, i.e., the
One playing duration is that the 1st calling UpdateInfo interface of inverse of the player before the first system time updates.
Step 202, streaming media playing state of the player in first time period is determined;First time period is second system
Time interval between time and the first system time.
Illustrate in conjunction with above-mentioned Fig. 1, first time period is section this period t1 to t2.Illustrate in conjunction with above-mentioned Fig. 3,
First time period is section this period t3 to t2.
Step 203, the streaming media playing state according to the first playing duration, player in first time period determines stream
Actual play duration of the media in the first system time.
Wherein, the streaming media playing state of player can indicate with the following methods: if isPaused=1 or
IsUnderFlow=1 is currently at and plays halted state (pause) or buffering (underFlow) state;If
IsPaused=0 and isUnderFlow=0, that is, be currently at normal playing status.
By above-mentioned embodiment shown in Fig. 2, growth device is obtained in the first system time when for obtaining streaming media playing
The first playing duration that player updates;Wherein, the first playing duration is the Streaming Media that player is updated in the second system time
Played duration, second system time are less than the first system time;Determine streaming media playing of the player in first time period
State, time interval of the first time period between second system time and the first system time;Then, when being played according to first
Long, streaming media playing state of the player in first time period, determines Streaming Media in the actual play of the first system time
It is long.In this way, not only allow for the first playing duration in the actual play duration for determining Streaming Media, it is also contemplated that when the first system
Between and the second system time deviation and the streaming media playing state in this section of deviation time section, rather than as existing skill
Art directly using the first playing duration as actual play duration, obtains the accurate of actual play duration like that so as to improve
Property.
In above-mentioned steps 202, streaming media playing state can there are many, Streaming Media of the player in first time period
Broadcast state is different, in such a way that step 205 determines Streaming Media in the actual play duration of the first system time also
It is different.It is divided into following several situations below to be introduced respectively.
The streaming media playing state of situation one, player in first time period is normal playing status.
In this case, the embodiment of the present application provides a kind of mode for realizing above-mentioned steps 205: if it is determined that player exists
Streaming media playing state in first time period is normal playing status, it is determined that Streaming Media is actually broadcast the first system time
The sum of a length of first playing duration and the second playing duration when putting.Wherein, the second playing duration is playback rate and first time
Product between the corresponding duration of section.
In this way, under the scene that player is in normal playing status, can be improved obtain actually broadcast
Put the accuracy of duration.
The streaming media playing state of situation two, player in first time period are as follows: be not carried out in first time period
Seek operation, and in broadcasting halted state in second time period, wherein second time period is any in first time period
Time interval.
In this case, the embodiment of the present application provides a kind of mode for realizing above-mentioned steps 205: if it is determined that player exists
In playing halted state and being not carried out seek operation in first time period in second time period, then Streaming Media is in the first system
The sum of a length of first playing duration and third playing duration when the actual play of system time.Wherein, when second time period is first
Between any time section in section, third playing duration is the product of playback rate and duration difference;When duration difference is first
Between difference between the corresponding duration of section duration corresponding with second time period.
Fig. 4 illustrates a kind of trick play schematic diagram of a scenario provided by the embodiments of the present application.
As shown in figure 4, application layer 101 calls getCurPosition interface in the first system time t2, player 103 exists
Second system time t3 calls UpdateInfo interface, and first time period is section t3 to t2 this period, in first time period
In there is second time period (t4 to t5 this period) in such as Fig. 4 player to be in play halted state, as shown in Figure 4
IsPaused=1 or isUnderFlow=1.Specifically, from second system time t3 to system time t4 player in just
Normal broadcast state, bottom data not enough or decoding pause etc. due to cause from system time t4 to system time t5 player
In halted state is played, bottom data is enough since system time t5, so from system time t5 to the first system time
T2 player is in normal playing status again, that is to say, that time (this section in first time period in addition to second time period
The when a length of duration difference of time) interior player is all in normal playing status.So, when actual play when a length of first broadcasting
The sum of third playing duration that is long and being played in duration difference.Referring to fig. 4, actual play duration p can use following formula (4)
To indicate:
P=p2+playbackRate* [(t2-t3)-(t5-t4)] ... (4)
In above-mentioned formula (4), p is actual play duration, and p2 is played duration of the player in system time t3;
PlaybackRate is player plays rate;When t2 is the first system that application layer 101 calls getCurPosition interface
Between.T4 is that player is initially located in the system time for playing halted state, and t5 is that player is initially located in normal playing status
System time.
It should be noted that in situation two, it can also be according to the system time of player last update and first
The broadcast state of player and the first playing duration determine actual play duration in system time section this period, have
Body mode repeats no more.
It in this way, can't be as the prior art for the scene for playing halted state is in player
Directly using the second system time of player update as the actual play duration of player, so as to improve acquisition player
The accuracy of actual play duration.
The streaming media playing state of situation three, player in first time period are as follows: player is held in third system time
Row seek is operated and within the third period in halted state is played, and the third period is the third system time and institute
State the time interval between the first system time.
In this case, the embodiment of the present application provides a kind of mode for realizing above-mentioned steps 205: if it is determined that in third system
The time execution seek that unites is operated and player is within the third period and plays halted state, it is determined that Streaming Media is first
A length of 4th playing duration when the actual play of system time;Wherein, seek operation is for by the played duration tune of Streaming Media
To the 4th playing duration.
Fig. 5 illustrates another trick play schematic diagram of a scenario provided by the embodiments of the present application.
As shown in figure 5, application layer 101 calls getCurPosition interface in the first system time t2, player 103 exists
Second system time t3 calls UpdateInfo interface, i.e. first time period is section t3 to t2 this period.In third system
Time tseek performs seek operation, the playing duration of player is dragged to st, then from second system time t3 to third
In section this period system time tseek, player is in pause broadcast state due to not there is enough bottom datas also,
User can intuitively see player in data buffering, until bottom has enough data just to will continue to play.That is,
If until the first system time t2 is without enough data, i.e. third period (tseekAll do not have to t2) bottom player
Enough data, then a length of st when the actual play of player.
The streaming media playing state of situation four, player in first time period are as follows: player is held in third system time
Row seek operation and the player are within the 4th period plays halted state.
In this case, the embodiment of the present application provides a kind of mode for realizing above-mentioned steps 205: if it is determined that in third system
The system time executes seek operation and the player is in broadcasting halted state within the 4th period and the player exists
Normal playing status is in 5th period, it is determined that actual play duration of the Streaming Media in the first system time
For the sum of the 4th playing duration and the 5th playing duration;
Wherein, product of the 5th playing duration between playback rate duration corresponding with the 5th period.
Another trick play schematic diagram of a scenario provided by the embodiments of the present application is illustrated based on Fig. 5, Fig. 6.
As shown in fig. 6, application layer 101 calls getCurPosition interface in the first system time t2, player 103 exists
Second system time t3 calls UpdateInfo interface, i.e. first time period is section t3 to t2 this period.In third system
Time tseek performs seek operation, the playing duration of player is dragged to the 4th playing duration st, then from second system
In time t3 to section this period third system time tseek, player is in due to not there is enough bottom datas also
Suspend broadcast state, user can intuitively see that player in data buffering, will continue to until bottom there are enough data
It plays.If beginning with enough data from system time t4, player is in the 5th period (i.e. area's this period t4 to t2
Between) in be in normal playing status, then when the actual play of player a length of 4th playing duration st in this section of t4 to t2
The sum of the 5th playing duration in time interval.Actual play duration p can be indicated with following formula (5):
P=st+playbackRate* (t2-t4) ... (5)
In above-mentioned formula (5), p is actual play duration, and st is that player executes seek operation in system time tseek
The played duration reached;PlaybackRate is player plays rate;T2 is that application layer 101 calls getCurPosition
The system time of interface.T4 is the system time that player 103 starts normal play after seek operation.
Based on above-mentioned four kinds of situations, specific callback interface can also be increased in player 101, callback interface is used for the bottom of
The state of layer player notifies upper layer in time, such as when player is in buffer status, will be played by callback interface
The buffer status notice docking layer 102 of device, accurately obtains buffering shape to dock layer 102 by calculating time difference offset
Actual play duration when state occurs.
In one example, it is a length of when updating currently playing if seek is to time st when application layer executes Seek operation
St, at this time if isUnderFlow is 1 in the information that bottom player returns, i.e., bottom data is insufficient at this time, is under
Flow state.The current play time that getCurPosition interface of application layer is got during this is to apply to want Seek's
Time point, a length of st when referring to above situation three, i.e. actual play.After bottom data is enough, it can start to play, pass through at this time
The updated next isUnderFlow of UpdateInfo is 0, referring to above situation four, the actual play that application layer is got at this time
Shi Changwei formula (5).
It in another example,, may when application layer normal play if network environment is poor in normal play
There is bottom player (player) data deficiencies, player is caused to be in Under Flow state, video display downloading
(loading) picture can not continue to play, and bottom player returns to isUnderFlow=1 by individual callback interface at this time,
Referring to Fig. 7, system time when bottom returns to underFlow state is t4;Under Flow state is primary before occurring to update bottom
The system time of the playing duration p2 of layer player is t3, that is to say, that the player in system time t3 to t4 this period
In normal playing status, player is in buffer status in system time t4 to t2 this period, then upper layer is frequently adjusted
When with getCurPosition, the actual play duration got is referring to following formula (6):
P=p2+playRate* (t4-t3) ... (6)
In above-mentioned formula (6), p is actual play duration, and playbackRate is player plays rate;T2 is application layer
101 call the system time of getCurPosition interface.T4 is the system time that player 103 is initially located in buffer status.
Through the foregoing embodiment, due in the actual play duration for determining Streaming Media, when not only allowing for the first broadcasting
It is long, it is also contemplated that the deviation and the Streaming Media in this section of deviation time section of the first system time and second system time are broadcast
State is put, rather than is directly obtained as the prior art using the first playing duration as actual play duration so as to improve
Take the accuracy of actual play duration.
Based on same idea, Fig. 8 illustrates provided by the embodiments of the present application a kind of for obtaining streaming media playing
When growth device structural schematic diagram, as shown in figure 8, the device 800 can be used for executing above-mentioned any one scheme shown in Fig. 2.
The device 800 includes acquiring unit 801 and processing unit 802.
Acquiring unit 801, for obtaining the first playing duration that player updates in the first system time;Described first broadcasts
A length of player played duration in the Streaming Media that the second system time updates when putting;The second system time is less than institute
State the first system time;
Processing unit 802, for determining streaming media playing state of the player in first time period;According to described
The streaming media playing state of first playing duration, the player in first time period determines the Streaming Media described
The actual play duration of one system time;The first time period be the second system time and the first system time it
Between time interval.
In a kind of optionally embodiment, the processing unit 802 is specifically used for: if it is determined that the player is the
Streaming media playing state in one period is normal playing status, it is determined that the Streaming Media is in the first system time
The sum of a length of first playing duration and the second playing duration when actual play;Second playing duration be playback rate with
Product between the corresponding duration of first time period.
In a kind of optionally embodiment, the processing unit 802 is specifically used for: if it is determined that the player is the
In playing halted state and being not carried out seek operation in the first time period in two periods, then the Streaming Media exists
The sum of a length of first playing duration and third playing duration when the actual play of the first system time;Wherein, described
Second time period is any time section in the first time period;The third playing duration be the playback rate and when
The product of long difference;The duration difference is between the corresponding duration of first time period duration corresponding with second time period
Difference.
In a kind of optionally embodiment, the processing unit 802 is specifically used for: if it is determined that in third system time
It executes seek operation and the player is within the third period and plays halted state, it is determined that the Streaming Media is in institute
State a length of 4th playing duration when the actual play of the first system time;Wherein, seek operation is for by the stream
The played duration of media is adjusted to the 4th playing duration;The third period is the third system time and first system
Time interval between the system time.
In a kind of optionally embodiment, the processing unit 802 is specifically used for: if it is determined that in third system time
It executes seek operation and the player is in just within the 4th period in broadcasting halted state, within the 5th period
Normal broadcast state, it is determined that the Streaming Media a length of 4th playing duration in the actual play of the first system time
The sum of with the 5th playing duration;Wherein, the 5th playing duration is playback rate duration corresponding with the 5th period
Between product.
It should be understood that the division of above each unit is only a kind of division of logic function, it in actual implementation can be whole
Or be partially integrated on a physical entity, it can also be physically separate.In the embodiment of the present application, acquiring unit 801 and processing
Unit 802 can be realized by the processor 903 in following Fig. 9.
Based on same idea, Fig. 9 illustrates another kind provided by the embodiments of the present application and broadcasts for obtaining Streaming Media
The structural schematic diagram of growth device when putting, as shown in figure 9, device 900 can be used for executing above-mentioned any one scheme shown in Fig. 2.
Device 900 includes memory 902 and processor 903.
Memory 902 may include volatile memory (volatile memory), such as random access memory
(random-access memory, RAM);Memory also may include nonvolatile memory (non-volatile
), such as flash memory (flash memory), hard disk (hard disk drive, HDD) or solid state hard disk memory
(solid-state drive, SSD);Memory 902 can also include the combination of the memory of mentioned kind.
Processor 903 can be central processing unit (central processing unit, CPU), network processing unit
The combination of (network processor, NP) or CPU and NP.Processor 903 can further include hardware chip.On
Stating hardware chip can be specific integrated circuit (application-specific integrated circuit, ASIC), can
Programmed logic device (programmable logic device, PLD) or combinations thereof.Above-mentioned PLD can be complex programmable and patrol
It collects device (complex programmable logic device, CPLD), field programmable gate array (field-
Programmable gate array, FPGA), Universal Array Logic (generic array logic, GAL) or its any group
It closes.Optionally, together with above-mentioned memory 902 also can integrate with processor 903.
Optionally, memory 902 can be used for storing program instruction, store in the calling of processor 903 memory 902
Instruction, can execute one or more steps in embodiment shown in above scheme (method as shown in Figure 2), or in which can
The embodiment of choosing, so that device 900 realizes the function in the above method for growth device when obtaining streaming media playing.
Processor 903, for executing the instruction of the memory storage, when the processor 903 executes the memory
When the instruction of storage, so that described device 900 executes following operation:
The first playing duration that player updates is obtained in the first system time;First playing duration is the broadcasting
Device played duration in the Streaming Media that the second system time updates;The second system time is less than the first system time;
Determine streaming media playing state of the player in first time period;According to first playing duration, the player
Streaming media playing state in first time period determines the Streaming Media in the actual play of the first system time
It is long;Time interval of the first time period between the second system time and the first system time.
In an optional implementation manner, the processor 903 is specifically used for so that described device executes following behaviour
Make: if it is determined that streaming media playing state of the player in first time period is normal playing status, it is determined that the stream
Media the sum of a length of first playing duration and the second playing duration in the actual play of the first system time;It is described
Product of second playing duration between playback rate duration corresponding with first time period.
In an optional implementation manner, the processor 903 is specifically used for so that described device executes following behaviour
Make: playing halted state if it is determined that the player is in second time period and be not carried out in the first time period
Seek is operated, then the Streaming Media a length of first playing duration and third in the actual play of the first system time
The sum of playing duration;Wherein, the second time period is any time section in the first time period;The third plays
The product of playback rate described in Shi Changwei and duration difference;The duration difference is the corresponding duration of the first time period and the
Difference between two periods corresponding duration.
In an optional implementation manner, the processor 903 is specifically used for so that described device executes following behaviour
Make: if it is determined that executing in third system time, seek is operated and the player is within the third period and plays pause shape
State, it is determined that the Streaming Media a length of 4th playing duration in the actual play of the first system time;Wherein, institute
Seek operation is stated for the played duration of the Streaming Media to be adjusted to the 4th playing duration;The third period is described the
Time interval between three system times and the first system time.
In an optional implementation manner, the processor 903 is specifically used for so that described device executes following behaviour
Make: if it is determined that executing in third system time, seek is operated and the player is within the 4th period and plays pause shape
State is in normal playing status within the 5th period, it is determined that the Streaming Media is actually broadcast the first system time
The sum of a length of 4th playing duration and the 5th playing duration when putting;Wherein, the 5th playing duration be playback rate with
Product between 5th period corresponding duration.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
Now, it when being realized using software program, can entirely or partly realize in the form of a computer program product.The computer
Program product includes one or more instructions.When loading on computers and executing the computer program instructions, whole or portion
Ground is divided to generate according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated computing
Machine, computer network or other programmable devices.Described instruction can store in computer storage medium, or from one
A computer storage medium is transmitted to another computer storage medium, for example, described instruction can be from a web-site, meter
Calculation machine, server or data center are (such as red by wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless
Outside, wirelessly, microwave etc.) mode transmitted to another web-site, computer, server or data center.The calculating
Machine storage medium can be any usable medium that computer can access or include that one or more usable mediums are integrated
The data storage devices such as server, data center.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, magnetic
Band, magneto-optic disk (MO) etc.), optical medium (for example, CD, DVD, BD, HVD etc.) or semiconductor medium (such as ROM, EPROM,
EEPROM, nonvolatile memory (NAND FLASH), solid state hard disk (Solid State Disk, SSD)) etc..
The embodiment of the present application is referring to the method, equipment (system) and computer program product according to the embodiment of the present application
Flowchart and/or the block diagram describe.It should be understood that can be by each process in instruction implementation flow chart and/or block diagram
And/or the combination of the process and/or box in box and flowchart and/or the block diagram.These instructions be can provide to general meter
Calculation machine, special purpose computer, Embedded Processor or other programmable data processing devices processor to generate a machine, make
It obtains and is generated by the instruction that computer or the processor of other programmable data processing devices execute for realizing in flow chart one
The device for the function of being specified in a process or multiple processes and/or one or more blocks of the block diagram.
These instructions also can be loaded onto a computer or other programmable data processing device so that computer or other
Series of operation steps are executed on programmable device to generate computer implemented processing, thus in computer or other are programmable
The instruction that executes in equipment is provided for realizing in one box of one or more flows of the flowchart and/or block diagram or more
The step of function of being specified in a box.
Obviously, those skilled in the art can carry out various modification and variations without departing from this Shen to the embodiment of the present application
Spirit and scope please.In this way, if these modifications and variations of the embodiment of the present application belong to the claim of this application and its wait
Within the scope of technology, then the application is also intended to include these modifications and variations.
Claims (10)
1. a kind of method for obtaining streaming media playing duration characterized by comprising
The first playing duration that player updates is obtained in the first system time;First playing duration is that the player exists
The Streaming Media that the second system time updates played duration;The second system time is less than the first system time;
Determine streaming media playing state of the player in first time period;The first time period is the second system
Time interval between time and the first system time;
According to the streaming media playing state of first playing duration, the player in first time period, the stream is determined
Actual play duration of the media in the first system time.
2. the method as described in claim 1, which is characterized in that described to be existed according to first playing duration, the player
Streaming media playing state in first time period, determine the Streaming Media in the actual play duration of the first system time,
Include:
If it is determined that streaming media playing state of the player in first time period is normal playing status, it is determined that the stream
Media the sum of a length of first playing duration and the second playing duration in the actual play of the first system time;It is described
Product of second playing duration between playback rate duration corresponding with first time period.
3. the method as described in claim 1, which is characterized in that described to be existed according to first playing duration, the player
Streaming media playing state in first time period, determine the Streaming Media in the actual play duration of the first system time,
Include:
If it is determined that the player is not carried out in broadcasting halted state and in the first time period in second time period
Seek is operated, then the Streaming Media a length of first playing duration and third in the actual play of the first system time
The sum of playing duration;
Wherein, the second time period is any time section in the first time period;The third playing duration is institute
State the product of playback rate Yu duration difference;The duration difference is the corresponding duration of the first time period and second time period
Difference between corresponding duration.
4. the method as described in claim 1, which is characterized in that described to be existed according to first playing duration, the player
Streaming media playing state in first time period, determine the Streaming Media in the actual play duration of the first system time,
Include:
If it is determined that executing in third system time, fast forwarding and fast rewinding seek is operated and the player is within the third period and broadcasts
Put halted state, it is determined that the Streaming Media is in the actual play of the first system time when a length of described 4th broadcasting
It is long;
Wherein, the seek operation is for being adjusted to the 4th playing duration for the played duration of the Streaming Media;When the third
Between time interval of the section between the third system time and the first system time.
5. the method as described in claim 1, which is characterized in that described to be existed according to first playing duration, the player
Streaming media playing state in first time period, determine the Streaming Media in the actual play duration of the first system time,
Include:
If it is determined that executing in third system time, seek is operated and the player suspends shape in broadcasting within the 4th period
State and the player are in normal playing status within the 5th period, it is determined that the Streaming Media is in the first system
The sum of a length of 4th playing duration and the 5th playing duration when the actual play of time;
Wherein, product of the 5th playing duration between playback rate duration corresponding with the 5th period.
6. one kind is for growth device when obtaining streaming media playing, which is characterized in that including memory and processor;
The memory is for storing instruction;
The processor is used to execute the instruction of the memory storage, when the processor executes the finger of the memory storage
When enabling, so that described device executes following operation:
The first playing duration that player updates is obtained in the first system time;First playing duration is that the player exists
The Streaming Media that the second system time updates played duration;The second system time is less than the first system time;
Determine streaming media playing state of the player in first time period;According to first playing duration, described broadcast
Streaming media playing state of the device in first time period is put, determines the Streaming Media in the actual play of the first system time
Duration;Time interval of the first time period between the second system time and the first system time.
7. as described in claim 1 for growth device when obtaining streaming media playing, which is characterized in that the processor, specifically
For making described device execute following operation:
If it is determined that streaming media playing state of the player in first time period is normal playing status, it is determined that the stream
Media the sum of a length of first playing duration and the second playing duration in the actual play of the first system time;It is described
Product of second playing duration between playback rate duration corresponding with first time period.
8. as described in claim 1 for growth device when obtaining streaming media playing, which is characterized in that the processor, specifically
For making described device execute following operation:
If it is determined that the player is not carried out in broadcasting halted state and in the first time period in second time period
Fast forwarding and fast rewinding seek operation, then the Streaming Media is in the actual play of the first system time when a length of described first broadcasting
The sum of long and third playing duration;
Wherein, the second time period is any time section in the first time period;The third playing duration is institute
State the product of playback rate Yu duration difference;The duration difference is the corresponding duration of the first time period and second time period
Difference between corresponding duration.
9. as described in claim 1 for growth device when obtaining streaming media playing, which is characterized in that the processor, specifically
For making described device execute following operation:
If it is determined that executing in third system time, seek is operated and the player suspends shape in broadcasting within the third period
State, it is determined that the Streaming Media a length of 4th playing duration in the actual play of the first system time;
Wherein, the seek operation is for being adjusted to the 4th playing duration for the played duration of the Streaming Media;When the third
Between time interval of the section between the third system time and the first system time.
10. as described in claim 1 for growth device when obtaining streaming media playing, which is characterized in that the processor, specifically
For making described device execute following operation:
If it is determined that executing in third system time, seek is operated and the player suspends shape in broadcasting within the 4th period
State is in normal playing status within the 5th period, it is determined that the Streaming Media is actually broadcast the first system time
The sum of a length of 4th playing duration and the 5th playing duration when putting;
Wherein, product of the 5th playing duration between playback rate duration corresponding with the 5th period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910159296.4A CN109996117B (en) | 2019-03-04 | 2019-03-04 | Method and device for acquiring streaming media playing time |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910159296.4A CN109996117B (en) | 2019-03-04 | 2019-03-04 | Method and device for acquiring streaming media playing time |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109996117A true CN109996117A (en) | 2019-07-09 |
CN109996117B CN109996117B (en) | 2021-08-24 |
Family
ID=67129275
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910159296.4A Active CN109996117B (en) | 2019-03-04 | 2019-03-04 | Method and device for acquiring streaming media playing time |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109996117B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110933384A (en) * | 2019-12-17 | 2020-03-27 | 深圳爱克莱特科技股份有限公司 | Offline play synchronous control device and control method of LED play system |
CN112995762A (en) * | 2019-12-02 | 2021-06-18 | 海信视像科技股份有限公司 | Display device and network state synchronization method |
CN114173195A (en) * | 2021-12-10 | 2022-03-11 | 聚好看科技股份有限公司 | Display device and method for counting effective playing time of media assets |
CN114339397A (en) * | 2021-12-23 | 2022-04-12 | 北京百度网讯科技有限公司 | Multimedia editing information determination method, device, equipment and storage medium |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412371B2 (en) * | 2004-06-08 | 2008-08-12 | Northrop Grumman Corporation | Time synchronized playback and control of dissimilar data files |
CN101436915A (en) * | 2008-12-12 | 2009-05-20 | 中兴通讯股份有限公司 | Method and apparatus for receiving and playing multimedia program by mobile terminal |
WO2009120301A2 (en) * | 2008-03-25 | 2009-10-01 | Square Products Corporation | System and method for simultaneous media presentation |
US20140156864A1 (en) * | 2012-12-05 | 2014-06-05 | Industrial Technology Research Institute | Multimedia stream buffer and output method and multimedia stream buffer module |
EP2849004A1 (en) * | 2012-05-07 | 2015-03-18 | Convex Corporation ,ltd. | Relative time display device and relative time display program |
CN104702563A (en) * | 2013-12-06 | 2015-06-10 | 乐视网信息技术(北京)股份有限公司 | Method and device for acquiring streaming media play time |
KR101600891B1 (en) * | 2014-10-17 | 2016-03-09 | 쿨사인 주식회사 | Synchronization method and system for audio and video of a plurality terminal |
CN105653456A (en) * | 2015-12-31 | 2016-06-08 | 网易(杭州)网络有限公司 | Application program performance testing method, device and system |
CN105763949A (en) * | 2014-12-18 | 2016-07-13 | 乐视移动智能信息技术(北京)有限公司 | Audio video file playing method and device |
CN106599165A (en) * | 2016-12-08 | 2017-04-26 | 腾讯科技(深圳)有限公司 | Playing behavior-based content recommendation method and server |
CN106658227A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Video play time length compressing method and device |
CN107608651A (en) * | 2017-07-19 | 2018-01-19 | 肇庆市广应科通用航空研究院 | Player fast forwarding and fast rewinding control method, system, storage medium and intelligent terminal |
-
2019
- 2019-03-04 CN CN201910159296.4A patent/CN109996117B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412371B2 (en) * | 2004-06-08 | 2008-08-12 | Northrop Grumman Corporation | Time synchronized playback and control of dissimilar data files |
WO2009120301A2 (en) * | 2008-03-25 | 2009-10-01 | Square Products Corporation | System and method for simultaneous media presentation |
CN101436915A (en) * | 2008-12-12 | 2009-05-20 | 中兴通讯股份有限公司 | Method and apparatus for receiving and playing multimedia program by mobile terminal |
EP2849004A1 (en) * | 2012-05-07 | 2015-03-18 | Convex Corporation ,ltd. | Relative time display device and relative time display program |
US20140156864A1 (en) * | 2012-12-05 | 2014-06-05 | Industrial Technology Research Institute | Multimedia stream buffer and output method and multimedia stream buffer module |
CN104702563A (en) * | 2013-12-06 | 2015-06-10 | 乐视网信息技术(北京)股份有限公司 | Method and device for acquiring streaming media play time |
KR101600891B1 (en) * | 2014-10-17 | 2016-03-09 | 쿨사인 주식회사 | Synchronization method and system for audio and video of a plurality terminal |
CN105763949A (en) * | 2014-12-18 | 2016-07-13 | 乐视移动智能信息技术(北京)有限公司 | Audio video file playing method and device |
CN106658227A (en) * | 2015-10-29 | 2017-05-10 | 阿里巴巴集团控股有限公司 | Video play time length compressing method and device |
CN105653456A (en) * | 2015-12-31 | 2016-06-08 | 网易(杭州)网络有限公司 | Application program performance testing method, device and system |
CN106599165A (en) * | 2016-12-08 | 2017-04-26 | 腾讯科技(深圳)有限公司 | Playing behavior-based content recommendation method and server |
CN107608651A (en) * | 2017-07-19 | 2018-01-19 | 肇庆市广应科通用航空研究院 | Player fast forwarding and fast rewinding control method, system, storage medium and intelligent terminal |
Non-Patent Citations (1)
Title |
---|
吴烨,程光,胡劲松,徐建: "《新一代互联网流媒体服务及路由关键技术》", 30 November 2017 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112995762A (en) * | 2019-12-02 | 2021-06-18 | 海信视像科技股份有限公司 | Display device and network state synchronization method |
CN110933384A (en) * | 2019-12-17 | 2020-03-27 | 深圳爱克莱特科技股份有限公司 | Offline play synchronous control device and control method of LED play system |
CN114173195A (en) * | 2021-12-10 | 2022-03-11 | 聚好看科技股份有限公司 | Display device and method for counting effective playing time of media assets |
CN114173195B (en) * | 2021-12-10 | 2024-04-12 | 聚好看科技股份有限公司 | Display equipment and method for counting effective playing time of media assets |
CN114339397A (en) * | 2021-12-23 | 2022-04-12 | 北京百度网讯科技有限公司 | Multimedia editing information determination method, device, equipment and storage medium |
CN114339397B (en) * | 2021-12-23 | 2023-08-11 | 北京百度网讯科技有限公司 | Method, device, equipment and storage medium for determining multimedia editing information |
Also Published As
Publication number | Publication date |
---|---|
CN109996117B (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109996117A (en) | A kind of method and apparatus obtaining streaming media playing duration | |
US9369506B2 (en) | Insertion of supplementary content into a segmented content stream | |
CN104185066B (en) | A kind of method and device of automatic Verification electric program menu | |
JP2003533843A (en) | How to improve bandwidth efficiency | |
CA2651105C (en) | Field qualification of disk drives in consumer electronics devices | |
CN108833960A (en) | A kind of method and device of audiovisual applications switching | |
US7877538B2 (en) | Testing data transfer time of disk drives in consumer electronics devices | |
JP2016184774A (en) | Information processing device, information processing method, information processing program, and distribution device | |
CN105224178A (en) | A kind of information processing method and electronic equipment | |
JP2017055379A (en) | Information apparatus and distribution device | |
JP4325194B2 (en) | Apparatus and method for managing access to storage medium | |
CN110113389A (en) | A kind of video broadcasting method, device, electronic equipment and storage medium | |
CN1996478B (en) | Information processing apparatus, imaging apparatus, information processing method | |
JP3915752B2 (en) | Digital information recording apparatus and video recording / reproducing apparatus including the same | |
WO2016155255A1 (en) | Program recording method and apparatus | |
CN112929792A (en) | Sox-based audio processing method and device | |
CN109327713A (en) | A kind of generation method and device of media information | |
EP2808871A1 (en) | Reproduction apparatus, reproduction method, and reproduction program | |
CN103702239A (en) | Network multimedia resource data processing method and device | |
CN115834943B (en) | Audio and video synchronization method and device | |
JP2621189B2 (en) | Large-scale tape cassette playback device | |
CN108429929B (en) | Audio track playing method, device and storage medium | |
JP6847635B2 (en) | Memory management device, video recording / playback device, memory management method, video recording / playback method and computer program | |
CN105072494B (en) | A kind of processing method and processing device of video related information migration | |
KR20060122883A (en) | Method and apparatus for handling a group of at least one data object |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |