Extract GPS, gyro, accelerometer, and other telemetry from GoPro video files. Pure Python, zero dependencies.
Project description
telemetrik
Extract GPS, gyroscope, accelerometer, and other sensor data from GoPro video files.
telemetrik is a pure-Python parser for the GoPro Metadata Format (GPMF) — no compiled dependencies, no FFmpeg, just pip install and go.
Install
pip install telemetrik
Usage
Python
from telemetrik import extract_all_telemetry
streams = extract_all_telemetry("GX010042.MP4")
# GPS track
for ts, (lat, lon, alt, spd2d, spd3d, fix, dop) in streams["GPS5"].data:
if fix >= 3: # 3D fix
print(f"{lat:.6f}, {lon:.6f} alt={alt:.0f}m")
# 200 Hz accelerometer
for ts, (x, y, z) in streams["ACCL"].data:
print(f"{ts}ms accel=({x:.2f}, {y:.2f}, {z:.2f}) m/s²")
# Camera orientation quaternions
for ts, (w, x, y, z) in streams["CORI"].data:
print(f"{ts}ms quat=({w:.4f}, {x:.4f}, {y:.4f}, {z:.4f})")
Command line
telemetrik GX010042.MP4 # extract all streams
telemetrik --streams ACCL,GYRO,GPS5 *.MP4 # specific streams, batch
Each stream is saved as <stem>.<fourcc> (e.g. GX010042.accl, GX010042.gps5) in CSV format with millisecond timestamps.
Supported streams
| FourCC | Stream | Shape |
|---|---|---|
ACCL |
Accelerometer | (x, y, z) m/s² |
GYRO |
Gyroscope | (x, y, z) rad/s |
GPS5 |
GPS + quality | (lat, lon, alt, speed_2d, speed_3d, fix, dop) |
CORI |
Camera orientation | (w, x, y, z) quaternion |
IORI |
Image orientation | (w, x, y, z) quaternion |
GRAV |
Gravity vector | (x, y, z) |
SHUT |
Shutter speed | scalar, microseconds |
ISOE |
ISO | scalar |
WBAL |
White balance | (temperature, tint) |
TMPC |
Sensor temperature | scalar, °C |
Pass any GPMF FourCC to extract unlisted streams: extract_all_telemetry(path, streams=["MWET"]).
Timestamps
Every TelemetryStream carries two timestamp arrays:
data—(ms, value)pairs from the GPMF STMP clock (millisecond precision, always available)pts_data—(seconds, value)pairs on the video presentation timeline (available when the MP4 has timing atoms)
Use pts_data to align telemetry with video frames.
GPS quality fields
The GPS stream includes two "sticky" metadata fields that persist across samples:
| Field | Values | Meaning |
|---|---|---|
fix |
0 / 2 / 3 | No lock / 2D / 3D |
dop |
0–9999 | Dilution of precision (lower = better) |
Filter on fix >= 3 and dop < 500 for reliable positions.
API reference
extract_all_telemetry(video_path, streams=None)
Extract all (or selected) telemetry streams from an MP4 file.
Parameters:
video_path— path to a GoPro MP4 filestreams— list of FourCC strings, orNonefor all default streams
Returns: dict[str, TelemetryStream] — only streams with data are included.
Raises: ValueError if the file has no GPMF metadata track.
TelemetryStream
| Attribute | Type | Description |
|---|---|---|
key |
str |
GPMF FourCC |
sample_count |
int |
Number of readings |
name |
str |
Human-readable name (from STNM) |
units |
str |
SI unit string (from SIUN) |
data |
list[tuple[int, Any]] |
(timestamp_ms, value) |
pts_data |
list[tuple[float, Any]] | None |
(pts_seconds, value) |
get_stream_data(f, samples, stream_key, scale=True, time_base=None)
Low-level extraction of a single stream from an open file handle. Use this when you need control over file I/O or want to extract non-standard streams.
Attribution
Core MP4 box walking and GPMF binary parsing adapted from gopro-video-sync by Ethan Vo (MIT).
License
MIT
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 telemetrik-0.1.0.tar.gz.
File metadata
- Download URL: telemetrik-0.1.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56266a9d6d7090ad22a1b3444aee105b1cef6cf8b10b69d6bd73a33342504077
|
|
| MD5 |
f5a34370dba695b4b1bab28b029a5ff2
|
|
| BLAKE2b-256 |
821866058bebb5c078f3c9bb48f4993cf651ac0fdfdc32b5723b6d6f1309975d
|
Provenance
The following attestation bundles were made for telemetrik-0.1.0.tar.gz:
Publisher:
publish.yml on kmatzen/telemetrik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telemetrik-0.1.0.tar.gz -
Subject digest:
56266a9d6d7090ad22a1b3444aee105b1cef6cf8b10b69d6bd73a33342504077 - Sigstore transparency entry: 1280327912
- Sigstore integration time:
-
Permalink:
kmatzen/telemetrik@5b0cf5abf602b434a3a9bfecd7461b6fc42dc745 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kmatzen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b0cf5abf602b434a3a9bfecd7461b6fc42dc745 -
Trigger Event:
release
-
Statement type:
File details
Details for the file telemetrik-0.1.0-py3-none-any.whl.
File metadata
- Download URL: telemetrik-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df788a35be94a9ea77f3c0a79120175c7dcdc1ba62835e95b90c9b02f0356d23
|
|
| MD5 |
0958f0b58d7c57c714d1af55acc5d3c1
|
|
| BLAKE2b-256 |
d1fcef302e5c4c0571132e400567cb62483577c213548e6c48c16dcedc1cb292
|
Provenance
The following attestation bundles were made for telemetrik-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on kmatzen/telemetrik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telemetrik-0.1.0-py3-none-any.whl -
Subject digest:
df788a35be94a9ea77f3c0a79120175c7dcdc1ba62835e95b90c9b02f0356d23 - Sigstore transparency entry: 1280327915
- Sigstore integration time:
-
Permalink:
kmatzen/telemetrik@5b0cf5abf602b434a3a9bfecd7461b6fc42dc745 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kmatzen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5b0cf5abf602b434a3a9bfecd7461b6fc42dc745 -
Trigger Event:
release
-
Statement type: