Dash Cam Time Lapse Video

Intro

Over on the Dashcam subReddit a question was asked about how to make a long time lapse video from dash cam footage. The issue was that iMovie was running out of space before all the segments were loaded.

I’ve had issues with iMovie using huge amounts of storage so the problem did not surprise me. I replied with a way to use some command line tools in a process that uses no computer storage other than what is needed for the final output.

Since finding things on Reddit, especially on a subReddit that I don’t normally visit, could be difficult I am including my answer here as a note to myself just in case I want to do this in the future. It will be a lot easier for me to find here.

Tools and Programs Needed

This uses bash (available on any Unix based systems including MacOS and Linux) and it uses ffmpeg.

There are a couple of ways to install ffmpeg on your Mac (brew or simply downloading the binary from the ffmpeg project come to mind). On many Linux systems ffmpeg should be available through the package manager for the OS.

It uses no storage on your Mac other than what is needed for your final video.

This will definitely work on a Linux/Unix based machine and with slight variations should work on Windows too.

First command

When the microSD card from my Viofo 119s is mounted on my Mac the video files are located at /Volumes/VOLUME1/DCIM/Movie/

First step is to build a list of the desired videos:

for f in /Volumes/VOLUME1/DCIM/Movie/2020_1210_* ; do echo "file '$f'" >> mylist.txt; done

Your dashcam storage card and/or computer OS may have a different volume name and path.

Second command

Now concatenate those files into one time lapse video:

ffmpeg -f concat -safe 0 -i mylist.txt -vf "setpts=0.01*PTS,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p -an dashcam_timelapse.mp4

Parameters in above:

  • The '-f concat -safe 0 -i mylist.txt' part says concatenate the videos listed in the mylist.txt file. See the ffmpeg concatenate page for more info
  • The '-vf "setpts=0.01PTS,crop=in_w:in_w9/16,scale=1920:1080"' part is the magic to speed up the video. The 0.01 is the inverse of the speed up, in this case a speed up of 100 to 1. See the nice write up by Rick Makes for more information.
  • The '-vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p' sets the resultant file’s video formatting
  • And the '-an' drops the audio (audio is not speed up by the above)
  • Finally, the 'dashcam_timelapse.mp4' is the output file.