frame-rate

How to make timer for a game loop?

拜拜、爱过 提交于 2019-12-20 15:29:44
问题 I want to time fps count, and set it's limit to 60 and however i've been looking throught some code via google, I completly don't get it. 回答1: You shouldn't try to limit the fps. The only reason to do so is if you are not using delta time and you expect each frame to be the same length. Even the simplest game cannot guarantee that. You can however take your delta time and slice it into fixed sizes and then hold onto the remainder. Here's some code I wrote recently. It's not thoroughly tested.

HTML5 Canvas performance - calculating loops/frames per second

无人久伴 提交于 2019-12-20 09:40:44
问题 I know a few questions have been asked like this one before, such as this: Check FPS in JS? - which did work to some degree, I was able to find out how long each loop took to complete. What I am looking for though is something more readable and controllable. I want to be able to set the refresh rate for the FPS counter to make it slow so it is human readable or as fast as the application can run, so I can use it on some kind of speedometer. Anyway so here is the code I have right now: var

Calculating number of messages per second in a rolling window?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 09:01:19
问题 I have messages coming into my program with millisecond resolution (anywhere from zero to a couple hundred messages a millisecond). I'd like to do some analysis. Specifically, I want to maintain multiple rolling windows of the message counts, updated as messages come in. For example, # of messages in last second # of messages in last minute # of messages in last half-hour divided by # of messages in last hour I can't just maintain a simple count like "1,017 messages in last second" , since I

Android 2d canvas game: FPS Jitter problem

怎甘沉沦 提交于 2019-12-20 08:56:01
问题 I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate. I tried setting the thread priority higher but that just made it worse... now it will fluctuate between 40-60fps... I was thinking of limiting the FPS to about 30 so that it will be

ffmpeg CLI set -r 30 if input => 30 fps, else -r to take input fps if < 30 fps

扶醉桌前 提交于 2019-12-20 07:35:32
问题 I posted my original question here. Tried suggested solution. But it does not solve my question. Here's what I did. Download this video from Youtube as a test. Using ffprobe gives: Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 1k tbn, 119.88 tbc (default) The ffmpeg command I used: ffmpeg -i Iron_Man_1080p_60fps.mp4 -vf "select='eq(n,0)+if(gt(t-prev_selected_t,1/30.01),1,0)'" -vsync 0 -c:v libx265 -crf 28 -c:a aac -b:a

Is there a solution for HTML5 canvas animation stutter?

為{幸葍}努か 提交于 2019-12-19 10:52:04
问题 I am working on a HTML5 canvas animation (to be more precisely a photo slideshow). So far all my slideshows are in flash because last time (March 2010) I looked ihe framerate for Flash was much higher 3x - 4x compared to html5 canvas. Today it is said that current browsers catched up with flash but all the html5 canvas samples I have found so far stutter in current Firefox and Chrome browsers. IN the sample setInterval is set to 15ms which should give alt least 60 fps. But at on my laptop the

Constant FPS Android OpenGLES

我与影子孤独终老i 提交于 2019-12-18 13:53:19
问题 Hello android developers, I am developing a simple game for Android in Eclipse using OpenGLES 1.0. I am using Samsung Galaxy S2 Android(2.3) as a device for development. And I have a question about dual core and making frame rate constant. So I have managed creating GLSurfaceView and override onDrawFrame() function where I call LogicUpdate(deltatime) function and Render() function. Yes, all in single thread for now. The problem I am getting is with dual core. If I disable dual core by going

setPreviewFpsRange not working despite values being within getPreviewFpsRange's range

限于喜欢 提交于 2019-12-18 13:37:47
问题 This simple code: Camera.Parameters params = currentCamera.getParameters(); params.setPreviewFpsRange( 10000, 15000 ); currentCamera.setParameters( params ); does not work on my Nexus 4 (or my Motorola Atrix), despite the allowed values being between in the allowed range of 5000 to 120000. When I try to use any min or max values different than 5000 and 120000, respectively, I get: setPreviewFpsRange(const android::QCameraParameters&): error: FPS range value not supported which is silly. Also,

How do I reduce frames with blending in ffmpeg

放肆的年华 提交于 2019-12-18 13:24:27
问题 I am trying to convert some files into ProRes. One fairly important part of the conversion is: reducing frames from 60 to 30 blending every 2 frames into one and achieving a more fluent movement. (a simple sort of motion blur) I have tried the -blend command, however it was not recognized as a command. -i source.mp4 -r 30 -vcodec prores_ks -profile:v 0 Output.mov How do I reduce frames with blending in ffmpeg? 回答1: Try ffmpeg -h or ffmpeg --help and you'll have a short help. Please read it. :

Any way to speed up Python and Pygame?

做~自己de王妃 提交于 2019-12-18 11:53:24
问题 I am writing a simple top down rpg in Pygame, and I have found that it is quite slow.... Although I am not expecting python or pygame to match the FPS of games made with compiled languages like C/C++ or event Byte Compiled ones like Java, But still the current FPS of pygame is like 15. I tried rendering 16-color Bitmaps instead of PNGs or 24 Bitmaps, which slightly boosted the speed, then in desperation , I switched everything to black and white monochrome bitmaps and that made the FPS go to