Comments (3)
This is mainly a problem with FFmpeg I fear. When capturing from a camera, for example, we can for example ask it to set the frame rate to 22 FPS, but if the camera doesn't support it, it sets it to the nearest supported value, say 25 FPS, and returns that. In the case of video files, the value is simply ignored, but I don't see a way to query whether the value gets ignored or not. Do you know of some functionality in FFmpeg that would let us query this state? Thanks!
from javacv.
If I do I'll write about it here. But i think now that... maybe current solution isn't so bad and whole problem dosen't in fact require so much effort... I did some changes in my code, and added this method:
public void setUserFrameRateRatio(double customFrameRate) { //value from range 0-1
this.userFrameRateRatio = customFrameRate;
}
//some code later...
//oneFrameTime = 1000 / grabber.getFrameRate(); // old solution
//new solution:
oneFrameTime = 1000 / (grabber.getFrameRate()*getUserFrameRateRatio());
...and that's enough to control whether movie should be playing slower or faster than in original (and by the way I still can get infos about oryginal FPS from .getFrameRate()). So what about just some kind of function which will return oryginal FPS "scaled" (or modified in some smarter way) by user e.g:
setScaledFrameRate(double scaleFactor /* Or maybe how much FPS should be added to oryginal value or smth. similar..*/);
and getScaledFrameRate(); ?
from javacv.
Well, like you say this can easily be added in the player's code, so I don't feel we need to have this in the grabber itself.
from javacv.
Related Issues (20)
- RTSP stream stops after 30 secods when using TCP HOT 3
- FFmpegFrameRecorder how to record each frame from RTMP streams of dynamic frames HOT 1
- Passing OpenCV Mat as Tensorflow input HOT 2
- Raspberry Pi 5 with modern video stack and PiCamera HOT 4
- RTSP video is distorted with FFmpegFrameGrabber
- Doubts about usage of PointerScope HOT 7
- Linux environment: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil HOT 4
- a
- FFMPEGFrameGrabber.start() doesn't find stream most of the time and blocks the thread it's running in from running its course HOT 4
- how can i use JavaCV 1.5.9 and ffmpeg 6.1.1? HOT 2
- how to set connect timeout, for grabber.start() is blocked HOT 2
- FFmpegFrameGrabber HOT 2
- 1.5.10 Could not initialize class org.bytedeco.javacpp.avutil Linux x86_64 HOT 1
- Unable to push to srs server HOT 1
- I really have no choice but to ask everyone HOT 2
- Missing 32 bit files HOT 1
- FFmpegFrameRecorder recorder?.start() Hangs Indefinitely HOT 1
- A fatal error has been detected by the Java Runtime Environment - new pc HOT 8
- How to set shortest when using FFmpegFrameRecorder to record and merge two video files ? HOT 1
- Failed to load XXXX when running on Linux HOT 1
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 javacv.