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
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.
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>...
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.
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.