Skip to main content

Amcrest Camera Recording Downloader

A Python utility to download and merge video recordings from Amcrest IP cameras using the HTTP API.

Demo

Features

  • Search for recordings by date/time range
  • Concurrent downloads (default: 4 simultaneous)
  • Automatic video merging using ffmpeg with stream copy and AAC fallback for PCM audio
  • Support for multiple output formats (mp4, mkv, avi, mov, ts)
  • Timezone-aware datetime input
  • Automatic retry on failed downloads
  • Environment variable configuration support
  • Dry-run / listing mode (--list-only)

Installation

pipx install amcrest-downloader
# or
uv tool install amcrest-downloader

Requires FFmpeg installed and available in PATH.

Usage

amcrest-downloader --host CAMERA_HOST --username USERNAME --start START_TIME --end END_TIME

Alternatively, invoke as a module:

python -m amcrest_downloader --host CAMERA_HOST --username USERNAME --start START_TIME --end END_TIME

Environment Variables

The CLI reads configuration from environment variables if flags are omitted:

  • AMCREST_HOST: Camera IP address or hostname
  • AMCREST_PORT: Camera HTTP/HTTPS port
  • AMCREST_USERNAME: Camera username
  • AMCREST_PASSWORD: Camera password
  • AMCREST_CHANNEL: Camera channel index (default: 0)

Required Arguments

  • --host: Camera IP address or hostname (e.g., 192.168.1.100 or [::1], or env AMCREST_HOST)
  • -u, --username, --user: Camera username (or env AMCREST_USERNAME)
  • --start: Start time in ISO 8601 format (e.g., 2026-01-16T20:00:00 or 2026-01-16T20:00:00-08:00)
  • --end: End time in ISO 8601 format (e.g., 2026-01-16T22:00:00 or 2026-01-16T22:00:00-08:00)

Optional Arguments

  • -p, --password: Camera password (or env AMCREST_PASSWORD; prompts securely if omitted)
  • --port: Camera port (default: 80, or 443 if --ssl)
  • --ssl: Connect using HTTPS protocol
  • --no-verify-ssl: Disable SSL/TLS certificate verification
  • --channel: Camera channel index, 0-based (default: 0, or env AMCREST_CHANNEL)
  • --output-format: Output video format (mp4, mkv, avi, mov, ts, default: mp4)
  • --output-dir: Output directory (default: current working directory)
  • --output-file: Custom output filename (resolved relative to --output-dir if relative)
  • --keep-files: Keep individual downloaded segment files after merge
  • --max-concurrent: Maximum concurrent downloads (default: 4)
  • --list-only: List matching recordings in a table without downloading or merging
  • --log-level: Logging level (debug, info, warning, error, critical, default: warning)
  • --log-file: Optional file path to write log output
  • --version: Print the version and exit

Timezones

  • Naive --start/--end values are used as the camera's local time.
  • Aware values are converted to camera local time using the camera's current UTC offset, read from its clock and rounded to 15 minutes. If DST changed between the recording and now, the window shifts by an hour.

Examples

Basic usage:

amcrest-downloader \
  --host 192.168.1.100 \
  --username admin \
  --start "2026-01-16T08:00:00" \
  --end "2026-01-16T18:00:00"

With timezone and HTTPS:

amcrest-downloader \
  --host kitchen.cameras.home.com \
  --username admin \
  --ssl \
  --start "2026-01-16T08:00:00-08:00" \
  --end "2026-01-16T18:00:00-08:00"

Custom output and settings:

amcrest-downloader \
  --host 192.168.1.100 \
  --username admin \
  --start "2026-01-16T20:00:00" \
  --end "2026-01-16T22:00:00" \
  --output-format mkv \
  --output-file my_recording.mkv \
  --max-concurrent 8 \
  --keep-files

List recordings only:

amcrest-downloader \
  --host 192.168.1.100 \
  --username admin \
  --start "2026-01-16T08:00:00" \
  --end "2026-01-16T10:00:00" \
  --list-only

Notes

  • Password is prompted securely when not provided via --password or AMCREST_PASSWORD.
  • Individual recordings are downloaded to a temporary directory (.amcrest_download).
  • Videos are concatenated in chronological order.
  • If only some segments download, the merged file is still produced and the exit code is 1.
  • Amcrest cameras often record audio in G.711 PCM (pcm_alaw/pcm_mulaw). If -c copy fails when targeting MP4, the merger automatically falls back to -c:a aac while keeping video lossless.
  • Channel index is 0-based: 0 corresponds to the primary/only sensor on standalone cameras, and the first channel on multi-channel NVRs.
  • Gaps in recording coverage will appear as time jumps in the merged video.
  • Only video files (.mp4, .dav, .mkv, .avi, .asf, .264) are downloaded; snapshots (.jpg) are skipped.
  • API endpoints used:
    • /cgi-bin/mediaFileFind.cgi - Search for recordings
    • /cgi-bin/RPC_Loadfile/ - Download video files

Development

See CONTRIBUTING.md.

Metadata

Release files for amcrest-downloader 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amcrest-downloader 0.3.0
File Size Uploaded
amcrest_downloader-0.3.0.tar.gz 28.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amcrest-downloader 0.3.0
File Interpreter ABI Platform
amcrest_downloader-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.0 kB

Release files / amcrest_downloader-0.3.0.tar.gz

Download URL amcrest_downloader-0.3.0.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
11d5e5cc697bb89700c54a3aa1bcfbec33d556717ea7d2cff70a0a68888cfc25
BLAKE2b-256 checksum
How to use checksums
eff8528a53617a5c6228bfd182c28f7e07770e4f253ac5741d53c66814c4460b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / amcrest_downloader-0.3.0-py3-none-any.whl

Download URL amcrest_downloader-0.3.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
800891916d0d12c4c7738a1e22bd2163b31e5c7b249ba8d8d08879e8b33beb8d
BLAKE2b-256 checksum
How to use checksums
d48d23c7d919ea6fabd6f8c835d929debf1086bd23e1b77956e2e0a176a24743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page