e7db/nvr

By e7db

Updated 10 months ago

A docker container to record any IP camera stream to disk.

Image
Databases & Storage
Internet of Things
Networking

1.1K

docker-nvr

A docker container to record any IP camera stream to disk.

Usage

Docker run
docker run -it --rm  --name nvr \
  -v /path/to/local/recordings:/var/recordings \
  -e STREAM_URL="rtsp://username:password@ip:port/path" \
  -e CAMERA_NAME="My Camera" \
  e7db/nvr
Docker Compose
services:
  camera-1:
    image: e7db/nvr
    environment:
      - TZ=America/Chicago
      - STREAM_URL="rtsp://username:password@ip:port/path"
      - CAMERA_NAME="Chicago Office"
    volumes:
      - /path/to/local/recordings:/var/recordings
  camera2:
    image: e7db/nvr
    environment:
      - TZ=America/New_York
      - DAYS=30
      - STREAM_URL="rtsp://username:password@ip:port/path"
      - CAMERA_NAME="New York Warehouse"
      - VIDEO_SEGMENT_TIME=60
      - VIDEO_FORMAT=flv
    volumes:
      - /path/to/local/recordings:/var/recordings
Parameters

Find below a table listing all the different parameters you can use with the container,through the environment variables.

VariableDefaultDescription
TZUTCThe time zone for file names date and time.
STREAM_URLThe URL to your camera feed.
CAMERA_NAMEThe name used to create your camera recordings folder.
DAYS30The days of recording to keep for the camera. An empty value means no limit.
LOGLEVELinfoThe ffmpeg log level.
VIDEO_SEGMENT_TIME300The length in seconds of each recording file.
VIDEO_FORMATmp4The daily videos output format. You can use any ffmpeg supported format. Recommended value: mp4, ts, mkv or flv.

By default, 5 minutes segments of .ts video files will be created. A daily video will be assembled from parts a few minutes after midnight.

Stream URL

To determine the STREAM_URL of your camera, refer to its documentation. You may also find it in its web interface or companion app. You can also try and determine it with the iSpy Camera Connection Database.

Generally, your camera stream URL would take the form of a RSTP URL with authentication: rstp://user:password@ip:port/path

Here is an exemple corresponding to a generic chinese one I have: rstp://user:password@192.168.7.98:554/11

You may also try with different protocols, like RTMP or HTTP.

Docker Pull Command

docker pull e7db/nvr