On Jan 12, 2011, at 11:04 AM, [email protected] wrote:

> Date: Wed, 12 Jan 2011 11:54:47 +0200
> From: Mikko Rantalainen <[email protected]>
> To: [email protected]
> Subject: Re: [whatwg] HTML5 video: frame accuracy / SMPTE
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> 2011-01-12 00:40 EEST: Rob Coenen:
>> Hi David- that is b/c in an ideal world I'd want to seek to a time expressed
>> as a SMPTE timecode (think web apps that let users step x frames back, seek
>> y frames forward etc.). In order to convert SMPTE to the floating point
>> value for video.seekTime I need to know the frame rate.
> 
> It seems to me that such an application really requires a method for
> querying the timestamp for previous and next frames when given a
> timestamp. If such an application requires FPS value, it can then
> compute it by itself it such a value is assumed meaningful. (Simply get
> next frame timestamp from zero timestamp and continue for a couple of
> frames to compute FPS and check if the FPS seems to be stable.)
> 
> Perhaps there should be a method
> 
> getRelativeFrameTime(timestamp, relation)
> 
> where timestamp is the "current" timestamp and relation is one of
> previousFrame, nextFrame, previousKeyFrame, nextKeyFrame?
> 
> Use of this method could be allowed only for paused video if needed for
> simple implementation.


Alternatively, one could look at a step() function instead of a seek(pos,exact) 
function. The step function can be used for frame-accurate controls. e.g. 
step(2) or step(-1). The advantage over a seek(pos,exact) function (and the 
playback rate controls) is that the viewer really knows the video is X frames 
offset. This is very useful for both artistic/editing applications and for 
video analysis applications (think sports, medical or experiments).

The downside of a step() to either always accurate seeking or a seek(pos,exact) 
is that it requires two steps in situations like bookmarking or chaptering. 

It seems like the framerate / SMPTE proposals done here are all a means to end 
up with frame-accurate seeking. With a step() function in place, there's no 
need for such things. In fact, one could do a step(10) or so and then use the 
difference in position to calculate framerate. 

- Jeroen

Reply via email to