-
Notifications
You must be signed in to change notification settings - Fork 52
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
Three problems with 'frame-skip' parameter #70
Comments
Regarding the exported videos appearing sped up, this is a limitation of the current implementation, and will be alleviated in v2.0 when #61 is fixed, as that will change how events are exported. For the next release I can look into scaling the framerate down in the meantime to help with this. In v2.0, videos will be split by using For the first two points though indeed those will need to be fixed, thanks for the report. Note that I may need to break this item down into separate issues for tracking purposes. |
That makes sense. Thank you! |
As discussed, have adjusted framerate so videos have correct playback speed when using Will be included in DVR-Scan v1.4, thanks for the report! |
I can confirm that With |
One thing I've realized since then is that the ffmpeg solution doesn't work if people want to use bounding boxes or timecodes, so I need to actually rethink how that works. That being said, I was worried about addressing that for now due to the complexity of adding it in, but it is certainly possible - I'll file an issue to track that work so it doesn't get lost. Many thanks again for your feedback on the project. |
Reopening due to issue identified in #68 where the calculated start times still do not account for |
Added tests in 0dab20b to validate pre-event and post-event shifts when using various values of frame skip. Note that as a natural consequence of frame skipping, it's still possible for the resulting start/end times to be off by the number of skipped frames (e.g. if frame skip is 2, the start time may differ by up to 2 frames from it's true position when frame skip is 0; same for the end time). This can be fixed for the end times when #82 is resolved, but there is no easy fix for the start time shift. One solution that comes to mind would be to seek backwards and restart the background subtractor, but this may lead to erroneous results or other false positives, especially if there is not enough frames for the true background to be calculated correctly. In general frame skip should be avoided if frame-accurate results are required, but values of 1-2 shouldn't be that noticeable for most use cases. Fix will be included in v1.5. |
I don’t think that’s a problem at all. If you have an input video with 50 FPS, for example, and use
Agreed. I think it should be obvious to users that you shouldn’t use As an alternative, you can quickly scan source videos with |
For clarity and a bit of a workaround, the issue arose from calculating the new start times. In v1.4, we calculate the buffer size as (roughly):
This value was directly used to shift the starting time codes once |
While the docs somewhat discourage from its use, the
--frame-skip
parameter is a great way to speed up processing significantly – by as much as expected, i.e. in some cases 2× or 3×.But I think there are three bugs/problems with the implementation of the parameter:
--min-event-length
is not adjusted if you start using--frame-skip
:--min-event-length
, i.e. reduce the value, for similar results with--frame-skip 1
.--min-event-length
, i.e. reduce the value, for similar results with--frame-skip 2
.--time-post-event
to the event duration for--frame-skip 1
, and yet another for--frame-skip 2
.--frame-skip 1
and 1/3 of the frames for--frame-skip 2
, but they still run at the original frame rate (e.g. 30 FPS), thus the exported clip appears sped up. But the total duration of the exported clips is still always the same, i.e. more (non-motion) time after the event is included to compensate.The text was updated successfully, but these errors were encountered: