Skip to main content

Python wrapper implementation for Amcrest cameras.

Project description

A Python 2.7/3.x module for Amcrest Cameras using the SDK HTTP API. Amcrest and Dahua devices share similar firmwares. Dahua Cameras and NVRs also work with this module.




$ pip install amcrest --upgrade
$ eval "$(register-python-argcomplete amcrest-cli)"

# To enable amcrest-cli autocomplete in the system:
$ echo 'eval "$(register-python-argcomplete amcrest-cli)"' >  /etc/profile.d/


$ git clone
$ ./
$ make rpm
$ dnf/yum install amcrest-cli-NVR.rpm pythonX-amcrest-NVR.rpm


from amcrest import AmcrestCamera
camera = AmcrestCamera('', 80, 'admin', 'password').camera

#Check software information

#Capture snapshot
camera.snapshot(0, "/home/user/Desktop/snapshot00.jpeg")
<requests.packages.urllib3.response.HTTPResponse object at 0x7f84945083c8>

#Capture audio
camera.audio_stream_capture(httptype="singlepart", channel=1, path_file="/home/user/Desktop/audio.aac")
CTRL-C to stop the continuous audio flow or use a timer

#Move camera down
camera.ptz_control_command(action="start", code="Down", arg1=0, arg2=0, arg3=0)

#Record realtime stream into a file
CTRL-C to stop the continuous video flow or use a timer

Command Line

$ man amcrest-cli
$ amcrest-cli --help

# Saving credentials to file.
$ vim ~/.config/amcrest.conf
username: admin
password: 123456
port: 80

username: admin
password: secret
port: 80

$ amcrest-cli --camera living_room --version-http-api

Text User Interface (TUI)

Configure amcrest.conf and trigger amcrest-tui, make sure the user triggering amcrest-tui have access to framebuffer device or use sudo.

NOTE: Execute it from console logins, like /dev/ttyX (Non X Window). Pseudo-terminals like xterm, ssh, screen and others WONT WORK.

$ vim ~/.config/amcrest.conf
username: admin
password: 123456
port: 80

username: admin
password: secret
port: 80

$ amcrest-tui

Supportability Matrix


Model Tested Status Results/Issues
IPM-721 Yes working  
IPM-HX1 Yes working  
IP2M-841 Yes working  
IP2M-842 Yes working  
IP3M-941 Yes working  
IP3M-943 Yes working  
IP3M-956 Yes working  
IP3M-956E Yes working  
IP3M-HX2 Yes working  
IP4M-1026B Yes working  
IP4M-1051B Yes working  
IP5M-1176EB Yes working  
IP8M-2496EB Yes working  
IP8M-T2499EW-28M Yes working  

Network Video Recorders (NVR)

Model Tested Status Results/Issues
XVR DAHUA 5104S Yes working  

If you have different model, feel fee to contribute and report your results.


If you need any help, please join our community on the Gitter channels available at Gitter.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for amcrest, version 1.9.3
Filename, size File type Python version Upload date Hashes
Filename, size amcrest-1.9.3-py3-none-any.whl (151.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size amcrest-1.9.3.tar.gz (919.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page