Gpx2video
Creating video with telemetry overlay from GPX data
Install / Use
/learn @progweb/Gpx2videoREADME
GPX2Video tool - Telemetry overlay
GPX GoPro Quick not working ? No tool working with Linux distribution. That's why I have written this small tool to extract telemetry data to enable stickers or gauges on your videos.
GPX2Video can convert the data recorded by your GoPro (GPS, accelerometer, camera settings and more) or reads an input GPX file. Visualize data or maps on your videos.
Finally, gpx2video should work with any camera and you are able to customize your gauges and much more. gpx2vidoe supports the timelapse / timewrap video too.
gpx2video is only a test tool and isn't yet a final release!

Please test and report issues. Tested with GoPro 5, 6, 7, 8 and 9 (with last firmware).
Features
gpx2video should work with any video. Orientation, SAR & DAR video parameters are supported.
gpx2video can read and extract from your gpx input file:
- time,
- position,
- elevation,
- speed,
- average speed,
- max speed,
- heartrate,
- cadence,
- temperature
gpx2video can extract GPMD data from GoPro GPMD stream in several format:
- Text dump
- RAW dump
- GPX data
gpx2video can draw a map widget with your track. It supports multi map source:
- OpenStreetMap I © OpenStreetMap contributors
- Maps-For-Free Maps © Maps-For-Free
- OpenCycleMap Maps © thunderforest.com, Data © osm.org/copyright
- OpenTopoMap © OpenTopoMap (CC-BY-SA)
- Public Transport Maps © ÖPNVKarte, Data © OpenStreetMap contributors
- Google Maps Map provided by Google
- Google Satellite Map provided by Google
- Google Hybrid Map provided by Google
- Virtual Earth Map provided by Microsoft
- Virtual Earth Satellite Map provided by Microsoft
- Virtual Earth Hybrid Map provided by Microsoft
- IGN Essentiel Map Map provided by IGN
- IGN Essentiel Photo Map provided by IGN
gpx2video can synchronize your video with your gpx input file.
How it works ?
gpx2video is able to extract and parse metadata and sensor data recorded by your GoPro.
$ ffprobe GH010337.MP4
ffprobe version 3.2.2 Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 6.2.1 (Debian 6.2.1-5) 20161124
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GH010337.MP4':
Metadata:
major_brand : mp41
minor_version : 538120216
compatible_brands: mp41
creation_time : 2021-12-08T09:56:26.000000Z
...
Duration: 00:00:52.38, start: 0.000000, bitrate: 100345 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], 100078 kb/s, 50 fps, 50 tbr, 90k tbn, 100 tbc (default)
Metadata:
creation_time : 2021-12-08T09:56:26.000000Z
handler_name : GoPro AVC
encoder : GoPro AVC encoder
timecode : 09:56:26:43
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata:
creation_time : 2021-12-08T09:56:26.000000Z
handler_name : GoPro AAC
timecode : 09:56:26:43
Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2021-12-08T09:56:26.000000Z
handler_name : GoPro TCD
timecode : 09:56:26:43
Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 48 kb/s (default)
Metadata:
creation_time : 2021-12-08T09:56:26.000000Z
handler_name : GoPro MET
Stream #0:4(eng): Data: none (fdsc / 0x63736466), 12 kb/s (default)
Metadata:
creation_time : 2021-12-08T09:56:26.000000Z
handler_name : GoPro SOS
gpx2video uses the creation_time field to synchronize your video with your GPX file. Warning, creation_time
is in local time. But this date isn't synchronized with the GPS source.
If gpx2video finds the 'GoPro MET' stream, it searches packet with GPS fix to determine the offset time to use. In
this case, the creation_time value is computed form 'GoPro MET' stream.
If the creation_time field and 'GoPro MET' stream can't be found, gpx2video assumes that the video starts in the
same time that the GPX stream.
At last, you can overwrite creation_time value in using --start-time option. As this option is used, gpx2video
doesn't
"sync" command permits to test the sychronization process:
$ ./gpx2video -v -m GOPR1860.MP4 sync
Time synchronization...
PACKET: 0 - PTS: 0 - TIMESTAMP: 0 ms - TIME: 2022-01-16 10:05:03 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:01:38.959 - OFFSET: -205
PACKET: 1 - PTS: 1000 - TIMESTAMP: 1000 ms - TIME: 2022-01-16 10:05:04 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:01:40.939 - OFFSET: -204
PACKET: 2 - PTS: 2000 - TIMESTAMP: 2000 ms - TIME: 2022-01-16 10:05:05 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:01:41.929 - OFFSET: -204
PACKET: 3 - PTS: 3000 - TIMESTAMP: 3000 ms - TIME: 2022-01-16 10:05:06 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:01:42.919 - OFFSET: -204
...
PACKET: 20 - PTS: 20000 - TIMESTAMP: 20000 ms - TIME: 2022-01-16 10:05:23 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:01:59.969 - OFFSET: -204
PACKET: 21 - PTS: 21000 - TIMESTAMP: 21000 ms - TIME: 2022-01-16 10:05:24 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:02:00.959 - OFFSET: -204
PACKET: 22 - PTS: 22000 - TIMESTAMP: 22000 ms - TIME: 2022-01-16 10:05:25 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:02:01.949 - OFFSET: -204
PACKET: 23 - PTS: 23000 - TIMESTAMP: 23000 ms - TIME: 2022-01-16 10:05:26 - GPS FIX: 0 - GPS TIME: 2022-01-16 10:02:02.939 - OFFSET: -204
PACKET: 24 - PTS: 24000 - TIMESTAMP: 24000 ms - TIME: 2022-01-16 10:05:27 - GPS FIX: 2 - GPS TIME: 2022-01-16 10:02:03.929 - OFFSET: -204
Video stream synchronized with success (offset: -204 s)
Video start time is: 2022-01-16 10:01:38.960
At last, but not least, you can add an user offset (in ms).
$ ./gpx2video -m GOPR1860.MP4 --offset 9000 ...
$ ./gpx2video -m GOPR1860.MP4 --start-time "2021-12-08T09:56:26" --offset 300 ...
Build
Build in docker
Debian
By default docker will use debian:12.8-slim as base image, but you can change it.
make build-docker
make build-gpx2video
Copy video files to data folder then you can start docker and try it out
make run VIDEO_DIR=~/Videos
# run gpx2video
./gpx2video -v -m /data/SOME_VID.mp4 -g /data/SOME_GPX.gpx -l /data/layout.xml -o /data/output.mp4
Ubuntu
If you prefer build & run for ubuntu, fist create docker image, then build the application.
make ubuntu-noble
To rebuild the applicatio
make buid-ubuntu-noble
To execute the application
make run-ubuntu-noble VIDEO_DIR=~/Videos
# run gpx2video
./tools/gpx2video -v -m /data/SOME_VID.mp4 -g /data/SOME_GPX.gpx -l /data/layout.xml -o /data/output.mp4
Build on host
To build gpx2video, please install all dependencies (on Debian):
apt-get install cmake g++ libevent-dev libssl-dev libcurl4-gnutls-dev \
libavutil-dev libavformat-dev libavcodec-dev libavfilter-dev \
libswresample-dev libswscale-dev libopenimageio-dev libgeographic-dev \
libcairo2-dev libopenexr-dev \
libfreetype-dev
Warning, on some distribution, libgeographic-dev is called libgeographiclib-dev!
Then build in using cmake tools:
$ git clone https://github.com/progweb/gpx2video.git
$ mkdir gpx2video/build
$ cd gpx2video/build
$ cmake ..
$ make
$ ./gpx2video -h
Please execute gpx2video tool from the build path so as it finds assets data.
Usage
gpx2video is a command line tool.
- To extract GoPro GPMD data from media stream:
$ ./gpx2video -v -m GOPR1860.MP4 -o output.gpx --extract-format=3 extract
gpx2video v0.0.0
creation_time = 2020-12-13T09:56:27.000000Z
Failed to find decoder for stream #2
Failed to find decoder for stream #3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../../video/GOPR1860.MP4':
...
Extract GPMD data...
PACKET: 0 - PTS: 0 - TIMESTAMP: 0 ms - TIME: 1970-01-01 00:00:00
PACKET: 1 - PTS: 1001 - TIMESTAMP: 1001 ms - TIME: 1970-01-01 00:00:01
- To render image per image with telemetry data:
$ mkdir png
$ ./gpx2video -v -m GH020340.MP4 -g ACTIVITY.gpx -l layout.xml -o png/image-XXXXXX.png image
gpx2video v0.0.0
...
One image per second will be generated. 'XXXXXX' will be replaced by the frame number
- To render a video stream with telemetry data:
$ ./gpx2video -v -m GH020340.MP4 -g ACTIVITY.gpx -l layout.xml -o output.mp4 video
gpx2video v0.0.0
creation_time = 2021-12-08T10:34:50.000000Z
...
[read the input media metadata]
...
Track info:
Name : Road biking
Comment :
Description :
Source :
Type : road_biking
Number :
Segments: : 1
Output #0, mp4, to 'output-overview.mp4':
Stream #0:0: Video: h264, yuvj420p(pc), 2704x1520 [SAR 1:1 DAR 169:95], q=2-31, 32000 kb/s, 50 tbn
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
Parsing layout.xml
Load widget 'grade'
Initialize grade widget
Load widget 'speed'
Initialize speed widget
Load widget 'elevation'
Initialize elevation widget
Load widget 'cadence'
Initialize cadence widget
Load map widget
Initialize map widget
Cache initialiization...
Time synchronization...
PACKET: 0 - PTS: 0 - TIMESTAMP: 0 ms - TIME: 2021-12-08 09:34:50 - GPS TIME: - OFFSET: 478042309
PACKET: 1 - PTS: 1000 - TIMESTAMP: 1000 ms - TIME: 2021-12-08 09:34:51 - GPS TIME: 2021-12-08 09:38:36.850 - OFFSET: 225
Video stream synchronized with success
Download map from OpenStreetMap I...
Download tile 6 / 6 [##################################################] DONE
...
[Download, build map then draw your track]
...
Build map...
FRAME: 0 - PTS: 0 - TIMESTAMP: 0 ms - TIME: 2021-12-08 10:38:35
Time: 2021-12-08 10:38:38. Distance: 35.841 km in 6330.000 seconds, current speed is 25.817 (valid: true)
FRAME: 1 - PTS: 1800 - TIMESTAMP: 20 ms - TIME: 2021-12-08 10:38:35
Time: 2021-12-08 10:38:38. Distance: 35.841 km in 6330.000 seconds, current speed is 25.817 (valid: true)
[Process each frame]
Related Skills
docs-writer
99.3k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
338.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
ddd
Guía de Principios DDD para el Proyecto > 📚 Documento Complementario : Este documento define los principios y reglas de DDD. Para ver templates de código, ejemplos detallados y guías paso
zola-ai
An autonomous Solana wallet agent that executes payments via Twitter mentions and an in-app dashboard, powered by Claude.
