Skip to content

Instantly share code, notes, and snippets.

@noktoborus
Created March 7, 2021 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noktoborus/b8e80cf0232784c1b21c695767fb6431 to your computer and use it in GitHub Desktop.
Save noktoborus/b8e80cf0232784c1b21c695767fb6431 to your computer and use it in GitHub Desktop.
#!/bin/sh
# vim: ft=sh ff=unix fenc=utf-8
# file: mivue_to_mapillary.sh
(
(
echo gpsbabel \\
for nmea in `echo *.NMEA`;
do
name=$(echo $nmea | sed 's/.NMEA//')
gpx="$name.GPX"
echo -i nmea -f "$nmea" \\
done
echo -o gpx,gpxver=1.1 -F all.gpx
) | sh
)
(
for file in `echo *.MP4`;
do
time=$(echo $file | sed 's/\(FILE\|EMER\)\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)-\([0-9]\{2\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)F\.MP4\|.*/20\2-\3-\4 \5:\6:\7/')
if [ -z "$time" ];
then
continue
fi
echo "$time"
exiftool -overwrite_original "-AllDates=$time" "-mediacreatedate=$time" "-trackcreatedate=$time" $file
done
)
(
mapillary_tools video_process --user_name noktoborus --advanced \
--geotag_source "gpx" --geotag_source_path "$PWD/all.gpx" \
--video_import_path . \
--local_time
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment