frame-rate

How do I render a video from a list of time-stamped images?

感情迁移 提交于 2019-12-01 03:24:54
I have a directory full of images following the pattern <timestamp>.png , where <timestamp> represents milliseconds elapsed since the first image. input.txt contains a list of the interesting images: file '0.png' file '97.png' file '178.png' file '242.png' file '296.png' file '363.png' ... I am using ffmpeg to concatenate these images into a video: ffmpeg -r 15 -f concat -i input.txt output.webm How do I tell ffmpeg to place each frame at its actual position in time instead of using a constant framerate? Following LordNeckbeard's suggestion to supply the duration directive to ffmpeg's concat

Generate (Poisson?) random variable in real-time

放肆的年华 提交于 2019-11-30 23:09:28
I have a program running in real-time, with variable framerate, e.g. can be 15 fps, can be 60fps. I want an event to happen, on average, once every 5 seconds. Each frame, I want to call a function which takes the time since last frame as input, and returns True on average once every 5 seconds of elapsed-time given it's called. I figure something to do with Poisson distribution.. how would I do this? It really depends what distribution you want to use, all you specified was the mean. I would, like you said, expect that a Poisson distribution would suit your needs nicely but you also put

How many ways to calculate the FPS (Frames per second) of an iOS App programmatically?

大城市里の小女人 提交于 2019-11-30 21:42:39
Since we are talking about programmatically , Instruments are not under my consideration. Some reference listed in advance: Calculate fps (frames per second) for iphone app Display FPS on iOS onscreen (without Instruments) At what framerate does the iOS UI run animations at? 1. Using CADisplayLink According to the doc, The duration property provides the amount of time between frames. You can use this value in your application to calculate the frame rate of the display... So in my demo project, I add a displayLink to mainRunLoop for UITrackingRunLoopMode: self.displayLink = [CADisplayLink

How do I make a JavaScript animation play at the same speed on all browsers on all systems?

天涯浪子 提交于 2019-11-30 20:33:49
I have a function that calculates the next frame in an animation of various objects moving in both X and Y axis [ I call it frameRender() ] and a function that applies that resulting frame to the objects [ I call that frameDisplay() ]. The objects don't just move from point A to B, they move constantly, always receiving new target coords. I use a setInterval() with a 1000/frameRate interval but that doesn't seem to work at all as browsers don't have accurate timings. The question is: How can I make sure the animation has a constant frame rate, and will run at the same speed on all browsers, on

How to make a render loop in WPF?

一世执手 提交于 2019-11-30 19:53:46
How can I create a loop that will be continuously executed whenever the message loop is idle in WPF? The goal here is to perform some long running graphical update, such as refreshing a PicktureBox , that is capable of consuming whatever free resources are available but shouldn't freeze the UI or otherwise take priority over any other operations in the message queue. I noticed this blog post which provides the code to do this in a winforms application, but I don't know how to translate it to a WPF application. Below is the code of a WinForms render loop class that I made based on the other

How to fix Slow Rendering (Android vitals)

a 夏天 提交于 2019-11-30 16:44:18
问题 I have an app that is listed as in the bottom 25% in the new Google Play Console - Android vitals section for Slow Rendering. I am concerned of this because of such articles that seem to say Google Play may penalize your app in the Play Store rankings if you fall in the bottom 25%. However, it seems impossible to improve this metric for my app. It plays music and has a SeekBar and TextView which is updated every 250ms as any music player would. I made the minimum basic program to demonstrate:

Limit FPS in Libgdx game with Thread.sleep() doesn't work

倖福魔咒の 提交于 2019-11-30 16:02:09
I am developing a little game for android with libgdx and want to limit the fps to 30 to save battery. The problem is that it doesn't work. The fps just drops from 60 to 56. Here is the part of the code: (it's at the end of the render part) System.out.print("\nFPS: " + Gdx.graphics.getFramesPerSecond() + "\n"); if(Gdx.graphics.getDeltaTime() < 1f/30f) { System.out.print("DeltaTime: " + Gdx.graphics.getDeltaTime() + " s\n"); float sleep = (1f/30f-Gdx.graphics.getDeltaTime())*1000; System.out.print("sleep: " + sleep + " ms\n"); try { Thread.sleep((long) sleep); } catch (InterruptedException e) {

Constant FPS Android OpenGLES

不打扰是莪最后的温柔 提交于 2019-11-30 10:51:23
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 to Setting->Power saving and check System power saving I realize that rendering is automatically locked

setPreviewFpsRange not working despite values being within getPreviewFpsRange's range

余生长醉 提交于 2019-11-30 10:34:18
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, I tried this code on my older Motorola Atrix (which shows a valid fps range to be between 10000 and

How many ways to calculate the FPS (Frames per second) of an iOS App programmatically?

落爺英雄遲暮 提交于 2019-11-30 05:38:04
问题 Since we are talking about programmatically , Instruments are not under my consideration. Some reference listed in advance: Calculate fps (frames per second) for iphone app Display FPS on iOS onscreen (without Instruments) At what framerate does the iOS UI run animations at? 1. Using CADisplayLink According to the doc, The duration property provides the amount of time between frames. You can use this value in your application to calculate the frame rate of the display... So in my demo project