Skip to content
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

frames being repeated or dropped #10

Open
hn-88 opened this issue Dec 13, 2023 · 5 comments
Open

frames being repeated or dropped #10

hn-88 opened this issue Dec 13, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@hn-88
Copy link
Owner

hn-88 commented Dec 13, 2023

When encoding a single video input to output, found duration had reduced from 24 minutes to 22, and also some jerkiness in motion. When tried to reproduce by creating a video of frames with ffmpeg, found ffmpeg was also duplicating frames?!
https://gist.github.com/hn-88/95dbd59767dcdff23eab2f2be5880c2f

@hn-88 hn-88 self-assigned this Dec 13, 2023
@hn-88 hn-88 added the bug Something isn't working label Dec 13, 2023
@hn-88
Copy link
Owner Author

hn-88 commented Dec 20, 2023

Possibly this is due to using ffmpeg in the backend, and this issue?
https://superuser.com/questions/1255380/ffmpeg-duplicating-frames

@hn-88
Copy link
Owner Author

hn-88 commented Dec 21, 2023

OCVWarp works without frame repeats, OCVvid2fulldome doesn't, for the same input video.
The difference between OCVWarp and OCVvid2fulldome seems to be that in OCVWarp,

outputVideo.open(NAME, ex, inputVideo.get(CAP_PROP_FPS), Sout, true);

while in OCVvid2fulldome, it is

outputVideo.open(NAME, outputVideo.fourcc(outputfourcc[0], outputfourcc[1], outputfourcc[2], outputfourcc[3]), 
       outputfps, Sout, true);

@hn-88
Copy link
Owner Author

hn-88 commented Dec 21, 2023

As seen with the comments for
https://gist.github.com/hn-88/95dbd59767dcdff23eab2f2be5880c2f
ffmpeg assumes 25fps input as default, and adds duplicate frames if output is 30 fps.

Maybe we can try setting input fps = desired output fps.

@hn-88
Copy link
Owner Author

hn-88 commented Dec 21, 2023

e45311a does not seem to help. So, the only workaround seems to be to ensure all input videos have the same fps as the output fps?

@hn-88
Copy link
Owner Author

hn-88 commented Apr 11, 2024

Found the bug (or at least one bug) - it is not a problem with opencv's fps handling, but instead my handling of the outputfps double from ini file - no strtod() used!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant