Scripts to overlay telemetry from DJI SRT files (e.g. DJI Neo 2) onto drone video as a green HUD burn-in.
- Python 3 (standard library for HUD/export; optional
foliumfor flight map) - FFmpeg (with libx264, libass, AAC support)
Optional but recommended: use a virtual environment so the flight-map script can install folium without touching the system Python.
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# or: venv\Scripts\activate # Windows
pip install -r requirements.txt(requirements.txt only adds folium for srt_to_map.py; the HUD and CSV scripts need no extra packages.)
You pass either a base name or a directory (no default):
- Base name (e.g.
DJI_20260217162018_0009_D): the scripts append.srt,.mp4,.m4afor inputs and createBASE_HUD.assandBASE_HUD.mp4. - Directory: the scripts look in that directory for one file with extension
.srt, one with.mp4, and one with.m4a. The three files must share the same base name (e.g.DJI_20260217162018_0009_D.srt,.mp4,.m4a). Extensions are matched case-insensitively (.srt/.SRT, etc.). Use--no-audioto skip the.m4arequirement and use audio from the MP4 instead.
| Extension | Used for |
|---|---|
.srt |
Telemetry input (per-frame GPS, orientation, exposure, etc.) |
.mp4 |
Video input and HUD output |
.m4a |
Audio input (optional with --no-audio; uses MP4 audio when skipped) |
Example with base name DJI_20260217162018_0009_D:
- Inputs:
DJI_20260217162018_0009_D.srt,.mp4,.m4a - Outputs:
DJI_20260217162018_0009_D_HUD.ass,DJI_20260217162018_0009_D_HUD.mp4
Example with directory: ./render_hud.sh /path/to/my_clips uses the single .srt in that folder to get the stem, then expects matching .mp4 and .m4a there.
Burns a green, text-based HUD into the video (timestamp, position, altitude, speed, climb, attitude, heading).
# Make the script executable once
chmod +x render_hud.sh
# Base name (scripts append .srt, .mp4, .m4a)
./render_hud.sh DJI_20260217162018_0009_D
# Or a directory that contains one .srt, .mp4, .m4a with the same stem
./render_hud.sh /path/to/clips (e.g. ./render_hud.sh ./altitude_test)
# Imperial (feet, mph)
./render_hud.sh DJI_20260217162018_0009_D --imperial
# or
./render_hud.sh /path/to/clips -i
# Skip external .m4a and use MP4 audio (when MP4 already has audio)
./render_hud.sh DJI_20260217162018_0009_D --no-audio
# or
./render_hud.sh /path/to/clips -nOutput: BASE_HUD.mp4 (e.g. DJI_20260217162018_0009_D_HUD.mp4).
- Time (seconds to one decimal)
- Latitude, longitude; relative N/E from start (feet or meters)
- Altitude (MSL) and AGL (above ground level)
- Camera: shutter, f-number, ISO
- Speed (horizontal, smoothed) and climb rate (vertical speed, smoothed)
- Roll, pitch, heading (0–360°)
Creates an interactive HTML map of the flight from the SRT’s GPS track (OpenStreetMap + optional satellite layer). Requires the venv and pip install -r requirements.txt (folium).
source venv/bin/activate # or venv\Scripts\activate on Windows
python srt_to_map.py altitude_test/DJI_20260217162018_0009_D
# → altitude_test/DJI_20260217162018_0009_D_flight_map.html
# Custom output path
python srt_to_map.py BASE -O my_flight.html
# Long flights: use every 30th point (~1 per second at 30 fps)
python srt_to_map.py BASE --downsample 30Open the .html file in a browser (double-click, or File → Open file in Chrome).
- Blue line – flight path
- Green marker – start
- Red marker – end
- Layers – switch in the top-right between OpenStreetMap (streets) and Satellite (Esri World Imagery)
All commands take BASE_OR_DIR: base name (scripts append .srt, .mp4, .m4a) or a directory that contains one .srt, one .mp4, and one .m4a with the same stem.
| Goal | Command |
|---|---|
| HUD video (metric) | ./render_hud.sh BASE_OR_DIR |
| HUD video (imperial) | ./render_hud.sh BASE_OR_DIR --imperial |
| HUD video (MP4 audio only, no .m4a) | ./render_hud.sh BASE_OR_DIR --no-audio |
| Flight path map (OSM + satellite HTML) | python srt_to_map.py BASE_OR_DIR (requires venv + folium, see Setup) |