How To: Make a Speed Data Video Overlay

With After Effects and MOTOrift

joshua willuhn
RideData
5 min readJul 18, 2019

--

The newest MOTOrift update makes it easier than ever to export your data to use in another program like After Effects. In this tutorial I’ll cover how to export your data and turn it into an overlay on your next video.

You’ve no doubt seen the effect, a car or motorcycle is going down the road usually a side view and there’s an overlay on screen with the speed shown on screen. Maybe a graph or two as shown:

That’s what I’ll show you how to make.

You can import any CSV document into After Effects — any GPS tracker or app that exports to a comma separated value file will work but I’ll show you how with MOTOrift because it’s the app I made so I’m biased towards using it.

This is just one way of doing this, I’m sure other ways exist, or I hope other ways exist because I’d like to find them. After Effects has some competition these days, the basic idea should be similar, export CSV data, import into video editor, display it, line it up timing wise and render.

MOTOrift does GPS and IMU data logging and performance driving analysis. You start recording in the app before you leave, put your phone somewhere safe and when you stop recording you’ll have stats and data about your ride, 0–60, 1/4 mile, 60 ft times and motion profiles from IMU data.

What you’ll need:

  • A high performance vehicle
  • A camera
  • After Effects
  • MOTOrift

To get started, film a video while recording MOTOrift data on your phone. However you normally film will work, you can use After Effects to display your data on any video.

To record MOTOrift data start a new ride and hit “start”:

When you get done recording you can sync your data with the cloud, an account is required at MOTOrift.com, once you sync your data with the cloud using the MOTOrift mobile app, you’ll login through the web app and select your ride. Create or choose a short video clip you’d like to use here’s mine:

https://youtu.be/kGvT3IcR8s4

Find where you were on the map for the selected clip. Choose starting and ending locations. It’s easiest if you were stopped to begin with. Select a starting location and when you select an ending location the pop up will say “select”. Click there to select it:

This zooms you in on your data and the full data set between those two locations is loaded. Now go to export in the side panel. Click Export CSV raw or Export CSV / 2. I recommend choosing both so you can see the difference and choose which one works better for you.

The raw option is everything, depending on your app settings it might be too much data to effectively work with this tutorial. The /2 option cuts your data in half so every other spot is shown.

With your data exported open both files in a spreadsheet or text editor of your choice and scroll through the data to get an idea of what it looks like.

If you look at your “diff” column it’s the number of milliseconds between it and the next row. Remember, 1000 milliseconds equals one second. For this tutorial you’ll ideally have a difference of 600ms-1200ms between each row or data spot.

The time stamp is the number of milliseconds since 1970. Your speed and IMU data is shown as well as your last stopped location and time.

Chances are if you had the app at default settings and your phone is relatively new, you’ll have too much data with the full data set and so you’ll need the “export / 2” option to clean it up to work (with this tutorial) in After Effects.

With your CSV file in an accessible folder, rename the file to something easy to remember instead of the long string of characters it downloads as. Now you’re ready to open After Effects and make the video overlay.

Open After Effects and import your video into a new composition.

Now select the text tool and create a new text layer, type “0” into it.

Next import your csv file into After Effects. Drag and drop it into the project, you’ll reference it in code so it updates as you update it instead of dragging it into the composition as a layer.

With your text layer selected open the drop panel arrow and alt+click the stop watch to create a new expression.

Now it’s important to say if you’ve never used After Effects expressions, it can take a second to wrap your head around the idea of scripting your video. But this is how.

Now replace the code in your expression window with the following:

footage(“my_filename.csv”).dataValue([3, time]];

Type your file name in place of my_filename.csv

What it does:

Imports the footage(“yourfilename”) and then selects a dataValue (the data) from column 3 and row number “elapsed video seconds”. If you have a twenty second clip, you need 20 rows of data one for each second so it never runs out of data for this clip:

It works best if you line it up with a stopped point in the video so you can see when and where the data correlates with your video by when you start moving in speed data vs when the bike starts moving on screen. You can subtract rows in your spreadsheet or text editor to make it line up better if you have too much data.

Because you selected source text as where you want your expression to show it’ll display the value in text. If you’ve used expressions before or have used any programming or scripting language of any kind you can see the potential to combine properties with data from your favorite CSV file.

With your data linked and synced you can export your video.

This is just one way to accomplish this and you can use any bit of data you’d like from your csv file just choose the column (starts at 0) and replace the 3 with the matching column. So AZ or the z axis of the accelerometer would be column 6.

Well that’s it, if you like this tutorial follow along for more! The next tutorial will show you how to add the graphs.

Download MOTOrift

--

--