frame-rate

Turned off VSync but still getting 60FPS in my DirectX 9 application

心已入冬 提交于 2019-12-08 05:43:53
问题 I have an DirectX9 application which only renders a triangle on the screen, but I am getting a frame rate of 60 FPS no matter if I've got VSync on or not. Why is this? Here is the code I've done to calculate the FPS, but I dont know if this is the problem to it. GameTimer.h #pragma once #include "Windows.h" class GameTimer { public: GameTimer(); ~GameTimer(){} void Update(); float GetFrameTime(); inline float GetFramePerSec(){return framesPerSec;} inline float GetMillSecPerFrame(){return

How to set camera fps in opencv?

南楼画角 提交于 2019-12-08 04:13:47
问题 I'm using a webcam supporting 1280 x 720 @ 60 fps. My computer environment is intel i5-4690K and Windows7, Visual studio 2015, opencv 3.1 When I run the webcam in Kinovea(0.85.15, https://www.kinovea.org/), the camera run at the 1280 x 720 @ 60fps. But, In Visual studio with Opencv, it isn't work @ 60 fps. It just work only 12~15 fps. My code for checking the camera fps is below. #include <stack> #include <iostream> #include <math.h> #include "opencv2/highgui/highgui.hpp" #include "opencv2

Custom vsync Algorithm

十年热恋 提交于 2019-12-08 03:49:44
问题 When creating a game with any programming language (that can), it is important to have a fixed target frame rate the game will redraw the screen at, however some languages either do not have a sync function or timers are unreliable so is there any method of keeping the frame rate steady manually with only math and/or by sleeping the thread? Maybe using a frame delta? So far I have only tried 'sleep(targetframerate - (targetframerate-delta))' This is supposed to realise that the previous frame

AS3 - How much time until next frame / screen draw

痴心易碎 提交于 2019-12-08 01:32:42
问题 I have a generative art app, and I'd like it to draw as many cycles as possible each frame without reducing the framerate. Is there a way to tell how much time is left until the screen updates/refreshes? I figure if I can approximate how many milliseconds each cycle takes, then I can run cycles until the amount of time left is less than the average or the peak cycle time, then let the screen refresh, then run another set of cycles. 回答1: If you want your app to run at N frames per second, then

Am I calculating my FPS correctly?

心不动则不痛 提交于 2019-12-07 17:03:47
问题 So I was wondering if I'm calculating my FPS correctly: Uint32 delayFrom(float startTime, float endTime){ return(endTime - startTime ); } int main(){ int numFrames = 0; Uint32 startTime = SDL_GetTicks(); while(!done){ frameTime = 0; float fps = ( numFrames/(float)(SDL_GetTicks() - startTime) )*1000; cout << fps << endl; SDL_Delay(delayFrom(frameTime, 1/60)); ++numFrames; } } 回答1: int main() { int numFrames = 0; Uint32 startTime = SDL_GetTicks(); while (!done) { ++numFrames; Uint32 elapsedMS =

Frame Capture using Matrox Commands

穿精又带淫゛_ 提交于 2019-12-07 15:48:43
问题 I'm working on a project where I have to set the fps of a video stream (as 10) from a camera and grab a frame every 5th frame. I'm working on a program that has already been half written by someone else. The thing is, they have used Matrox Framegrabber dlls. There is also Matrox Frame Grabber on the device. But I cant find any commands for framegrab in C#. I found the following code for C++. MIL_ID MdispAlloc(SystemId, DispNum, DispFormat, InitFlag, DisplayIdPtr) where MIL_ID SystemId; System

Low FPS with android SurfaceView

与世无争的帅哥 提交于 2019-12-07 09:28:33
问题 I have some trubles with my framerate using a SurfaceView. Im doing the tipical stuff i found in some tutorials (all of them said the same), but i cant reach a decent framerate on my samsung galaxy S (the old one, i9000). Here's the code i have for the loop thread. FPS is initialized at 30. @Override public void run() { long ticksPS = 1000/FPS; long startTime; long sleepTime; //fps checker long contms=0; long lasttimecheck = System.currentTimeMillis(); int fps=0; while (running) { long time =

Change Frames Per Second for VLC Stream

感情迁移 提交于 2019-12-07 08:53:40
问题 We are currently experimenting with streaming a webcam attached to one of our Linux servers (Ubuntu 12.04) using VLC, and although we are able to successfully stream the video and view it remotely, we need to change the number of frames per second (which is defaulting to 24). We are currently using the following command to create the stream: vlc v4l2:// :v4l2-dev=/dev/video0 \ :v4l2-width=640 \ :v4l2-height=480 -- \ sout="#transcode{vcodec=theo,vb=256}:standard{access=http,mux=ogg,dst=:8090}"

Why does camera frame rate fluctuate when fusing another sensor?

孤者浪人 提交于 2019-12-07 03:48:24
I am a new baby in Android programming so that I am facing a problem related to videos when doing my research project. In the project, we would like to build an application which uses both videos recorded by a built-in front camera and acceleration sensed by a built-in accelerometer. My problem is that the frame rate of these videos usually fluctuates from 15 fps to 30 fps even though I have set the camera fixed at 30 fps in the source code. I tried to close the data stream of the accelerometer to test the consistency of the frame rate. However it has been still fluctuated. I tested this

Display FPS on iOS onscreen (without Instruments)

北战南征 提交于 2019-12-06 21:20:05
问题 In WWDC 2012 Session 506, they display the frames per second on a UILabel in the application, without having to use the Core Animation profiler attached to instruments. I would like to do this for convenience as well as to let other members of my team monitor FPS as they use the app in real-world scenarios. Unfortunately, session 506 isn't included the the WWDC '12 sample code. Does anyone know how to do this? I know that Cocos2D has this capability in their CCDirector , but their approach