-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFmpegFrameGrabber set Frame skipping #1877
Comments
We can call grabAtFrameRate() instead of grab(), if that's what your looking for? |
grabAtFrameRate() Can't do it,It seems that I can only discard some frames manually. |
That sounds maybe like grabKeyFrame()? |
Thank you very much. This function is similar to the expected work, but it cannot control the number of returned frames per second. At present, it seems that only some frames can be discarded manually |
1 similar comment
Thank you very much. This function is similar to the expected work, but it cannot control the number of returned frames per second. At present, it seems that only some frames can be discarded manually |
I want to confirm that if you want to accelerate decoding with GPU NVIDIA graphics card, do you have to install ffmpeg and the corresponding decoder dependencies on the host computer? I am here #1767 Only POM related dependencies are seen in, and the modules to be installed by the host machine are not mentioned Can you provide a case of using GPU acceleration in the wiki |
If your stream is based on key frames, it's not possible to decode any other frames independently. However, if your stream has other kinds of frames, it might be possible to decode only some of them. @mihirbala should be able to help you with that, see issue #1832.
You only need to install the correct video driver for your GPU, and it should work out of the box by setting the right codec with setVideoCodecName() before calling start(). We do not need CUDA.
There's a wiki page with the names of the codecs here: https://trac.ffmpeg.org/wiki/HWAccelIntro If you would like to have something with more details, contributions are welcome! |
Duplicate of #1121 |
When using ffmpegframegrabber decoding, I want to get only one frame of data per second.
I want to ask if ffmpegframegrabber provides such parameter settings. I use setframerate, but it does not work
// grabber.setVideoCodecName("vaapi");
System.out.println("grabber start");
grabber.start();
CanvasFrame canvasFrame = new CanvasFrame("opencvtest");
canvasFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
canvasFrame.setAlwaysOnTop(true);
OpenCVFrameConverter.ToMat converter = new OpenCVFrameConverter.ToMat();
// OpenCVFrameConverter.ToIplImage converter = new OpenCVFrameConverter.ToIplImage();
int num = 0 ;
while (true){
System.out.println(System.currentTimeMillis()/1000);
Frame frame = grabber.grabImage();
canvasFrame.showImage(frame);
// Thread.sleep(5000);
}
The text was updated successfully, but these errors were encountered: