GPS data overlay on video

Any idea about how to overlay GPS data onto a video using open source? What I’m looking for is to overlay a track/map in a corner of the video, with a dot moving along the track to show the current position. Better if it also shows data like time/speed/height, but it’s not essential.

I guess one solution would be to take an image of the map, parse the gpx file, use some command line editor to add a point and export a new time-referred image, and then somehow convert that pile of images into a video taking into account the timing. Then I can use Kdenlive to overlay that map video onto my main video. But I hope I won’t need to get to that level of work :yum:

Maybe 3D animation - OpenStreetMap Wiki is helpful.

Thanks. 3D would be a bit of overkill, but it lead me to several interesting links so far (like this). I need to explore deeper that wiki

GPS Babel can create a subtitle file containing speed, height, time, lat and long:

gpsbabel -i gpx -f tracklog.gpx -o subrip,video_time=000142,gps_time=192521,gps_date=20100409 -F subtitles.srt

You need to provide the time in the video and the GPS time that match e.g.
video position 0:01:42 corresponds to 2010-04-09 19:25:21 GPS time

From that you could probably write a script to remove un-needed data, use an online mapping API to get a map with a dot, reformat the text to look nice etc.

I might even have a look at doing that over the next few weeks for some of my cycling videos.

1 Like

Shotcut has a filter called “GPS text” to which you can load a gpx or tcx file.
I’ve never used that filter, but see if it’s what you’re looking for.