-
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
play video with FFmpeg #1654
Comments
Please try to use this code instead: https://github.com/rladstaetter/javacv-webcam /cc @rladstaetter |
Thank you for your answer And I'm sorry I sent the wrong link above |
Ah, I see, what you're looking for is an equivalent to Ideally, we should add that functionality to FFmpegFrameGrabber. Contributions are welcome! |
Actually, I used Thread.sleep () for movies with 30 frames or less, but it does not work for movies with higher frame rates. |
For higher frame rates and certain codecs you may run into situation when |
@jpsacha |
@YazdanNA I created a "simple" example and added to OpenCV_Cookbook examples here: The example aims at playing video at correct playback speed. Delay is added to for slow frame rates. For fast frame rates, some frames are skipped. A set of stopwatches is used to measure playback speed ( Additional stopwatches are used to continuously measure time taken by the most time consuming operations:
They are used to estimate how many frames we need to skip so the playback time can keep up with the frame timestamps. You can play you own video passing path to the video at the command line. For instance, at SBT command line you could use: sbt:opencv-cookbook> runMain opencv_cookbook.chapter11.DisplayVideoSequence /path/to/my/video.mp4 |
@jpsacha |
@jpsacha Looks good, thanks! It would be great if you could integrate that in FrameGrabber itself, by enhancing what @wangxi761 has already contributed in pull #1659. |
PR #1659 seem to nicely simulate the "-re" option ("-re" assumes that capture and processing can be done faster that frame rate). Only the Javadoc could be more descriptive how to use it and what the limitations are. When you need to skip frames things get a bit more complicated, as my example above illustrates. I am not clear if for fast frame rate a frame skipping can be practically implemented using only |
We could use more docs in general, not just for that. Please feel free to contribute! However, docs also need to be maintained, or they may become inaccurate rather quickly and be less useful than no docs at all...
Sure! Sounds good. |
Hello
When I try to use your sample code (JavaFX videoAndAudio) some videos are slow and others are fast, in some videos the sound is jammed and ...
Can you help me please?
https://github.com/bytedeco/javacv/blob/master/samples/KazemiFacemarkExample.java
The text was updated successfully, but these errors were encountered: