Skip to content

johanthoren/viofo-sync

Repository files navigation

viofo-sync

Automatic dashcam footage sync for VIOFO cameras (tested with A329S).

Polls for your dashcam on the network at a configurable interval (default: 5 minutes). When reachable, downloads new footage to a local or external drive and prunes old recordings when storage runs low.

Works on macOS, Linux, and WSL.

Features

  • Syncs footage when camera is detected on network
  • Preserves RO (locked/protected) recordings during pruning
  • Alerts when no new footage for configurable days (camera may be disconnected)
  • Lock file prevents concurrent syncs
  • Status command shows sync state at a glance

Installation

git clone https://github.com/johanthoren/viofo-sync.git
cd viofo-sync
make install

The installer will prompt for your camera IP, storage paths, and set up automatic scheduling (launchd on macOS, systemd on Linux).

To uninstall:

make uninstall

Finding Your Camera's IP

  • Check your router's DHCP leases, or
  • Connect to camera WiFi and check gateway, or
  • Look in camera network settings

Manual Setup

If you prefer manual installation:

  1. Copy script to ~/.local/bin/viofo-sync
  2. Copy viofo-sync.conf.example to ~/.config/viofo-sync.conf and edit
  3. Set up scheduler: see com.example.viofo-sync.plist (macOS) or viofo-sync.service/viofo-sync.timer (Linux)

Usage

# Manual sync
viofo-sync

# Check status
viofo-sync --status

Configuration

Config file location: ~/.config/viofo-sync.conf

Setting Description
CAM_IP Dashcam IP address on your network
VOLUME Mount point of external drive (or any directory on Linux)
DEST_DIR Directory for footage storage
MIN_FREE_GB Start pruning below this free space
TARGET_FREE_GB Stop pruning at this free space
STALE_DAYS Alert after this many days without new footage

How It Works

  1. Checks if storage directory exists
  2. Checks if camera is reachable on network
  3. Crawls camera's HTTP directory listing
  4. Downloads new MP4 files (skips existing)
  5. Prunes oldest non-RO files if storage is low
  6. Alerts if no recent footage (camera may be disconnected)

Requirements

  • macOS: Uses launchd for scheduling, osascript for notifications
  • Linux/WSL: Uses systemd for scheduling, notify-send for notifications (optional)
  • VIOFO dashcam with WiFi
  • External storage for footage
  • curl for HTTP requests
  • python3 (for path validation on macOS)

Testing Status

This script has limited real-world testing:

  • Camera: Only tested with VIOFO A329S. Other VIOFO models may work if they use the same HTTP directory listing format.
  • macOS: Primary development and daily use on macOS 26 (Tahoe).
  • Linux: Basic functionality verified in container. No long-term use.
  • WSL: Untested but should work (uses same code paths as Linux).

Contributions and bug reports from users with other setups are welcome.

Disclaimer

This project is not affiliated with, endorsed by, or connected to VIOFO in any way. VIOFO is a trademark of its respective owner.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors