Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SeekCurrentPosition

89 views
Skip to first unread message

Marcus

unread,
Jan 16, 2003, 4:18:20 AM1/16/03
to

Hi all,

Has anyone used the SeekCurrentPosition method of the
VIDEO object? One of the parameters is called TIME (type
DOUBLE), but no matter what value I use I cannot make it
move position during the playback of the AVI - it just
appears to start from the beginning again.

Because the documentation is not complete, it doesn't tell
me what the TIME parameter relates i.e. milliseconds,
second, frames etc. Can anyone help?

Cheers,

Marcus

The March Hare (MVP)

unread,
Jan 16, 2003, 10:13:16 AM1/16/03
to
What language are you programming in? What version of DirectX? A code
snippet would be useful too.


Marcus

unread,
Jan 16, 2003, 10:36:47 AM1/16/03
to
TMH,

Sorry, I should have said. I'm using VB.NET with the
managed DirectX9 assemblies
(Microsoft.DirectX.AudioVideoPlayback).

Example:-

dim aviFile as New Video("c:\test.avi")

aviFile.Play
aviFile.SeekCurrentPosition(time:=3,
flags:=SeekPositionFlags.AbsolutePositioning)

I think that should start playing, and then jump 3 seconds
in, but it does not. If I move the SeekCurrentPosition
call into a command button, start playback with the Play
method, and then click the button, playback seems to start
from the beginning, rather than from 3 seconds in.

harish

unread,
Jan 16, 2003, 11:29:25 AM1/16/03
to
Hi,
I could'nt find the "SeekCurrentPosition " method you mentioned,
but if you are using the IMediaSeeking or the IMediaPosition
interfaces then the seeking is usually done in TIME_FORMAT_MEDIA_TIME
where the time is in 10,000,000 th of a second. So if you were giving
seek time in seconds, you would end up seeking to the beginning of the
stream again and again :-).

You could simply give seektime=(time in secs )*10,000,000.
Alternatively, the graph could be working in other formats like frame
or byte,
you can check / set the current time format using the
IMediaSeeking::SetTimeFormat function.

regards & happy seeking

"Marcus" <marcus...@omsystems.co.uk> wrote in message news:<5ac001c2bd40$367614a0$d7f82ecf@TK2MSFTNGXA14>...

The March Hare (MVP)

unread,
Jan 16, 2003, 11:24:29 AM1/16/03
to
> I think that should start playing, and then jump 3 seconds
> in, but it does not. If I move the SeekCurrentPosition
> call into a command button, start playback with the Play
> method, and then click the button, playback seems to start
> from the beginning, rather than from 3 seconds in.

I don't use VB.NET, but what if you reverse the order of the Seek and Play
calls? To do this you may need to Pause the graph before you seek, if there
is a Pause method on the VIDEO object.


marcus

unread,
Jan 16, 2003, 12:04:23 PM1/16/03
to

I think I may have already tried that, but I'll give it a
try and post the outcome. Cheers mate.

marcus

unread,
Jan 16, 2003, 12:07:26 PM1/16/03
to

Harish,

I'm using VB.NET, and I guess you're using C++, so thats
why you couldn't find the method, but your comments are
still valid for VB.NET, i'm sure. I'll have a look at
specifying seconds multplied by 10,000,000 and see what
happens. Cheers mate.

The March Hare (MVP)

unread,
Jan 16, 2003, 12:11:36 PM1/16/03
to

"marcus" <marcus...@omsystems.co.uk> wrote in message
news:5b8101c2bd81$514b85d0$d4f82ecf@TK2MSFTNGXA11...

> I think I may have already tried that, but I'll give it a
> try and post the outcome. Cheers mate.

If the docs say REFERENCE_TIME, then see harish's post for how to set the
time.

Also, some AVIs do not support seeking. There is a method on IMediaSeeking
in C++ to check the capabilities on the graph, but I don't know if it is
exposed to VB.NET.


0 new messages