Video gpx script

From OpenStreetMap Wiki
Jump to navigation Jump to search
Equipment required: video camera, video recorder, and GPS


Photo mapping is all very nice if you're prepared to take loads of photos manually, but sometimes you just want to leave the video camera running and get a set of images that you can browse on the map


Please add to this page if you know any other Free software which does similar things.

Data needed

  • A video
  • A GPX file
  • The time according to your GPS when the video starts
  • How many frames per second the video is recorded at


Open the video in avidemux, and File → Save → "save selection as JPEG images". This will create thousands of JPEG images from the frames of the video

python [path_to_images] [gpx_filename] [start_time] [fps]
  • images should be of the form "somePrefix_0001.jpg"
  • images don't need valid timestamps or EXIF
  • start time should be in the format "2009-07-26T09:52:17Z", and can be copy/pasted out of your GPX file
  • fps will be something like "25" or "30"

Finding the frame-rate:

  • in avidemux, Video → frame rate
  • In VLC, Tools → codec information (or ctrl-J)


  • Currently assumes that the video is a fixed number of frames per second (since we don't get any timestamps out of avidemux's JPEG images, only the frame numbers)
  • Currently only works if GPX points are dense enough (<3sec apart)
  • Not sure how well it handles timezones
  • Still has hardcoded references to Ojw's website on dev, and hardcoded output locations (frames/ directory and output.kml)

Storing the results

OpenStreetPhoto, OpenStreetView

Viewing the results

TODO: someone write a nice OpenStreetView viewer please?

Sample output

Debug output - just KML files to show the georeferencing: deadlink

  • deadlink - using the 'good' camera linked above (wide-angle, locked to 25fps)

See also

  • Video mapping - Ideas around different approaches to video mapping.