Make GoPro Timelapse with ffmpeg

This is a post about converting a series of GoPro images into a timelapse video. This was using a GoPro Hero 5 Session. Using Linux Mint 18.3

First you need to get the GoPro images into a directory. (Suggested to be on a local fast disk)

$ ll
total 535M
-rwxr-xr-x 1 root root 809K Apr 25 22:59 G0051772_DxO.jpg
-rwxr-xr-x 1 root root 774K Apr 25 22:59 G0051773_DxO.jpg
-rwxr-xr-x 1 root root 782K Apr 25 22:59 G0051774_DxO.jpg
-rwxr-xr-x 1 root root 763K Apr 25 22:59 G0051775_DxO.jpg
-rwxr-xr-x 1 root root 778K Apr 25 22:59 G0051776_DxO.jpg
-rwxr-xr-x 1 root root 818K Apr 25 22:59 G0051777_DxO.jpg

Then If you don't already have ffmpeg install it

$ sudo apt install ffmpeg

Then start making the timelapse

ffmpeg -r 30 -y -start_number 51772 -i 'G%07d_DxO.jpg' -c:v libx264 -preset slow -crf 20 -s 1920x1080 output.mp4

What do the options here mean:

-r 30 Means the output video will be at 30 frames per second (fps) you might want to vary this depending on how many images you have and how long you want the timelapse to be.

-start_number 51772 This is the first image file to use

-i 'G%07d_DxO.jpg' The filename format to match

-c:v libx264 The endoding to use in this case h.264 see https://trac.ffmpeg.org/wiki/Encode/H.264 for more info.

-preset slow Provides better compression at the expense of time

-crf 20 Select the quality vs file size trade off (CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible)

-s 1920x1080 Output frame size in this case 1080p

output.mp4 The output filename