Coder Social home page Coder Social logo

Comments (3)

saudet avatar saudet commented on July 16, 2024

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.

MkrMkr avatar MkrMkr commented on July 16, 2024

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.

saudet avatar saudet commented on July 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.