PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

How to skip video frames while playing video file?

I have folowing trouble.

When speed of video rendering is slow, the time of video playing is longer.

How can I make playback time constant?

The reason in that I need to syncronize it with soundtrack, and I will be not able to do this if time of video playback will depends on CPU speed of device.

Best regards to all.
Hi Nomad,

Currently, there is no way to skip frames in GledVideo.
If you want to be sure that you won't kill your processor, maybe the best way to do this, is to have a 16 fps video and decode it in this way:
Code:

if(counter++%2)
video->getNextFrame(&surface;);
pBackBuffer->bltFast(0, 0, &surface;);

Or maybe you could have a 21 FPS video, and you could render it like this:
Code:

if(counter++%3)
video->getNextFrame(&surface;);
pBackBuffer->bltFast(0, 0, &surface;);


Does this work for you?

Best regards,
Sergio.
Nomad · 02 Nov 2006, 21:16 UTC — No. I wish it was suitable for me.
Hi Sergio.
Thanks for your reply.

I'm sorry, but your solution is not suitable.

onNextFrame() is not fired firmly and constantly every 1/32 of second. So it is wrong to rely on this. I have checked that. When I show 1 fullscreen picture and some text the delay is close to 20 ms (about 1/50 of second). I used GetTickCount() to measure time between frames.

Skipping frames technique will handle not only 16 fps situation but all lower fps situation. When I turn on power safe mode on my device (ASUS MyPAL A730) I get 6-7 fps and I want to handle this situation normaly too.
Hi Nomad,

There are 2 different things to answer here:

1. We are aware that current GledPlay fps system is not the best. We've been working on it for a while now, and there going to be several improvements on in on the next release (next week). We'll add more precision to it, we'll let the user select the desired frame rate, and there will be some extra functionality to query and control FPS.

2. You are right about adding skipping frame functionality to the Video class. We are adding that to our list of priorities.

Best regards,
Sergio.
Hi Sergio!

Your words that frameskipping will be in two weeks is good for library but not for me. Because I have no such time. And my deadline for current project is in 4 days.

I saw method fillSurfaceWithFrame() in Video class. Can you tell me something about it? Maybe, I can use it to implement my own video decompression method into my project. And can you tell me, what video decompression library did you use?

Best regards, Nomad.
Hi Nomad,
Let me tell you that we understand your situation. We are planning to add the "skipNextFrame" method to Video on the release on next Monday.
The thing is that it is already implemented, and it seems to be working OK. But it haven't passed through QA analysis yet (CppUnits, portability test, etc).
What we can do for you is to send you today a pre-release of it. You can work on it, use the Fps and skipNextFrame functionality, and then on Monday, you can update the lib binaries with the official release.
Does that sound OK for you?

Regards,
Sergio.