A lightweight GrowCast extension script that captures snapshots from an RTSP camera feed and continuously builds a latest_timelapse.mp4 file.
GrowCast-Timelapse/main.py:
- Connects to an RTSP stream using
ffmpeg - Captures
.webpsnapshots on a schedule - Generates/updates a timelapse video from all snapshots
Key features:
- Supports trigger-by-time (
TIME_1,TIME_2,TIME_3) - Supports interval-based capture (
INTERVALin minutes) - Rebuilds timelapse after every successful snapshot
No screenshots here right now, but if you want to check how it looks, see my instance.
Install:
- Python 3.10+
ffmpegavailable in yourPATHpip
Check versions:
python3 --version
ffmpeg -version
pip3 --version- Clone or download this repository.
- Put the
GrowCast-Timelapsefolder into your GrowCast extension folder. - Create and activate a virtual environment (recommended):
python3 -m venv .venv
source .venv/bin/activate- Install Python dependencies:
pip install -r requirements.txt- Copy the example file:
cp GrowCast-Timelapse/.env.example GrowCast-Timelapse/.env- Edit
GrowCast-Timelapse/.env:
RTSP_STREAM=rtsp://username:password@camera-ip:554/stream
TZ=UTC
TIME_1=08:00
TIME_2=12:00
TIME_3=18:00
INTERVAL=
RETRY_MAX_SECONDS=3600
RETRY_DELAY_SECONDS=60
SNAPSHOT_DIR_OUT=./snapshots
TIMELAPSE_DIR_OUT=./timelapse
TIMELAPSE_LENGTH_SECONDS=10Notes:
- You must set
RTSP_STREAM. - Set
TZto your local IANA timezone, such asEurope/BerlinorAmerica/New_York. - Configure either
TIME_1/2/3and/orINTERVAL. - Time format must be
HH:MM(24-hour).
From the repository root:
cd GrowCast-Timelapse
python3 main.pyThe process stays running and executes scheduled jobs.
Same command, but run it with a process manager so it survives terminal close:
systemd(Linux)launchd(macOS)- Docker or your GrowCast host process manager
Build and start the worker with Docker Compose:
cp GrowCast-Timelapse/.env.example GrowCast-Timelapse/.env
docker compose up -d --buildThe Compose service loads configuration from GrowCast-Timelapse/.env and mounts output folders from the host.
Set TZ in GrowCast-Timelapse/.env so scheduled TIME_1/2/3 values use the intended local time. If TZ is omitted, the container uses its default timezone, which is normally UTC.
Scheduled times only fire while the worker is already running. If you start the container after a configured time has passed, that daily time runs on the next day. Interval captures run after the first full interval has elapsed.
Useful commands:
docker compose logs -f
docker compose run --rm growcast-timelapse python main.py --validate
docker compose run --rm growcast-timelapse python main.py --render
docker compose down.
├── GrowCast-Timelapse/
│ ├── main.py # Scheduler + snapshot + timelapse logic
│ ├── .env.example # Environment template
│ ├── snapshots/ # Captured images
│ └── timelapse/ # Generated latest_timelapse.mp4
├── requirements.txt # Python dependencies
└── README.md
Key runtime config is in GrowCast-Timelapse/.env:
RTSP_STREAM: camera stream URLTIME_1,TIME_2,TIME_3: fixed daily capture timesINTERVAL: capture every N minutesRETRY_MAX_SECONDS: how long to keep retrying after a failed snapshotRETRY_DELAY_SECONDS: delay between retry attemptsSNAPSHOT_DIR_OUT: snapshot output folderTIMELAPSE_DIR_OUT: timelapse output folderTIMELAPSE_LENGTH_SECONDS: target duration used to calculate FPS
- Start the script.
- Confirm startup logs show configuration accepted.
- Wait for scheduled trigger(s).
- Check outputs:
- snapshots in
snapshots/ - video in
timelapse/latest_timelapse.mp4
End-user expectation: each successful capture updates the timelapse.
No HTTP API/backend service is included.
This is a local scheduled worker script that calls ffmpeg via subprocess.
- Install Docker and Docker Compose.
- Create
GrowCast-Timelapse/.envfromGrowCast-Timelapse/.env.example. - Set
RTSP_STREAMand at least one schedule option. - Start the service:
docker compose up -d --buildThe container includes ffmpeg, so the host does not need a separate ffmpeg install for Docker usage.
- Copy
GrowCast-Timelapse/into your GrowCast extensions directory. - Install dependencies on the host machine.
- Configure
.env. - Start
main.pyfrom your extension runtime/host.
This extension does not autostart by default.
You must configure startup manually (for example with your GrowCast host process manager, systemd, launchd, cron + @reboot, or another supervisor).
Common issues:
RTSP_STREAM is required- Set
RTSP_STREAMin.env.
- Set
You must define either TIME_1, TIME_2, TIME_3 or INTERVAL- Add at least one schedule mode.
Invalid time format- Use
HH:MM(e.g.07:30).
- Use
ffmpeg: command not found- Install
ffmpegand ensure it is inPATH.
- Install
- No files being generated
- Verify camera URL, network reachability, and credentials.
Contributions are welcome.
Suggested workflow:
- Create a branch.
- Make focused changes.
- Test with a real or test RTSP stream.
- Open a PR with logs/screenshots when relevant.