Comments (7)
Please use the Forum for questions: http://forum.processing.org. This place is for bug reports. FYI, there's an example that comes with the video library that covers this question.
from processing-video.
The Libraries->video->Movie->Frames example has the frame rate hard-coded and does not ever actually get the frame rate from the Movie class.
int movFrameRate = 30;
None of the other examples I saw get frame rate either. I've also looked through the source code for the Movie class, and the only relevant method I could find is marked protected:
protected float getSourceFrameRate() {…}
I've tried signing up in the forum, but am still waiting for the confirmation email. I can continue this discussion there if you prefer.
-Kris
On Dec 11, 2014, at 4:18 PM, Casey Reas [email protected] wrote:
Closed #19.
—
Reply to this email directly or view it on GitHub.
from processing-video.
I'm not sure what issues, if any, getting the frame rate has. Maybe @codeanticode can let us know.
from processing-video.
The Movie class has a public field, frameRate, that contains the frame rate the video file is being played at. You can change the current frame rate with the frameRate(fps) method:
import processing.video.*;
Movie movie;
void setup() {
size(640, 360);
background(0);
movie = new Movie(this, "transit.mov");
movie.loop();
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
image(movie, 0, 0, width, height);
println(movie.frameRate);
}
void keyPressed() {
movie.frameRate(1);
}
@krismz let me know if this works for you. The Frames example should use of Movie.frameRate instead of the hard-coded value, thanks for pointing that out!
from processing-video.
@krismz did you try the code I posted in the previous comment?
from processing-video.
Yes, that worked for me, thanks! But it seems that frameRate is always the current playing frame rate of the movie which is only the same thing as the original frame rate prior to any sort of call to movie.frameRate(some_other_frame_rate). Is this true? If I want to skip to a specific frame in a movie, I need to jump based on the original source frame rate, not the current playing frame rate. I'm handling this now by saving off the value of movie.frameRate just after my first call to movie.read().
from processing-video.
@krismz thanks for the observation. The documentation is a bit ambiguous on this, since while it does describe the frameRate() function, it does not make any reference to the frameRate variable. My interpretation is that it should contain wherever was last set with frameRate(), which is consistent with the usage of the frameRate variable in PApplet.
@alignedleft @REAS do you have any comments? Should we add an entry for the frameRate variable in the video documentation? Should we start the original frame rate of the movie file somewhere?
from processing-video.
Related Issues (20)
- Can't capture webcam pixel when switch to P3D, everything turns black HOT 7
- video capture causes `GStreamer-CRITICAL` error on Apple Silicon (M1) HOT 6
- video library HOT 3
- myMovie.time() returns incorrect value HOT 1
- camera on macOS HOT 1
- Can not use in RPI4? HOT 2
- Gstreamer shared libraries not found; Ubuntu HOT 2
- linux: no symlinks for libraries HOT 2
- Need to seek a movie using the scroll wheel
- Video library(capture) not working when exporting the application (Windows)
- GstBus infinite threads can lead to crash
- movieEvent bug in combination with mipmaps HOT 1
- libffi.so.7 missing from linux libs
- Processing exits without error message on invalid file name with P2D or P3D HOT 2
- video library not working on debian 12: "Unable to load library 'avresample'" and other error messages HOT 8
- importing existing gst library in library folder produce Error HOT 1
- Using the video library outside the pde
- bug in parseCaps
- OSX 14.4.1 Sonoma upgrade breaks USB webcams - seems to be an issue with Java/Processing video library HOT 4
- Current GStreamer not detecting OBS virtual cams
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from processing-video.