Overlay karting lap and position info on top of a video using the ffmpeg drawtext pipeline. Use either the CLI or the bundled web UI.
brew install ffmpeg
Node 18+ is recommended.
npm install
npm run web
Then open http://localhost:3000 and walk through the steps:
- Upload video – select one or more MP4s in order (streamed to disk, 4GB+ ok).
- Set offsets – scrub the preview and mark the start frame.
- Lap data – paste laps, pick format/driver (TeamSport), save.
- Preview – auto-generates a single-frame overlay just after your start; tweak text/box colors.
- Transform & download – queue the render, poll status, and download the overlaid MP4.
The web UI always uses the ffmpeg renderer.
- Uploads and rendered/previews saved under
work/are pruned automatically (renders/uploads after ~24h, previews after ~6h). Copy anything you want to keep somewhere else.
npm run lap-timer -- \
--inputVideo "work/video.mp4" \
--inputLapTimes work/times.txt \
--lapFormat daytona \
--startTimestamp 00:12:53.221 \
--outputFile work/out.mp4
--startFramecan be used instead of--startTimestamp(frame index).--lapFormat teamsportneeds--driverName "Your Name"to select the right column from the table export.- You can concatenate multiple sources in order with repeated
--inputVideoflags (e.g.--inputVideo a.mp4 --inputVideo b.mp4). - Overlay is ffmpeg-only in the web UI and CLI to keep the flow simple.
- Run type checks before handing back work:
npm run type-check.
## mac local dev env.
colima start --arch x86_64
## build
docker build --platform=linux/amd64 -t lap-timer .
## debug
docker run -it --rm lap-timer sh
## run locally from the root of the repo on http://localhost:3008
docker run -it --rm \
-p 3008:3000 \
-v $(pwd)/work:/work \
--name lap-timer \
jonnyreeves83/lap-timer:latest
## tag
docker tag lap-timer jonnyreeves83/lap-timer:latest
## publish
docker push jonnyreeves83/lap-timer:latest