2023-07-04 22:42:21 +02:00
2025-08-15 18:13:40 +02:00
2023-05-23 19:41:57 +02:00
2025-08-15 18:13:40 +02:00

msv-webcam-backend

A lightweight FTPS-based backend that automatically watches camera upload folders, converts the latest image from each camera to AVIF format, and stores them in a current/ directory for easy access (e.g., via Nginx).


Features

  • FTPS server for receiving image uploads
  • Automatic detection of the newest image per camera folder
  • Conversion to AVIF format using avifenc
  • Persistent storage of converted images in a shared current/ directory
  • Designed for integration with a frontend or Nginx for live webcam feeds

Getting Started

0) Import project files

Make sure the following files are present in your repository:

docker-compose.yml
Dockerfile
post_upload.sh

1) Configure user credentials

Edit docker-compose.yml and set your FTPS username and password:

environment:
  - BF_FTPS_VSFTPD_USER=username
  - BF_FTPS_VSFTPD_PASS=userpw

2) Make the post-upload script executable

chmod +x post_upload.sh

3) Build the Docker image

docker-compose build

4) Start the service

docker-compose up -d

Directory Structure

├── docker-compose.yml
├── Dockerfile
├── post_upload.sh
└── files/
    ├── msvcam1/      # uploads from camera 1
    ├── msvcam2/      # uploads from camera 2
    └── current/      # latest .avif images (msvcam1.avif, msvcam2.avif, ...)

How It Works

  1. Cameras upload images via FTPS into files/msvcamN/ folders.
  2. post_upload.sh periodically checks for the newest image in each folder.
  3. If the newest image has changed (SHA256 hash comparison), it is converted to .avif format and saved to files/current/ as msvcamN.avif.
  4. The current/ directory can be served directly by a web server (e.g., Nginx) for live display.

Example Nginx Integration

See MSV Webcam Frontend


Requirements

  • Docker
  • Docker Compose
Description
No description provided
Readme BSD-3-Clause 115 KiB
Languages
Shell 86.9%
Dockerfile 13.1%