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
- Cameras upload images via FTPS into files/msvcamN/folders.
- post_upload.shperiodically checks for the newest image in each folder.
- If the newest image has changed (SHA256 hash comparison), it is converted to .avifformat and saved tofiles/current/asmsvcamN.avif.
- The current/directory can be served directly by a web server (e.g., Nginx) for live display.
Example Nginx Integration
Requirements
- Docker
- Docker Compose
Description
				
					Languages
				
				
								
								
									Shell
								
								86.9%
							
						
							
								
								
									Dockerfile
								
								13.1%