frame-rate

Set program to 60FPS, but runs at 120FPS?

蹲街弑〆低调 提交于 2019-12-13 04:39:48
问题 I have a problem that puzzles me. I have this small application that creates a JFrame that should update the graphics at the desired fps. But when I start the application, it runs at 120 fps instead of 60 fps. If I set fps = 30, it runs at 60fps, if fps =60, it runs at 120fps, and so on (to measure the fps I use FRAPS). Here's the SSCCE: import java.awt.*; import javax.swing.*; public class Controller { public static TheFrame window; public static long time = 0; public static boolean funciona

How can I get the frames per sec from the header of an avi xvid video file?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 04:22:43
问题 The following is a hex-ascii dump of the first 300 bytes of an avi xvid file: |52|49|46|46|8c|79|95|00|41|56|49|20|4c|49|53|54|94|6a|00|00 RIFF.y..AVI LIST.j.. |68|64|72|6c|61|76|69|68|38|00|00|00|40|9c|00|00|00|ec|36|00 hdrlavih8...@.....6. |00|00|00|00|10|00|00|00|81|01|00|00|00|00|00|00|01|00|00|00 .................... |df|9e|01|00|d0|02|00|00|40|02|00|00|00|00|00|00|00|00|00|00 ........@........... |00|00|00|00|00|00|00|00|4c|49|53|54|3c|69|00|00|73|74|72|6c ........LIST<i..strl |73|74|72

Fixed frame rate using android Camera2 api

六月ゝ 毕业季﹏ 提交于 2019-12-12 17:15:53
问题 I'm very new to android. I'm trying to develop an application using android camera2 api and i want to maintain a steady frame rate for that. I could not find any example on how to achieve a fixed frame rate. By experimenting i can see that application gets around 5-7 FPS. but it's varying. A detailed method to get a fixed frame rate is highly appreciated. Thanks in advance. 回答1: Have you set the AE target FPS range to what you want? What resolution are you trying to read? On LEGACY-level

Limit while loop to run at 30 “FPS” using a delta variable C++

耗尽温柔 提交于 2019-12-12 15:25:56
问题 I basically need a while loop to only run at 30 "FPS". I was told to do this: "Inside your while loop, make a deltaT , and if that deltaT is lesser than 33 miliseconds use sleep(33-deltaT) ." But I really wasn't quite sure how to initialize the delta/what to set this variable to. I also couldn't get a reply back from the person that suggested this. I'm also not sure why the value in sleep is 33 instead of 30. Does anyone know what I can do about this? This is mainly for a game server to

Fastest 2D frame rate possible with android NDK, my try included, better options available?

邮差的信 提交于 2019-12-12 09:05:15
问题 Fastest 2D frame rate possible with android NDK, my try included, better options available? I used the NDK and OpenGL ES 2.0 to display a frame as a texture on a GL_TRIANGLE_STRIP. This was done on a HTC Desire, same hardware as Nexus One. I tried to load multiple GL_RGBA textures and switch between the textures, because the normal fill rate with a single texture was disappointingly low: 1 texture: 4.78 fps 2 textures: 19.68 fps 3 textures: 20.18 fps 4 textures: 28.52 fps 5 textures: 29.01

How to implement SlowMotion and TimeLapse video recording using Camera API

一个人想着一个人 提交于 2019-12-12 07:38:26
问题 Is there any way to implement Slow Motion and Time Lapse recording using Camera API? I tried using MediaRecorder setting VideoFrameRate , VideoBitRate VideoCaptureRate but nothing work for me. I have successfully implemented using JNI but i found it is taking too much time and not optimized as well. If you find any other solution available please help me. 回答1: I solved it myself and i am sharing my working code piece , just using Camera API slow motion and timelapse are implemented Before

How to assemble animation from an array of images with the highest FPS possible on iOS?

孤者浪人 提交于 2019-12-12 01:09:37
问题 I apologize in advance if this question sounds dumb. I have an array of images produced by another project, and I want to show them on the screen in sequence as fast as possible to assemble them to animation. How should I do this to achieve a frame rate at least higher than 30FPS? I'm new to iOS development and I'm not sure where to start with. Should I look into Core Animation or OpenGL or Quartz2D or something else? Can someone please point me a direction? Thanks a lot! Really appreciate

how does video player calculate single frame duration?

假装没事ソ 提交于 2019-12-11 17:51:56
问题 I am working on a project where I am muxing h264 raw stream into fmp4 so I can play it through MSE (Media source extension) I am bit confused about frame duration. For example, If I provide 30 frames and timescale is 1000, it plays for 1 second. If I change timescale to 800, it plays for 2 seconds for the same 30 frames If I change timescale to 500, it plays for 3 seconds for the same 30 frames My question, how does the player calculate a single frame duration from timescale? 来源: https:/

How do prevent my FPS dropping when loading spritesheet in java?

血红的双手。 提交于 2019-12-11 16:17:01
问题 Hey guys i have been java game programming fr a while and i hava had a problem lately. When i load a relatively small sprite sheet in java my FPS goes from 500 to 250 and makes my game pretty laggy. If anyone knew a way to make a java game less laggy and get better FPS, that would be great! BufferedImage spriteSheet = ImageIO.read(new File(spriteSheetLocation)); sprites = new BufferedImage[rows * columns]; for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { sprites[(i *

Java: Speed up my code

隐身守侯 提交于 2019-12-11 16:06:47
问题 I have been coding an application which renders tiles and GUI and all that. I seem to have come across a problem where my paintComponent seems to hog too much CPU and can no longer run much higher than 10 FPS on my small computer. I was wondering if there was any more efficient way of running this code or threading it or anything to enhance the calculation speed. Here is my code: import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import javax.swing.JPanel;