-
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 only grabs keyframes, skips frames in between #1379
Comments
It sounds like your file has multiple video streams? That's not currently
supported. Check with ffprobe to make sure that's not the case.
|
This is the probe
Looks like there is only one video stream. |
But you're saying the value of |
this.pkt.stream_index = 1 |
Those are audio packets...
|
I can't explain why it is trying to access audio packets when I try to grabImage(). The code is exactly as listed above. Now that I know what's happening, I'm going to dig into it and try to see why/when it's getting the audio stream instead of video. Edit: this happened on more than one video, from two different sources. |
Any updates on that? |
Since you're the only person that is having this issue, I'm assuming that this isn't a problem with JavaCV, but simply something that you're doing incorrectly. If you have some sample source code with some sample data that fails, please share it so that someone can help. Thanks! |
I'm running a basic grab on OSX. It's a Kotlin project, not on Android. Here's the code:
It captures the same frame 6 or 7 times in a row, then repeats. When I debugged the grabber, it seems it only sends back keyframes. All frames had
keyFrame = true
.The line where it may be messing up is 1276:
javacv/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java
Line 1276 in fe48427
When setting the frameNumber, it calls grabFrame(), and the value of
this.pkt.stream_index()
is not the same asthis.video_st.index()
.This means that it enters that condition, and not the next closure where it would have called
this.frame.image = this.image_buf
.Because of this, the
this.frame.image
is null by the time it gets to actually grabbing the frame, i.e. not while incrementing the timestamp. It falls back to returning the most recent keyframe. That's my guess.I've looked through all the other bugs and haven't found anyone having a similar situation.
The text was updated successfully, but these errors were encountered: