Skip to content

Instantly share code, notes, and snippets.

@zuf
Created May 20, 2015 10:16
Show Gist options
  • Save zuf/bd528783f98bf692747a to your computer and use it in GitHub Desktop.
Save zuf/bd528783f98bf692747a to your computer and use it in GitHub Desktop.
This script extracts GPS data (in GPX format) from ContourGPS camera videos.
#!/usr/bin/env sh
# This script extracts GPS data (in GPX format) from ContourGPS camera videos.
# You need to have ffmpeg, gpsbabel and gnu parallel to run this script.
#
# Please note that *.gpx files in given directory may be overwriten!
#
# Usage: extract_contour_gps.sh <directory_with_movies>
#
if [ -z "$1" ]
then
echo "No argument supplied"
echo "Usage: extract_contour_gps.sh <directory_with_movies>"
exit 1
fi
find $1 -type f -iname '*.MOV' | parallel -j 1 -k 'ffmpeg -loglevel panic -i {} -y -an -vn -bsf:s mov2textsub -scodec copy -f rawvideo - | gpsbabel -i nmea -f - -o gpx -F {.}.gpx && echo "GPS data from \"{}\" saved to \"{.}.gpx\""'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment