Extracts embedded SEI telemetry from Tesla dashcam MP4 files and composites a real-time overlay displaying vehicle data.
The overlay displays:
- Speed (MPH)
- Accelerator pedal position (vertical bar)
- Autopilot/FSD state (OFF, FSD, AUTO, TACC)
- Rolling acceleration chart (5-second history)
- Front/Back (X-axis) - coral
- Left/Right (Y-axis) - teal
- Up/Down (Z-axis) - yellow
- Brake indicator
- Turn signal indicators (left/right)
- Python 3.8+
- ffmpeg
- Tesla dashcam video with SEI metadata (firmware 2025.44.25+, HW3+)
pip install numpy pillow matplotlib protobufThis tool depends on Tesla's SEI extractor. Clone it to /tmp/tesla-dashcam:
git clone https://github.com/tesla/dashcam /tmp/tesla-dashcamOr adjust the path in the script.
# Output defaults to <input>-overlay.mp4
python overlay_dashcam.py /path/to/dashcam-video.mp4
# Specify a custom output path
python overlay_dashcam.py /path/to/dashcam-video.mp4 -o /path/to/output.mp4The script uses a dual-pipe architecture for efficient processing:
- ffmpeg decoder streams raw frames to Python
- Python composites the overlay using:
- matplotlib with blitting for the acceleration chart (only redraws lines, not axes)
- PIL for indicator icons (pre-cached by state)
- numpy for alpha blending
- ffmpeg encoder encodes the output to H.264
Single pass, one frame in memory at a time.
- Codec: H.264
- Quality: CRF 18
- Frame rate: ~36 fps (matches input)
MIT
