GPX Hyperlapse!

Perhaps a sign of the times that I spent a recent Sunday & Monday evening cobbling together some POC-standard code and built http://gpxhyperlapse. A sign of the times that the code is 99% client-side!

I like to run – part of the #SPRunners (SharePoint runners who attempt to live a semi-healthy life, e.g. at conferences by getting up early and running, even in Vegas!)

Vegas SPRunners

I found myself wanting to share the routes I had run, but not just from a mapping perspective, from my perspective, what I see when I run; Jersey is beautiful and many of the Green Lanes (15mph speed limit) are great for running around and exploring the countryside, then there are the long coastal routes.

It’s hard to convey this without actually filming it, but I don’t have a GoPro, so I thought about the Google Street View footage and if I could use their APIs to generate a hyperlapse of my routes. Here is a recording of one:

The main inspiration came from:

The more interesting elements were:

  • Calculating the angle of travel from which to grab the right Google image
    • Google can let you know the degrees from North that the camera is facing for an image, but I also needed to work out what direction I was running; in theory that would be a straight line between the current GPS position and the previous one, but that isn’t 100% accurate
  • Identifying the optimum number of GPS points to use for a distance (currently it works best for runs of up to 20km – longer than that e.g. bike rides means loading a lot more data so takes longer)
  • Obtaining the GPS points from Strava – actually this was easy once I worked this out, but initially I had been trying to get the GPX file itself rather than the raw data; their API and docs are great and their dev team responded quickly with a query I had really promptly

Next challenges/feature requests collected so far:

  • Saving & sharing a route
    • I want to save on server resources if possible, so I may save the array of Google points and still need to load the images themselves (easy option)
    • Creating a video (e.g. using ffmpeg to create an MP4 from PNGs) would be possible server-side but using more resources
  • Integration with RunKeeper’s Health Graph
    • Shouldn’t be too difficult
  • Utilising true Hyperlapse techniques to improve the quality (e.g. Microsoft Research’s technology, if possible)
  • UI improvements – speed up/slow down UI features including loading low quality first (e.g. Netflix/YouTube streaming that buffers to start) – need to manage how quickly the frames are loading before streaming
    • Includes better tablet/iPad integration; works best on desktop currently

Posted

in

,

by

Comments

5 responses to “GPX Hyperlapse!”

  1. Angel de Vicente

    This looks exactly what I was looking for, but when I try to use the webpage gpxhyperlapse.com there seems to be a problem with the number of frames. I can change the “milliseconds between frames” no problem, but changing the “number of frames” does not seem to have any effect, and I always end up with 200 frames. Any idea on how to solve this?

    Thanks a lot,
    Ángel

    1. Gus Fraser

      Hi Angel – I’ll take a look at this and let you know – I think maybe there is a bug in there; I have been working on smoothing this out and trying to optimise the number of frames for the distance covered.

  2. Evan

    Hey Gus,
    This functionality is great. Just thought I’d add in another plug for being able to successfully change the number of frames used. Whenever I hit reload it the video goes black and it never reloads.

    Anyway thanks for the great work

  3. Evan

    Hey Gus,
    This functionality is great. Just thought I’d add in another plug for being able to successfully change the number of frames used. Whenever I hit reload it the video goes black and it never reloads.

    Anyway thanks for the great work!

  4. Patrick

    Just ran across the site. It works great on my shorter Strave adventures, but seems to crash on longer rides (ie: over 100Km). Were you every able to implement a way to save the output?

Leave a Reply

Your email address will not be published. Required fields are marked *