Extract GPS and sensor telemetry from dashcam videos
Project description
dashcam-telemetry
Extract GPS and sensor telemetry from dashcam videos.
Features
- Extract GPS data from dashcam MP4 videos
- Multiple export formats: GPX, GeoJSON, KML, CSV
- Auto-detection of dashcam format
- Synchronized video/map viewer for verification
- Python API for integration into other projects
Supported Dashcams
| Brand | Format | Status |
|---|---|---|
| REDTIGER | YOUQINGGPS | Supported |
| WolfBox | YOUQINGGPS | Supported |
| Other YOUQING-based | YOUQINGGPS | Supported |
Installation
pip install dashcam-telemetry
Or with uv:
uv add dashcam-telemetry
Quick Start
Command Line
# Extract GPS to GPX (default)
dashcam-telemetry extract video.mp4 -o track.gpx
# Extract to GeoJSON
dashcam-telemetry extract video.mp4 --format geojson -o track.json
# Show file info
dashcam-telemetry info video.mp4
# Batch processing
dashcam-telemetry extract *.mp4 --output-dir ./tracks/
# Launch synchronized video/map viewer
dashcam-telemetry view video.mp4
Python API
from dashcam_telemetry import extract_telemetry
# Extract GPS data
track = extract_telemetry("dashcam_video.mp4")
print(f"Found {len(track)} GPS points")
# Export to various formats
track.to_gpx("output.gpx")
track.to_geojson("output.json")
track.to_kml("output.kml")
track.to_csv("output.csv")
# Access individual points
for point in track:
print(f"{point.timestamp}: {point.latitude}, {point.longitude}")
# Get track metadata
print(f"Duration: {track.duration} seconds")
print(f"Bounds: {track.bounds}")
With pandas
pip install dashcam-telemetry[pandas]
from dashcam_telemetry import extract_telemetry
track = extract_telemetry("video.mp4")
df = track.to_dataframe()
# Now you can use pandas for analysis
print(df.describe())
df.to_parquet("telemetry.parquet")
Export Formats
| Format | Extension | Use Case |
|---|---|---|
| GPX | .gpx |
Strava, Garmin, Komoot, most GPS apps |
| GeoJSON | .json |
Leaflet, Mapbox, PostGIS, web mapping |
| KML | .kml |
Google Earth, Google Maps |
| CSV | .csv |
Spreadsheets, data analysis |
CLI Reference
dashcam-telemetry <command> [options]
Commands:
extract Extract GPS data from video files
info Show information about a video file
formats List supported formats
view Launch synchronized video/map viewer
Extract options:
-o, --output Output file path
-f, --format Output format: gpx, geojson, kml, csv (default: gpx)
--output-dir Output directory for batch mode
-v, --verbose Verbose output
--skip-invalid Skip invalid GPS points
Data Model
@dataclass
class GPSPoint:
latitude: float # Decimal degrees
longitude: float # Decimal degrees
timestamp: datetime # UTC timestamp
speed: float # km/h
heading: float # Degrees from north
altitude: float # Meters (optional)
fix_quality: int # 0=invalid, 1=GPS, 2=DGPS
gsensor_x: float # Accelerometer X (optional)
gsensor_y: float # Accelerometer Y (optional)
gsensor_z: float # Accelerometer Z (optional)
@dataclass
class GPSTrack:
points: list[GPSPoint]
source_file: str
device_info: dict
Development
# Clone repository
git clone https://github.com/oldhero5/dashcam-telemetry
cd dashcam-telemetry
# Install with dev dependencies
uv sync --dev
# Run tests
uv run pytest
# Run linter
uv run ruff check src/
# Type check
uv run mypy src/
Adding New Parsers
To add support for a new dashcam format:
- Create a new parser in
src/dashcam_telemetry/parsers/ - Inherit from
BaseParser - Implement
can_parse()andparse()methods - Register in
parsers/__init__.py
from dashcam_telemetry.parsers.base import BaseParser
from dashcam_telemetry.models import GPSTrack
class MyDashcamParser(BaseParser):
@property
def name(self) -> str:
return "MyDashcam"
@property
def formats(self) -> list[str]:
return ["MyDashcam", "BrandX"]
def can_parse(self, filepath: Path) -> bool:
# Check if file contains your format's markers
...
def parse(self, filepath: Path) -> GPSTrack:
# Extract GPS data
...
License
MIT License - see LICENSE for details.
Contributing
Contributions welcome! Please open an issue or PR.
Acknowledgments
- Inspired by gopro2gpx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dashcam_telemetry-0.1.0.tar.gz.
File metadata
- Download URL: dashcam_telemetry-0.1.0.tar.gz
- Upload date:
- Size: 76.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5bff84dc452da753a7d2959f2fd576678fb1cd5c144738ad753c5a1838e79c2
|
|
| MD5 |
3ab7b24ec4091ef549b4c28161773e22
|
|
| BLAKE2b-256 |
11c9881d456c5e007164fd0a740000b66bfd98107dbfabda38e61688a01c45fa
|
Provenance
The following attestation bundles were made for dashcam_telemetry-0.1.0.tar.gz:
Publisher:
publish.yml on oldhero5/dashcam-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dashcam_telemetry-0.1.0.tar.gz -
Subject digest:
a5bff84dc452da753a7d2959f2fd576678fb1cd5c144738ad753c5a1838e79c2 - Sigstore transparency entry: 732018407
- Sigstore integration time:
-
Permalink:
oldhero5/dashcam-telemetry@448b35e99e81ae48526cd8563e15c63695366fbe -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/oldhero5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@448b35e99e81ae48526cd8563e15c63695366fbe -
Trigger Event:
release
-
Statement type:
File details
Details for the file dashcam_telemetry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dashcam_telemetry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9e7997346b8e97fa97bbafd64958d30b8d3db9db9b649576c866e130a21ff3c
|
|
| MD5 |
c58422a261bb1684956097598788621e
|
|
| BLAKE2b-256 |
265c4e06910b45865a409986411bbeb145ee7e87b421acc93820c6d8486777b3
|
Provenance
The following attestation bundles were made for dashcam_telemetry-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on oldhero5/dashcam-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dashcam_telemetry-0.1.0-py3-none-any.whl -
Subject digest:
e9e7997346b8e97fa97bbafd64958d30b8d3db9db9b649576c866e130a21ff3c - Sigstore transparency entry: 732018408
- Sigstore integration time:
-
Permalink:
oldhero5/dashcam-telemetry@448b35e99e81ae48526cd8563e15c63695366fbe -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/oldhero5
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@448b35e99e81ae48526cd8563e15c63695366fbe -
Trigger Event:
release
-
Statement type: