Position property in media element

S

Shmuel Naaman

Hi all,
I am creating a media player using the Media element in wpf msVS 2008;
one of my tasks is to implement Frame-by-Frame navigation.
The files I play are AVI files that are composed from 1080 by 720 jpg
2000 files; I am using the Morgan decoder for this task.
When I trigger Media1.Pause() the playback is paused on a specific
frame but when I get the next frame by a code like this:
Media1.Pause();
Int MiliPerFrame = 1000/30;// the time each frame lasts
Int FrameNumber = Media1.Position / MiliPerFrame ;
FrameNumber ++;
ShowFrame(FrameNumber)// this function Loads the frame from theAVI
stream and display it on a Image control in order to work around the
Scrubbing enable property of the media element.
The play back will jump to a previous place in the film. What happens
is the playback is slower because of the HD decoding and so the
Position property will not report the real plase in the film: if a
play back of a 30 seconds film takes 40 seconds when I pause the film
after 20 seconds I get the frame that is actually in second 15.
So, my question is: is there a way to retrieve the actual frame number
in a more reliable way? Alternatively, a way to force the play back to
be bound to the real time (and skip frames in regular playback mode).
If any one has an answer or any idea how to establish the Frame by
Frame in a HD AVI movie in a reliable way, please help me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top