To see the help on the command line the scheme is for all commands the same
(example with the upload command)
See the normal help for each command mapillary_tools upload -h
See the advanced help for each command mapillary_tools upload -h --advanced
The order of the parameters makes no difference.
Let the fun begin with mapillary tools
Create a directory in your $HOME
$ mkdir -p $HOME/mapillary/video-files/
$ mkdir -p $HOME/mapillary/img/
Copy your files to your harddisk
$ cp /mnt/your_sdcard_directory/*.MP4 $HOME/mapillary/video-files
change into your dashcam video directory and extract the GPS information into
gpx files (the mapillary tools cannot read GPS data from the MP4-files
Rename the .gpx files to remove the MP4 extension from them (necessary for some
windows dashcam movie players to recognise the corresponding .gpx file
$ cd $HOME/mapillary/video-files
$ for i in *.MP4; do nvtk_mp42gpx.py -i $i -o $i.gpx -f; done
$ mmv '*.MP4.gpx' '#1.gpx'
I describe all the single steps with mapillary-tools, you can combine them with
the commands listed below
Step 1 - Images from Video
Extract the images from the mp4-file
mapillary_tools sample_video --advanced --import_path "$HOME/mapillary/img/" --video_sample_interval .5 --video_import_path "/mnt/videos/dashcam/mapillary-upload/selection/"
Step 2 - geotag images from .gpx
Extract the GPS information from the gpx files we created before.
My GPS coordinates are ca. 500 ms later than the movie.
mapillary_tools process --advanced --user_name yourusername --import_path "$HOME/mapillary/img/" --offset_time "-.6" --duplicate_distance 0.5 --geotag_source gpx --geotag_source_path "/mnt/videos/dashcam/mapillary-upload/selection/2019_0610_170345_164.gpx"
the same in a loop for all directories
for i in `ls -1 $HOME/mapillary/img/mapillary_sampled_video_frames/`; do mapillary_tools process --advanced --user_name yourusername --import_path "$HOME/mapillary/img/mapillary_sampled_video_frames/$i" --offset_time "-.6" --duplicate_distance 0.5 --geotag_source gpx --geotag_source_path "/mnt/videos/dashcam/mapillary-upload/selection/$i.gpx"; done
When first using the parameter --user_name the program asks you for your
account data. This is - if I understood this correctly - embedded in an EXIF
tag (of course not in cleartext), so the mapillary system recognises after
uploading from which user the images were uploaded.
Step 3 - Upload
Finally bulk upload the images in import_path and its subdirectories.
mapillary_tools upload --import_path "$HOME/mapillary/img/" --move_uploaded
or one of the subdirectories
Uploading might take some time, depending on your bandwith (mine is definitely
too low ;) ).
At least I could reduce the data usage, from around 50GB in videos to
around 25GB in images, and I didn't have to manually start the upload for each
video file in the legacy uploader, just had to let the linux box run for some
Another advantage is the automatic retry in case of connection problems for individual images.
And finally, if the upload is interrupted, the mapillary tools remember which
images have already been uploaded and continue the upload where it was
Combination of commands
The single commands can be combined:
sample_video + process = video_process
process + upload = process_and_upload
sample_video + process + upload = video_process_and_upload