Question about VideRecorderAppState

Hello all,

I was just thinking about the VideoRecorderAppState and I was curious about what exactly gets saved.

I took a look here

and it says

A Video recording AppState that records the screen output into an AVI file with M-JPEG content.

but if you look at the Constructors you see this

Using this constructor the video files will be written sequentially to the user’s home directory with a quality of 0.8 and a framerate of 30fps.

So you can set the FPS as well.

So what I’m curious about is,

  1. The first quote says it’s getting the “screen output” so would that be whenever a screen refreshes, it gets a frame? Or does this mean when the GPU passes that frame it takes it for the video? I’m just curious if we are capped at the Refresh Rate, or the GPU’s frame rate?

  2. We can set the FPS of the video, so I’m curious at what point does it grab the frame? At a certain Synchronized interval?

Thanks for the info :smile:

from javadocs:
framerate - the frame rate of the resulting video, the application will be locked to this framerate

It’ll add a cap on framerate. For example, my game runs at 100~150 FPS, but when recording, VideoRecorderAppState limit the framerate to 30 (or whatever you configure), so the video is recorded at 30fps (which is good if you want to submit it to anywhere and you upload is very limited like me), when record ends, the fps get back to 100~150 FPS.

And note: it locks the frame rate by specifically controlling time. So as long as you’ve based all of your animation, physics, etc. on the tpf value then you are guaranteed to get a smooth 30 FPS (even for a game that runs slower normally) because tpf is constant.

(In the case of a game that gets less than 30 FPS… it will just take longer than a second to render those 30 frames.)

1 Like