
Vibe Coded an app/container to handle Amcrest DVRIP control protocol for pan/tilt for cameras that dont support PTZ over ONVIF to add Pan Tilt controls to frigate.
I bought a bunch of these cheap ass amcrest ASH21-B's from amazon, to use with frigate inside, set them up in the dumb amcrest smart home app, but didnt want to keep going to the app to adjust Pan/Tilt and Frigate didnt seem to support the DVRIP protocol.
So i went to Codex and verified/tested with Claude to create a proxy for the DVRIP controls. It made a native app and published to Unraid or you can host on your own docker via the instructions https://github.com/gaming09/amcrest-ptz-bridge
This is 100% local verified by packet capture.
This is vibe coded, i had a problem that i needed solved, it solved it, I'm sharing it. if you hate vibe coding don't use it, i don't need to know how you hate vibe coding. If you find a problem with it I'm happy to address it.
Here is some AI slop for how it works and why its needed
I wanted to control my Amcrest SmartHome PTZ camera entirely through Frigate instead of using the Amcrest SmartHome app.
Frigate’s PTZ interface uses ONVIF. Some Amcrest cameras provide a working native ONVIF service, but support can vary by model and firmware. Before installing anything, try pointing Frigate directly at the camera’s ONVIF service. The ASH21 is currently listed by Frigate as supporting basic PTZ on port 80:
cameras:
patio_camera:
# Existing ffmpeg/detect configuration remains here.
onvif:
host: CAMERA_IP
port: 80
user: admin
password: CAMERA_PASSWORD
If native ONVIF doesn’t work, I made Amcrest PTZ Bridge, which is now available through Unraid Community Applications.
The bridge:
- receives ONVIF PTZ commands from Frigate;
- translates them into local Amcrest/Dahua DVRIP commands;
- handles pan, tilt and stop;
- includes a fail-safe movement timer;
- leaves video/audio streaming directly between the camera and Frigate;
- has no telemetry or cloud integration;
- supports a protected password file instead of a Docker password variable.
After installing it, Frigate points to the Unraid server (or docker IP) instead of directly to the camera:
cameras:
patio_camera:
onvif:
host: UNRAID_SERVER_IP
port: 18880
user: ""
password: ""
Use one bridge instance and a unique port for each camera.
GitHub: https://github.com/gaming09/amcrest-ptz-bridge
In Unraid Apps, search for Amcrest PTZ Bridge.
For the PWNTOOLS usage is as follows
Pwntools is used indirectly by the pinned DahuaConsole dependency—not for pentesting anyone.
DahuaConsole uses it for:
- Opening the TCP connection to the camera with
remote(...) - Sending and receiving DVRIP packets
- Packing binary protocol fields with helpers such as
p32() - Handling socket timeouts and connection errors
the bridge.py only calls DahuaFunctions; it does not directly use pwntools. The camera credentials are passed through that local DVRIP connection to the configured camera on port 37777.
Pwntools normally has an optional version check, which is why we added pwn.conf to disable it. Removing pwntools entirely would require replacing or modifying DahuaConsole’s networking layer and could break camera communication.