Git Product home page Git Product logo

dvr-scan's People

Contributors

breakthrough avatar dependabot[bot] avatar felixscheffer avatar fitblip avatar klucsik avatar skempin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dvr-scan's Issues

Processed 0 frames

Hay, i have problem, i need analyze low resolution video, but dvr scan didnt work. Can anyone help me. In video file are movements, i think is problem with resolution. I try setup --kernel size, kernel size alway is fail :-(

This is from command line: [DVR-Scan] Initializing scan context...
[DVR-Scan] Opened video skuska2.avi (640 x 480 at 25.016 FPS).
[DVR-Scan] Appended video skuska2.avi.
[DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed: 0 frames [00:00, ? frames/s]
[DVR-Scan] Processed 0 frames read in 0.1 secs (avg 0.0 FPS).
[DVR-Scan] No motion events detected in input.

EDIT: i check codec of my file is MJPEG (MJPG) i mean this is the problem. I recode video with VLC to another format and it works but my file is 1,5 GB big (30minutes) with good quality images and details, after recoding to another format quality goes down, its possible to "learn" DVR SCAN to can read my video files? Thank you very much.

Thank all.

Investigate performing encoding in a separate thread

Investigate using threading or multiprocessing to split different parts of the processing pipeline up to make better use of multiple CPU cores. In general, video decoding followed by encoding take up the most processing time in the pipeline overall. Encoding is more CPU intensive, but typically there are less frames to encode than the input video contains, thus it consumes less overall CPU time when processing a given input video.

Windows binary location

I have been using the binary executable of DVR-scan for a few months, and after moving to a new PC I'm trying to get the binary again.

When downloading any of the sources I cannot find it and I'm sure it should be somewhere, but I cannot locate it.

The binary gives me enough options and I'm really glad to use it. For now I'll use the old binary, but when following the documentation doesn't lead me to it.

OpenCV won't build properly when using Debian's old pip

When running on a Debian-based LXC container, dvr-scan fails:

$ dvr-scan -i record_2021-08-05-14.47.32.mp4
[DVR-Scan] Initializing scan context...
[DVR-Scan] Error: Couldn't load video record_2021-08-05-14.47.32.mp4.
[DVR-Scan] Check that the given file is a valid video clip, and ensure all required software dependencies are installed and configured properly.
[DVR-Scan] Failed to load input, see above output for details.

However running the same command on another machine works:

~/src/env-dvr-scan/bin/dvr-scan -i record_2021-08-05-14.47.32.mp4
[DVR-Scan] Initializing scan context...
[DVR-Scan] Opened video record_2021-08-05-14.47.32.mp4 (1280 x 720 at 14.930 FPS).
[DVR-Scan] Appended video record_2021-08-05-14.47.32.mp4.
[DVR-Scan] Processed:   0%|                                                                                    | 0/1188 [00:00<?, ? frames/s][DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed:  83%|█████████████████████████████████████████████████████████████▏            | 983/1188 [00:28<00:04, 42.47 frames/s]

The dependencies seem to be installed properly:

root@recordcameras:~# pip3 install dvr-scan opencv-python
Collecting dvr-scan
  Downloading https://files.pythonhosted.org/packages/48/b3/77940e1da1f82bdee1d0e9cdc08058a9646440c49b1d7ad9c24c95890a3f/dvr_scan-1.3-py2.py3-none-any.whl
Collecting opencv-python
  Downloading https://files.pythonhosted.org/packages/01/9b/be08992293fb21faf35ab98e06924d7407fcfca89d89c5de65442631556a/opencv-python-4.5.3.56.tar.gz (89.2MB)
    100% |████████████████████████████████| 89.2MB 8.1kB/s 
  Installing build dependencies ... done
Collecting tqdm (from dvr-scan)
  Downloading https://files.pythonhosted.org/packages/0b/e8/d6f4db0886dbba2fc87b5314f2d5127acdc782e4b51e6f86972a2e45ffd6/tqdm-4.62.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 2.0MB/s 
Collecting numpy (from dvr-scan)
  Downloading https://files.pythonhosted.org/packages/b8/46/3f1a1a1f5fa3c0325a407a98396b8ac90e4eaa058420668b4b640729c784/numpy-1.21.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (14.1MB)
    100% |████████████████████████████████| 14.1MB 48kB/s 
Building wheels for collected packages: opencv-python
  Running setup.py bdist_wheel for opencv-python ... done
  Stored in directory: /root/.cache/pip/wheels/5e/f7/5c/55741ad3642e2e72934b934476ce67460097b494c207210e1c
Successfully built opencv-python
Installing collected packages: tqdm, numpy, dvr-scan, opencv-python
Successfully installed dvr-scan-1.3 numpy-1.21.1 opencv-python-4.5.3.56 tqdm-4.62.0
# pip3 install dvr-scan
Requirement already satisfied: dvr-scan in /usr/local/lib/python3.7/dist-packages (1.3)
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from dvr-scan) (1.21.1)
Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from dvr-scan) (4.62.0)
# pip3 install opencv-python
Requirement already satisfied: opencv-python in /usr/local/lib/python3.7/dist-packages (4.5.3.56)
Requirement already satisfied: numpy>=1.14.5 in /usr/local/lib/python3.7/dist-packages (from opencv-python) (1.21.1)
# dvr-scan
usage: dvr-scan [-h] [-v] -i VIDEO_FILE [-o OUTPUT_VIDEO.avi] [-b TYPE] [-so]
                [-c FOURCC] [-t value] [-k N] [-l T] [-tp T] [-tb T] [-q]
                [-st time] [-dt time] [-et time] [-df factor] [-fs num_frames]
                [-tc] [-roi [x0 y0 w h [x0 y0 w h ...]]]
dvr-scan: error: the following arguments are required: -i/--input

The differences in environments are:

  • CPU: AMD (fail) vs Intel (works)
  • Virtual-env: not used (fails)) vs used (works)
  • Containers: LXC used (fails) vs not sued (works)

I tried using strace to see if I could see any missing libraries, but I got too lost.

Cannot find video source.

Hello,

I am using windows 10 home.

I have OpenCV on my system; the location of it is this PC/windows (c:).

However, every time I try to scan for any of my videos, it comes up with cannot find video source, which includes my AVI, MP4 and WMV files.

Non rectangular region of interest

Would there be a way to have a non rectangular (polygon) region of interest like in ZoneAlarm?

In my specific case there are trees that blow in the wind that trigger detection, but the position of the camera does not allow easy removal from the ROI using a rectangle.

multi-cpu support?

I'm curious if drv-scan can be run to utilize all CPU's available or if it already does?

Motion Detection Problem found in DVR-Scan

Dear all,
I use two video stream (H.264) format to do the motion detection using DVR-scan but I meet the problem as shown below:

One of the Execute Commands:
e.g. dvr-scan -i C:\motionDetection\P180309_134916_135923.avi -o C:\motionDetection\P180309_134916_135923_video_motion_only.avi

Problems:

  1. non-existing PPS 0 referenced
  2. decode_slice_header error
  3. missing picture in access unit with size n = 8, 10 or 20

I am worried about the above problems can affect the motion detection accuracy although it can output all motion events in a single video with less false alarm using DVR-scan default setting

Could you tell me the operation is normal or abnormal. Please help me. Thanks a lot for your help!

-q/--quiet mode does not work correctly

dvr-scan -i "F:\Media\Videos\12-04-06;06.mp4" --quiet -st 00:00:00.005 -l 15 -tb 1 -tp 0.001s -t .40 -so

does not produce the expected outcome. I was expecting only the list of events but the full output is produced.

Was expecting only this !

00:00:29.200,00:00:31.300,00:00:42.300,00:00:42.700,00:00:54.000,00:00:54.300,00:01:20.500,00:01:20.800,00:01:35.000,00:01:35.300,00:01:51.200,00:01:51.400,00:02:03.700,00:02:06.600,00:02:12.600,00:02:13.100,00:02:19.400,00:02:20.100,00:02:26.500,00:02:27.500,00:02:33.800,00:02:35.900,00:02:55.200,00:02:55.600,00:03:35.000,00:03:36.200,00:03:55.100,00:03:55.600,00:04:15.300,00:04:15.800,00:04:42.500,00:04:43.400,00:04:49.800,00:04:50.200,00:04:57.000,00:04:57.900,00:05:04.100,00:05:10.300

NOT

[DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed 3122 / 3122 frames read in 2.4 secs (avg 1303.6 FPS).
[DVR-Scan] Detected 19 motion events in input.
[DVR-Scan] Scan-only mode specified, list of motion events:

| Event # | Start Time | Duration | End Time |

| Event 1 | 00:00:29.2 | 00:00:02.1 | 00:00:31.3 |
| Event 2 | 00:00:42.3 | 00:00:00.4 | 00:00:42.7 |
| Event 3 | 00:00:54.0 | 00:00:00.3 | 00:00:54.3 |
| Event 4 | 00:01:20.5 | 00:00:00.3 | 00:01:20.8 |
| Event 5 | 00:01:35.0 | 00:00:00.3 | 00:01:35.3 |
| Event 6 | 00:01:51.2 | 00:00:00.2 | 00:01:51.4 |
| Event 7 | 00:02:03.7 | 00:00:02.9 | 00:02:06.6 |
| Event 8 | 00:02:12.6 | 00:00:00.5 | 00:02:13.1 |
| Event 9 | 00:02:19.4 | 00:00:00.7 | 00:02:20.1 |
| Event 10 | 00:02:26.5 | 00:00:01.0 | 00:02:27.5 |
| Event 11 | 00:02:33.8 | 00:00:02.1 | 00:02:35.9 |
| Event 12 | 00:02:55.2 | 00:00:00.4 | 00:02:55.6 |
| Event 13 | 00:03:35.0 | 00:00:01.2 | 00:03:36.2 |
| Event 14 | 00:03:55.1 | 00:00:00.5 | 00:03:55.6 |
| Event 15 | 00:04:15.3 | 00:00:00.5 | 00:04:15.8 |
| Event 16 | 00:04:42.5 | 00:00:00.9 | 00:04:43.4 |
| Event 17 | 00:04:49.8 | 00:00:00.4 | 00:04:50.2 |
| Event 18 | 00:04:57.0 | 00:00:00.9 | 00:04:57.9 |
| Event 19 | 00:05:04.1 | 00:00:06.2 | 00:05:10.3 |

[DVR-Scan] Comma-separated timecode values:
00:00:29.200,00:00:31.300,00:00:42.300,00:00:42.700,00:00:54.000,00:00:54.300,00:01:20.500,00:01:20.800,00:01:35.000,00:01:35.300,00:01:51.200,00:01:51.400,00:02:03.700,00:02:06.600,00:02:12.600,00:02:13.100,00:02:19.400,00:02:20.100,00:02:26.500,00:02:27.500,00:02:33.800,00:02:35.900,00:02:55.200,00:02:55.600,00:03:35.000,00:03:36.200,00:03:55.100,00:03:55.600,00:04:15.300,00:04:15.800,00:04:42.500,00:04:43.400,00:04:49.800,00:04:50.200,00:04:57.000,00:04:57.900,00:05:04.100,00:05:10.300

Motion file has bigger size than original

My source file for an IP camera footage is a H264 - MPEG-4 AVC (part 10) (h264) and when converting with dvr-scan -c H264 to produce a motion based output, this output is 3x bigger in those situations where there is plenty of movement in the footage. I can't fully understand why this is the case.

  • Is there a way to do a simple stripping of the file without re-encoding the file?
  • When we add X seconds at the beginning and end of each clip, if these buffers coincide (the end of one with the beginning of the other), are they duplicated?

output file of video with 0 events is still written

Basically I have a script that iterates through a few thousand files and outputs motion-only files separately.
The problem is that some of the clips have no events of interest to me, but they still write an 11kb output file.

I feel that if there are zero events, then the output file should be erased (as I know the file is created as soon as the command is run, and then written to at the end)

My current workaround is sorting by file size and deleting everything under 100kb, but it's just an odd quirk.

Also I just noticed the output says "Scan-only mode specified, list of motion events:" even if I have an output file specified, so maybe remove that first half if there's an output specified.

Problem installing from master on Debian 10.4 amd64

Hi,

I took these steps:
apt-get update
apt-get install -y python3 python3-numpy python3-opencv python3-setuptools python3-tqdm
git clone "https://github.com/Breakthrough/DVR-Scan.git" "/root/install/dvr-scan"
echo "$(cd "/root/install/dvr-scan/"; python3 "setup.py" install)"

zip_safe flag not set; analyzing archive contents...
running install
running bdist_egg
running egg_info
creating DVR_Scan.egg-info
writing DVR_Scan.egg-info/PKG-INFO
writing dependency_links to DVR_Scan.egg-info/dependency_links.txt
writing entry points to DVR_Scan.egg-info/entry_points.txt
writing requirements to DVR_Scan.egg-info/requires.txt
writing top-level names to DVR_Scan.egg-info/top_level.txt
writing manifest file 'DVR_Scan.egg-info/SOURCES.txt'
reading manifest file 'DVR_Scan.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'DVR_Scan.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/dvr_scan
copying dvr_scan/cli.py -> build/lib/dvr_scan
copying dvr_scan/platform.py -> build/lib/dvr_scan
copying dvr_scan/__init__.py -> build/lib/dvr_scan
copying dvr_scan/__main__.py -> build/lib/dvr_scan
copying dvr_scan/timecode.py -> build/lib/dvr_scan
copying dvr_scan/scanner.py -> build/lib/dvr_scan
copying dvr_scan/../LICENSE -> build/lib/dvr_scan/..
copying dvr_scan/../LICENSE-OPENCV -> build/lib/dvr_scan/..
copying dvr_scan/../LICENSE-NUMPY -> build/lib/dvr_scan/..
copying dvr_scan/../package-info.rst -> build/lib/dvr_scan/..
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
copying build/lib/LICENSE -> build/bdist.linux-x86_64/egg
copying build/lib/package-info.rst -> build/bdist.linux-x86_64/egg
copying build/lib/LICENSE-OPENCV -> build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/cli.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/platform.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/__init__.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/__main__.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/timecode.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/scanner.py -> build/bdist.linux-x86_64/egg/dvr_scan
copying build/lib/LICENSE-NUMPY -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/cli.py to cli.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/platform.py to platform.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/__main__.py to __main__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/timecode.py to timecode.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/dvr_scan/scanner.py to scanner.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating dist
creating 'dist/DVR_Scan-1.0.1-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing DVR_Scan-1.0.1-py3.7.egg
Removing /usr/local/lib/python3.7/dist-packages/DVR_Scan-1.0.1-py3.7.egg
Copying DVR_Scan-1.0.1-py3.7.egg to /usr/local/lib/python3.7/dist-packages
DVR-Scan 1.0.1 is already the active version in easy-install.pth
Installing dvr-scan script to /usr/local/bin

Installed /usr/local/lib/python3.7/dist-packages/DVR_Scan-1.0.1-py3.7.egg
Processing dependencies for DVR-Scan==1.0.1
Searching for numpy==1.16.2
Best match: numpy 1.16.2
Adding numpy 1.16.2 to easy-install.pth file
Installing f2py script to /usr/local/bin
Installing f2py3 script to /usr/local/bin
Installing f2py3.7 script to /usr/local/bin

python3 /usr/local/bin/dvr-scan --version

Traceback (most recent call last):
  File "/usr/local/bin/dvr-scan", line 11, in <module>
    load_entry_point('DVR-Scan==1.0.1', 'console_scripts', 'dvr-scan')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/local/lib/python3.7/dist-packages/DVR_Scan-1.0.1-py3.7.egg/dvr_scan/__init__.py", line 32, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/local/lib/python3.7/dist-packages/DVR_Scan-1.0.1-py3.7.egg/dvr_scan/scanner.py", line 36, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/local/lib/python3.7/dist-packages/DVR_Scan-1.0.1-py3.7.egg/dvr_scan/platform.py", line 33, in <module>
    #    <see CVS and SVN checkin messages for history>
AttributeError: module 'cv2' has no attribute 'cv'

How can I fix the error?

Analyzing multiple videos with multiple output videos

Hallo,

i have question - is posible in DVR SCAN make command to analyze multiple videos and then every analyzed video will have outputs in separated video?

In folder have i videos: from 001 to 040.avi ... and standard is one output 001-040output.avi, I want to make command wich give me 40 outpus videos...

Thank you and sorry for misstakes, my Ennglish is verry bad.

Create Report From Scanning Multiple Files

This is a feature request, not a bug. The surveillance NVR records many files to a single folder for each day. I would like the ability to process all files in a single folder and receive a report at the end of which files had motion in them. It would also be ideal for DVR-Scan to have a delete option to delete any files without motion, or to somehow mark them (maybe rename) so that they can easily be deleted.

Revisit redistribution of Windows binaries

PyInstaller seems to be working, will look into seeing if I can come up with an automated way to do this for future releases. Will also look into creating an installer using WiX to increase availability. Will likely only support x64 (no 32-bit).

Wont scan - bails with AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'

As per title - any attempt to scan a video file results in:

AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'

Tried on known good mp4 & avi files from different CCTV devices.

OS: Ubuntu 16.04.6 LTS
Python 2.7.12

DUMP
dvr-scan -i /home/sysops/Videos/test.avi
[DVR-Scan] Initializing scan context...
Traceback (most recent call last):
File "/usr/local/bin/dvr-scan", line 9, in
load_entry_point('DVR-Scan==1.0.1', 'console_scripts', 'dvr-scan')()
File "build/bdist.linux-x86_64/egg/dvr_scan/init.py", line 63, in main
File "build/bdist.linux-x86_64/egg/dvr_scan/scanner.py", line 78, in init
AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'

Tried a fix shown in thread:

sudo apt-get remove python-opencv
sudo pip install opencv-python

No dice.

any help/pointers?

Update setup.py To Require Official OpenCV Package

setup.py should be updated to require the latest official OpenCV package from pip, as opposed to requiring the user to install it manually, since this allows the dvr-scan command to fail when the cv2-package is unavailable.

Related to #4.

Scan Zone / Region

Is there a way to scan a specific zone in the video, so that one can focus on specific areas of interest in order to reduce the number of matches such a trees blowing in the wind.

"non-existing PPS 0 referenced"

I'm getting with all my avi videos this messages , in generates de avi with the movements but perhaps not all?
Thanks

[h264 @ 07516040] non-existing PPS 0 referenced
[h264 @ 07516040] decode_slice_header error
[h264 @ 07516040] no frame!

Multiple rectangle of interest

Please allow multiple rectangle of interest support. Example:
dvr-scan -i some_video.mp4 -o some_video_motion_only.avi -roi 50 50 100 100 -roi 200 100 100 150 -roi 100 250 150 50

Performace of analyzing

Hay, first i love you program!

I use your software for analyzing videos from security cameras. (Rsolutions Full HD - 15/25fps, hd 15fps)

I have imac 27 inch (2017) 3,8Ghz intel core i5 with 4 cores. And notebook with similar procesor little bit slower.

When software analyzing HD with 15fps - making, speed of analyzing is 160-170 fps, but when is Full HD analyzed with 15 fps - ist about 65 fps and with 25fps is 35-40fps performance.

Please help me with this, i want better perrformace, wich kind of Processor i need to buy (yes i need whole new pc) but with what kind of processor (AMD Intel) become i better performance. What is important - number of cores, or speed, or cache? I want to buy new PC direct for this software, but i dont know what is important, please help me with wich one choose -

I am biggest noob to programming and to in computer.

Thank you verry much for your answer

not scanning entire video file

I'm wanting to scan very large files (almost 2 gig in size--roughly 8 hours long each) in -so mode. DVR-scan default settings with -so gives me just what I want, but when I run it, it only scans about the first 20% of the file, i.e. the first c. 200,000 frames out of about 864,000 frames. My understanding is that the default -st and -et settings are for the entire file.

I tried using -st and -et to specify a small range beginning at frame 300,000, and it reported 0% and 0 frames scanned.

What am I doing wrong?

Windows Defender detecting Trojan virus

I downloaded the DVR-Scan v1.1 Windows 64-bit Installer, completed installation, then tried running dvr-scan.exe. Windows Defender detected a trojan virus, quarantined, and removed the file:

Detected: Trojan:Win32/Zpevdo.B
Status: Quarantined
Details: This program is dangerous and executes commands from an attacker.
Affected Items:
file: C:\Program Files\Brandon Castellano\DVR-Scan\dvr-scan.exe

Trojan

Brightness change detected as motion

Hello , it's a great tool, but is there any way to handle brightness changes (like sun and clouds ) without triggering a motion detection?
Maybe by defining the max size that a changing area/blob can have (like 25% of the full image) ?

Refactor + Cleanup ScanContext

The number of lines in the scan_motion() method of ScanContext is quite high, and lots of development artifacts still exist. Cleanup and reduce max function length by breaking existing method down into smaller parts, to improve reusability + eventual integration with new PySceneDetect API.

AttributeError: 'module' object has no attribute 'VideoWriter_fourcc', and add OpenCV to setup.py

I tried using dvr-scan and received the following error:

$ dvr-scan -i 20170806124722.avi
[DVR-Scan] Initializing scan context...
Traceback (most recent call last):
File "/usr/local/bin/dvr-scan", line 9, in
load_entry_point('DVR-Scan==1.0.1', 'console_scripts', 'dvr-scan')()
File "build/bdist.linux-x86_64/egg/dvr_scan/init.py", line 63, in main
File "build/bdist.linux-x86_64/egg/dvr_scan/scanner.py", line 80, in init
AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'

From what I could tell it seemed to be related to the version of Python. I tried changing /usr/local/bin/dvr-scan from /usr/bin/python to /usr/bin/python3 and received the following error:

$ dvr-scan -i 20170806124722.avi
[DVR-Scan] Initializing scan context...
Traceback (most recent call last):
File "/usr/local/bin/dvr-scan", line 9, in
load_entry_point('DVR-Scan==1.0.1', 'console_scripts', 'dvr-scan')()
File "build/bdist.linux-x86_64/egg/dvr_scan/init.py", line 63, in main
File "build/bdist.linux-x86_64/egg/dvr_scan/scanner.py", line 80, in init
AttributeError: 'module' object has no attribute 'VideoWriter_fourcc'

Detect blobs

Just wondering if there is a way for DVR-Scan to detect "blobs of pixel" or "continuous areas" to prevent false detection due to rain, snow and noise.

If not could this be implemented as enhancement?

High Resolution, unable to mouse select roi

I have video with resolution 2592x1944 and want to select a rectangle of interest using the mouse.
The image presented by DVR-Scan for this is full-scale and much larger than my 1920x1080 physical screen.
I have not figured out a way to move the image around so the portion where I want to click/drag is visible.
If I right-click on the image title bar and choose move, the cursor up-arrow key will move the image up but Windows snaps it back down to keep the title bar visible before I can do anything else.

I realize re-scaling the image to fit the screen will affect precision/accuracy of the click/drag positioning, but I think it would be good enough

Or the image could be presented in a frame with scroll bars perhaps? And maybe with a zoom in/out feature?

Specify the input.

I'm new to python, can someone please give me an example of specify the input "-i" in the syntax.
Thank you

Incorrect start times with variable frame rate (VFR) videos

Hello

I'm using dvr-scan to find motion start times in webcam movies recorded in guvcview. When I looked up the start times in the movie with mplayer, I noticed the actual events and start times don't match up. I did some testing using different movie formats and cam settings. Sometimes, in low light conditions, the camera's frame rate drops. In these movies, dvr-scan seems to get the start times wrong. I also managed to make a couple of movies with constant frame rate (lot of more or less constant light) here the start times are correct.

Is there some work around for this? In my application I can't be sure the light is always constant. Also the frame rate variability seems to happen irrespective of cam settings (absolute exposure, raw formats ...) What I also tried is re-code the movie with ffmpeg using -r 30. Same bad result...

Jos

Change print statements to use logging

Code is currently littered with print statements from initial development. Refactor to use Python's logging module to make headless/quiet mode easier to implement.

Graphical User Interface (GUI)

I built a simple GUI to scan some video's using PyQt5. It has hard coded settings for my use case at the moment. Would you be interested if i expanded on the idea so the GUI allowed for all the command line arguments?

El Capitan Python 2.7.15 DVR-Scan Installation Issue

I'm on a Mac El Capitan 10.11 box. Very much want to use this software, or at least try it out. Looks great. I can't get all this working, and I know nothing about Python.

$ python --version
Python 2.7.15

$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to DVR_Scan.egg-info/requires.txt
writing DVR_Scan.egg-info/PKG-INFO
writing top-level names to DVR_Scan.egg-info/top_level.txt
writing dependency_links to DVR_Scan.egg-info/dependency_links.txt
writing entry points to DVR_Scan.egg-info/entry_points.txt
reading manifest file 'DVR_Scan.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'DVR_Scan.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.11-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.11-x86_64/egg
creating build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/__init__.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/__main__.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/cli.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/platform.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/scanner.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/dvr_scan/timecode.py -> build/bdist.macosx-10.11-x86_64/egg/dvr_scan
copying build/lib/LICENSE -> build/bdist.macosx-10.11-x86_64/egg
copying build/lib/LICENSE-NUMPY -> build/bdist.macosx-10.11-x86_64/egg
copying build/lib/LICENSE-OPENCV -> build/bdist.macosx-10.11-x86_64/egg
copying build/lib/package-info.rst -> build/bdist.macosx-10.11-x86_64/egg
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/__main__.py to __main__.pyc
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/cli.py to cli.pyc
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/platform.py to platform.pyc
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/scanner.py to scanner.pyc
byte-compiling build/bdist.macosx-10.11-x86_64/egg/dvr_scan/timecode.py to timecode.pyc
creating build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/PKG-INFO -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/SOURCES.txt -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/dependency_links.txt -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/entry_points.txt -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/requires.txt -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
copying DVR_Scan.egg-info/top_level.txt -> build/bdist.macosx-10.11-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/DVR_Scan-1.0.1-py2.7.egg' and adding 'build/bdist.macosx-10.11-x86_64/egg' to it
removing 'build/bdist.macosx-10.11-x86_64/egg' (and everything under it)
Processing DVR_Scan-1.0.1-py2.7.egg
Removing /usr/local/lib/python2.7/site-packages/DVR_Scan-1.0.1-py2.7.egg
Copying DVR_Scan-1.0.1-py2.7.egg to /usr/local/lib/python2.7/site-packages
DVR-Scan 1.0.1 is already the active version in easy-install.pth
Installing dvr-scan script to /usr/local/bin

Installed /usr/local/lib/python2.7/site-packages/DVR_Scan-1.0.1-py2.7.egg
Processing dependencies for DVR-Scan==1.0.1
Searching for numpy==1.15.4
Best match: numpy 1.15.4
Processing numpy-1.15.4-py2.7-macosx-10.11-x86_64.egg
numpy 1.15.4 is already the active version in easy-install.pth
Installing f2py script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/numpy-1.15.4-py2.7-macosx-10.11-x86_64.egg
Finished processing dependencies for DVR-Scan==1.0.1

$ dvr-scan --version
Traceback (most recent call last):
  File "/usr/local/bin/dvr-scan", line 11, in <module>
    load_entry_point('DVR-Scan==1.0.1', 'console_scripts', 'dvr-scan')()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.macosx-10.11-x86_64/egg/dvr_scan/__init__.py", line 32, in <module>
  File "build/bdist.macosx-10.11-x86_64/egg/dvr_scan/scanner.py", line 36, in <module>
  File "build/bdist.macosx-10.11-x86_64/egg/dvr_scan/platform.py", line 29, in <module>
    #      Andruk, Just van Rossum, Thomas Heller, Mark R. Levinson, Mark
ImportError: No module named cv2

Yes I'm on an old box. Any chance this could be something simple I could chase?

Failed to load OpenH264 library

I downloaded openh264-1.6.0-win64msvc.dll and put in DVR-Scan folder.

But I still get:

Failed to load OpenH264 library: openh264-1.4.0-win64msvc.dll
Please check environment and/or download library from here: https://gith
ub.com/cisco/openh264/releases

[libopenh264 @ 0000000003d63b00] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error
[libopenh264 @ 00000000051a77c0] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error
[libopenh264 @ 0000000002270760] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error
[libopenh264 @ 00000000043fe420] Incorrect library version loaded
Could not open codec 'libopenh264': Unspecified error

(Presumably) incomplete processing of video

Hello, great software for finding the birds on my birdcam.

However, it seems that the processing of the video files never reaches 70% of total frames.
The input files are .AVI and no matter the output format, this issue persists. I don't know if it is just a visual problem or if the files are not completely processed.

In-/Output below:

$ dvr-scan -i VIDEO.avi -roi 697 400 536 452 -l 30 -o MO_VIDEO.mp4
OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
[DVR-Scan] Initializing scan context...
[DVR-Scan] Opened video VIDEO.avi (1920 x 1080 at 30.000 FPS).
[DVR-Scan] Appended video VIDEO.avi.
[DVR-Scan] ROI selected (x,y,w,h): [697, 400, 536, 452]
[DVR-Scan] Processed:   0%|          | 0/17999 [00:00<?, ? frames/s][DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed:  69%|######8   | 12388/17999 [02:49<01:16, 72.94 frames/s][DVR-Scan] Processed 12388 frames read in 169.8 secs (avg 72.9 FPS).
[DVR-Scan] Detected 1 motion events in input.
[DVR-Scan] Scan-only mode specified, list of motion events:
-------------------------------------------------------------
|   Event #    |  Start Time  |   Duration   |   End Time   |
-------------------------------------------------------------
|  Event    1  |  00:00:07.6  |  00:00:03.2  |  00:00:10.7  |
-------------------------------------------------------------
[DVR-Scan] Comma-separated timecode values:
00:00:07.567,00:00:10.733
[DVR-Scan] Motion events written to disk.
$ dvr-scan -i VIDEO.avi -roi 697 400 536 452 -l 30 -o MO_VIDEO.avi
[DVR-Scan] Initializing scan context...
[DVR-Scan] Opened video VIDEO.avi (1920 x 1080 at 30.000 FPS).
[DVR-Scan] Appended video VIDEO.avi.
[DVR-Scan] ROI selected (x,y,w,h): [697, 400, 536, 452]
[DVR-Scan] Processed:   0%|          | 0/17999 [00:00<?, ? frames/s][DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed:  69%|######8   | 12377/17999 [04:11<01:54, 49.17 frames/s][DVR-Scan] Processed 12377 frames read in 251.7 secs (avg 49.2 FPS).
[DVR-Scan] No motion events detected in input.

highlight objects when detected

Hello, This is not a bug but rather a request for a new feature.

is there a way to highlight the objects when detected?

For example, if a human or animal are detected can you draw a square/rectangle around them and as the object moves the rectangle will move with it too. This can be very useful for motion detection in videos where objects becomes too small because they are far away.
Thanks

Keep same input format in output file

Hi,
I am working with long video files (up to 72 h) for plate recognition, so I use DVR-scan to have shorter videos only with vehicles.
I try to have well compressed videos, such as 720p, 100-200 kbps, 8 fps, H.264 or H.265, so I usually have videos of 1-2 GB per day.
Now I am obtaining let's say 1-2 h video from an input of 24 h, that's ok, but output size is double than the 24 h original.
Is there a way in DVR-scan to keep the same input settings when generating the output file? Or at least choosing some output settings, in order not to re-transcode the whole file with ffmpeg?
Thanks

Downscale factor has no effect

Currently, downscale factor has no effect if set (i.e. is wholly unused). If set, also needs to re-calculate the kernel size appropriately, and ensure ROI selection is not affected (but scales properly).

Discovered while refactoring ScanContext as part of #33.

Incomplete processing of GoPro video with audio track

Hi,

Firstly, thank you for your efforts. Great tool, I've been using it for recording wildlife and it's great as I can use old cameras, and afterwards 'feed them' to DVR-Scan and just wait for the results.

The problem I have is with GoPro videos, I have a Hero5 Black, and have submitted videos with various frame rates/resolutions and it seems to pick up the first few frames and then stop.

Examples:
[DVR-Scan] Opened video GOPR7898.mp4 (1280 x 720 at 29.970 FPS).
[DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed 18 / 18 frames read in 1.3 secs (avg 13.4 FPS).

[DVR-Scan] Opened video GP117906.mp4 (1280 x 720 at 239.760 FPS).
[DVR-Scan] Scanning input video for motion events...
[DVR-Scan] Processed 228 / 228 frames read in 4.6 secs (avg 49.5 FPS).
This second file is linked, 500ish Mb:
https://sharemystuffhere.s3-us-west-2.amazonaws.com/GP117906.MP4

I don't think it's dependency/openCV related as my setup works fine on files from my other camera. But here is the output from pip freeze if it helps:

certifi==2019.11.28
dvr-scan==1.0.1
numpy==1.18.2
opencv-python==4.2.0.32
scipy==1.4.1
wincertstore==0.2

Thanks again, greatly appreciate this software and time spent by developers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.