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 mp4 being processed when ffmpeg errors occur. #101

Closed millerthegorilla closed 8 months ago

millerthegorilla commented 1 year ago

Description of Problem & Solution when processing many files over a long period of time, I returned and the following error was reported multiple times...

[hevc @ 0x7f40600f0f40] Invalid NAL unit size (0 > 4275).
[hevc @ 0x7f40600f0f40] Error splitting the input into NAL units.

Apparently this is an issue with ffmpeg, but it would be nice to know what mp4 was being processed when the error occurred, if that is possible.

Media Examples: just a terminal error reported to stdout

[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4717).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4650).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4574).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4567).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4582).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4585).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4327).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4317).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4295).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4327).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4250).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4275).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4310).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4347).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4305).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4312).
[hevc @ 0x7f4007b5c080] Error splitting the input into NAL units.
[hevc @ 0x7f4007b5c080] Invalid NAL unit size (0 > 4319).
....

Proposed Implementation: It would be nice if the mp4 that caused the error could be reported in the terminal output of dvr-scan.

Alternative Solutions: none...

dvr-scan -v 1.5.1

Breakthrough commented 1 year ago

HI @millerthegorilla;

This is a great idea. For brevity I'd like to only include this for debug output (e.g. setting --verbosity debug), but this is certainly possible.

Right now this is only done when writing motion events using ffmpeg, but agreed there should be a debug log somewhere every time a video is opened for analysis. I'll move the log statements where a video is "appended" to when it's actually opened for use (videos are opened twice currently during a scan run when using append mode).

millerthegorilla commented 1 year ago

Just fyi, I managed to repeatedly get the following error as well, which I think may not be an ffmpeg error(?) but it would be good to know the filename where it happened.

[hevc @ 0x7f406000ab80] Could not find ref with POC 41
Breakthrough commented 8 months ago

This should now show up properly when v1.6 is released and you use debug logging. Each time a new video is loaded, a log message will be shown before any frames are decoded from that video.