A Python3 based Tool to help in CCTV related work (Work in Progress!)
CCTV-Companion is a Python-Script that aims to help in both planning, setting up and doing maintenance on your Dahua Technology Equipment.
-
typing "webcam" in the IP-Address field will open the first recording device. (if SMD is checked, Object Detection will run on it)
-
typing "imgsrc=" followed by the path to an image will open the image (if SMD is checked, Object Detection will run on it)
-
Object Detection using a pre-trained tensorflow model. This can be toggled ON/OFF.
-
Outputting Serial No., Model Name and Firmware Version of Device
-
Opening a Live View (RTSP Stream) with the ability to control a PTZ Camera (Up, Down, Left, Right, Zoom In/Out, Focus, Wiper On/Off)
- Ability to select both channel and stream.
- Ability to open a Videowall (opens all available channels on the targeted recorder)
-
Copying a usable RTSP-Link to your Clipboard so it can easily be shared or pasted into other programs like VLC.
-
Opening the Web Interface of specified device
-
Rebooting Device
-
Grabbing a Snapshot and displaying it
-
Saving a Diagnostics File (grabs some of the more important settings and infos on the device and saves them in a .txt)
-
Factory Resetting a device and switching all settings to default value
-
Capacity Calculation (Counting # of cameras using specified codec and calculating expected bandwidth.
-
Recording Time (Calculating estimated recording time based on # of cameras, Bit Rate and specified Hard Drive Space in TeraByte.
-
Sending Bug Reports and Feature Requests
Windows .exe File:
The application works on Windows and Unix/MacOS.
The windows build comes with a dedicated executable. There is no need to download the .py files, just download the .zip archive from the link above.
Download the Github Repository and open the "cctvc.py" file with Python3. If you're not using the Windows .exe file, make sure to install the required libraries.
You can do this easily by utilizing the "requirements.txt" by opening a CMD/Shell and typing "pip install -r requirements.txt" (You must be in the same directory where the file is located)
-OR-
If you've downloaded the Windows executable from the link above, just extract the archive, and run the program by double-clicking on the CCTV Companion Shortcut.
Download the Github Repository and start "cctvc.py" with Python3.
You can do this by opening a Shell, navigating to the directory that contains "main.py" and typing "python3 main.py".
make sure to install the required libraries above! You can do this easily by utilizing the "requirements.txt" by opening a Terminal/Shell and typing "pip install -r requirements.txt" (You must be in the same directory where the file is located)
- Enter the IP-Address of your Dahua device here
- Previously entered device IP's will show up here (they will be preferred over IP's in field 1.)
- Clicking this button will delete the list of available cameras (restart required
- Username to be used when accessing device
- Password to be used when acessing device
- If a Valid IP-Address was entered along with Username and Password, clicking "Check" will display device Information in the Output Box (16.)
- Toggle between viewing the Main Stream or the Sub Stream of your Dahua IP-Camera.
- Ticking the "SMD" Box will enable Object Detection. A list of currently supported objects can be found in the "coco.names" file in the repository.
- This button will open a live RTSP-Stream of your IPC. ( PTZ cameras can be controlled too! ) W,A,S,D - Moving Up,Left,Down,Right Q,E - Zoom Out, Zoom In F - Autofocus N,M - Wiper On/Off
- This will take the IP-Address, Username and Password from Fields 1.,4. and 5. and copy a RTSP Link to your clipboard. You can paste this link wherever you like. (For example, in VLC Media Player or your Web-Browser)
- This will open the Web Interface for logging into your Device if an IP-Address has been entered in Field 1.
- This will Reboot the device.
- This will open your Web-Browser and display a Snapshot of the IPC Camera that was made during the API Call.
- This will instruct the IPC to provide a lot of information about itself. The tool will paste this information into a .txt file and save it in the folder where the tool is located.
Information gathered:
- Device Type
- Hardware Version
- Serial No.
- Machine Name
- System Info (autostart, processor, etc)
- Vendor
- Software Version
- ONVIF Version
- CGI Version (Common Gateway Interface)
- Device Class
- User Info
- This will Factory Reset your device and return ALL settings to their default value.
- Text Output will show in this box.
- Closes the program.
- Will open a small popup window detailing some information as well as showing keyboard controls for PTZ-Cameras.
- More API Functions (Triggering Alarm, Adding/Removing Users, Config Backup, etc.)
- Performance Improvements for Object Detection
- Network Scanning Implementation to check for Dahua Devices in own network
- more to come...
The Program is in a very early prototype state of development, there are countless bugs at this moment