-
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
Frame index broken with simple grabber+recorder #2311
Comments
You'll need to call stop() and/or close() somewhere to get the index written |
@saudet : Thanks. I provided only the copy loop but there are flush + close in original code. I updated the snippet in the comment. |
Maybe the format you're using expects a timestamp for each frame? |
@saudet : Ok, I included also the initialization in the snippet. It's pretty simple H264. Originally, I also had threads (which didn't work) but no matter what are the settings, the result is always the same. I also tried removing |
You're not giving it any audio frames, that's not going to work |
Oh, I see you are giving it audio frames, but maybe they are too far apart from the video frames. Typical formats can support up to about 1 second delay between them, so you have to make sure that's what they end up like. |
@saudet : It consumes the original video as is, and within the loop - it either amends the image for VIDEO frame or records the frame directly for any other type. So the frame are stored in the same order as in the original video. The original video works without issues. |
Like I said, you might need to set the timestamp, so please try to set it |
@saudet : I did add |
@saudet : Please check the proof-of-concept demo at https://github.com/kvr000/zbynek-javacv-poc/tree/main/javacv-broken-index/ |
I have pretty simple loop which grabs images, draws some stuff and writes directly to recorder. The resulting video has issues with frame index for some reason - some periods are fine but then the player is unable to seek or takes long time to go through the video and then skips long period of minutes of tens of minutes.
I disabled any specific options and just H264 for video and tune=film and video rate.
Here is the loop (Scala) :
When I recode the video with ffmpeg from command line, it works without problems, so the code must be somehow JavaCv specific (or possibly in my code but this looks pretty straightforward).
The text was updated successfully, but these errors were encountered: