Breakthrough / DVR-Scan

:vhs: Tool for extracting scenes with motion from videos (e.g. security camera or DVR footage). Written in Python, uses OpenCV.
http://www.dvr-scan.com/
Other
362 stars 47 forks source link

Report name of corrupt file and continue #126

Closed 9812ga98sd closed 9 months ago

9812ga98sd commented 1 year ago

It would be a good idea to report the name of the corrupt file it cannot read, then output the name or copy it to a folder and then continue processing.

Right now I have to manually stop and start over 49500 files if it finds a corrupt file.

dvr-scan -i *.mp4 -d output/ -b MOG2_CUDA

Windows 10

"[DVR-Scan] Check that the given file is a valid video clip, and ensure all required dependencies are installed and configured properly. [DVR-Scan] Failed to load input: isOpened() returned False for 2021-09-13_18-14-28.mp4!"

Breakthrough commented 1 year ago

One problem with this is that it may cause a motion event to be detected if the lighting changes significantly. I suppose this is probably acceptable for most use cases though if only a few are corrupt, and can add a warning that the result might not be accurate if a video was skipped.

I'll work on adding a new option for this in the next release.

Breakthrough commented 1 year ago

Sorry I may have misunderstood your use case here. Can you clarify what you mean by stop and start over? The program should abort as soon as this occurs, rather than in the middle of a run. Thanks!

abdullahfarwees commented 11 months ago

@9812ga98sd @Breakthrough It sounds like you're looking to differentiate between files processed by "dvr-scan" and those that aren't. You could generate a report or log containing the list of processed filenames for the user's reference. This way, the user can review the report later to see which files were processed by the software.

Breakthrough commented 9 months ago

This can be disabled at the source level when videos are loaded in the joiner, but in DVR-Scan v1.6 it should report the full path of the corrupt video name and the reason it could not be opened. This check should happen before any processing starts, so you will not need to manually start/stop anything.

The program was intended to concatenate inputs as a contiguous stream, and relies on that for accurate timekeeping. This is why scanning does not continue when a video cannot be opened. If this is undesirable, you can also use a loop in a script to run DVR-Scan on each video individually, rather than running it once on all videos.