# Help setting up mapillary\_tools on Windows

**URL:** <https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756>\
**Category:** Contributing and equipment\
**Created:** [March 31, 2019, 9:12pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756 "2019-03-31T21:12:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikelo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/mikelo/32/68228_2.png) [@mikelo](https://forum.mapillary.com/u/mikelo)\
**Post date:** [March 31, 2019, 9:12pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/1 "2019-03-31T21:12:24Z")

</div>

Hello,  
As the legacy video uploader [is not working](http://mapillary.trydiscourse.com/t/video-uploads-not-working/553/21) I’m trying to use mapillary\_tools to upload videos. I’ve downloaded the Windows executable mapillary\_tools.exe from GitHub and the checked out the sandbox. When I execute I get the next error. What am I missing?

Traceback (most recent call last):  
File “mapillary\_tools”, line 6, in   
from mapillary\_tools import commands  
File “c:\python37\lib\site-packages\PyInstaller\loader\pyimod03\_importers.py”, line 627, in exec\_module  
File “mapillary\_tools\__init_\_.py”, line 1, in   
ModuleNotFoundError: No module named ‘geo’  
[10600] Failed to execute script mapillary\_tools

---

<div class="post-metadata">

**Author:** ![mikelo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/mikelo/32/68228_2.png) [@mikelo](https://forum.mapillary.com/u/mikelo)\
**Post date:** [April 4, 2019, 2:45pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/2 "2019-04-04T14:45:23Z")

</div>

Ok, I’ve just seen that you need [Python 2.7.x](https://github.com/mapillary/mapillary_tools#custom-setup) installed and it doesn’t work with more recent versions (I was trying with 3.7.3).

But now I have another question.

When sampling a video --video\_sample\_interval defines how often get a picture, but, is there any way to **sample the video based on distance** instead of time? That’s how the legacy video uploader worked and I find it much more interesting for mapping cycling tracks.

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [April 4, 2019, 5:23pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/3 "2019-04-04T17:23:49Z")

</div>

No, it uses ffmpeg (sub-process) to decode, which is a time/frame based video processor. Once the jpeg frames exist they are geoencoded and can have duplicate flags set if less than a given distance exists. IME this works well in (say) stop start traffic.

---

<div class="post-metadata">

**Author:** ![mikelo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/mikelo/32/68228_2.png) [@mikelo](https://forum.mapillary.com/u/mikelo)\
**Post date:** [April 5, 2019, 1:29pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/4 "2019-04-05T13:29:48Z")

</div>

So I made mapillary\_tools work but now I have another problem. The tool extracts the images from the video correctly, but then it fails to geotag them.

```
E:\GoPro\2018-09-08\HERO4 Session 1>mapillary_tools video_process --video_import_path GP012756.MP4 --user_name mikelo --advanced --geotag_source gpx --geotag_source_path Move.gpx --use_gps_start_time --offset_time 2 --device_make GoPro --device_model Session4
Extracting video frames: 0%| | 0/1 [00:00<?, ?it/s]Video sampling path set to E:\GoPro\2018-09-08\HERO4 Session 1\mapillary_sampled_video_frames\GP012756
Traceback (most recent call last):
  File "mapillary_tools", line 76, in <module>
  File "mapillary_tools\commands\video_process.py", line 146, in run
  File "mapillary_tools\process_video.py", line 96, in sample_video
  File "mapillary_tools\process_video.py", line 140, in extract_frames
  File "mapillary_tools\process_video.py", line 214, in get_video_start_time
  File "mapillary_tools\process_video.py", line 158, in get_video_duration
IndexError: list index out of range
[45584] Failed to execute script mapillary_tools

```

I think the mapillary\_tools, at the current state, shouldn’t be recommended to the average user.

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [April 5, 2019, 6:28pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/5 "2019-04-05T18:28:24Z")

</div>

I remember seeing issues when I specified an actual file rather than a path spec for the gpx data. I also remember seeing a github enhancement to allow individual naming of mp4 etc files. ie the tools were written to parse entire directories, not individual files.

The help readme,md does say “path/to/xxx”, so maybe put the gpx file in a subfolder?

–geotag\_source\_path "E:\GoPro\2018-09-08\gpx\

I also tend to leave spaces out of path and file names as they can be seen as command or list delimiters if the script/command being run doesn’t allow for them.

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [April 5, 2019, 6:41pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/6 "2019-04-05T18:41:21Z")

</div>

I also note that the GoPro command line spec in the README.md says;

mapillary\_tools video\_process --import\_path “path/to/images” --video\_import\_path “path/to/videos” --user\_name “mapillary\_user” --advanced --geotag\_source “gopro\_videos” --geotag\_source\_path “path/to/videos” --interpolate\_directions --video\_sample\_interval 0.5 --overwrite\_EXIF\_gps\_tag

I guess reading the gps data from the actual video file? Sorry I dont know GoPro models and their capabilities.

---

<div class="post-metadata">

**Author:** ![mikelo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/mikelo/32/68228_2.png) [@mikelo](https://forum.mapillary.com/u/mikelo)\
**Post date:** [April 5, 2019, 10:01pm UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/7 "2019-04-05T22:01:54Z")

</div>

Hello Bob,  
I tried putting the files in a directory without spaces and writing the command with it’s path. I get exactly the same error (File “mapillary\_tools\process\_video.py”, line 158, in get\_video\_duration). The GoPro Session that I use doesn’t have a GPS, that’s why I have to geotag the photos with a gpx file.  
I guess the problem has something to do with ffmpeg. I checked manually that ffprobe extracts all the info from the video correctly, but the python script fails somehow (process\_video.py, line 158):

`return float(FFProbe(video_file).video[0].duration)`

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [April 6, 2019, 8:05am UTC](https://forum.mapillary.com/t/help-setting-up-mapillary-tools-on-windows/2756/8 "2019-04-06T08:05:24Z")

</div>

Doubt the following is helpful, but here is;

(I am using Linux)

My ffprobe -show\_streams gives maybe 50 lines to stderr and 102 lines to stdout. The duration line reads;

duration=60.092000

for one of my BlackVue vids

The ffprobe function seems quite simple. I wonder if the video filename (argument) is getting through okay?

Is --import\_path required?

After decoding the video to jpg’s it writes a single date/time entry to the EXIF. It does the geo-encode after that. Are you seeing the log directories created? Something like E:\GoPro\2018-09-08\HERO4 Session 1\mapillary\_sampled\_video\_frames\GP01275.mapillary\logs\ If so they may add to the debugging info. (.mapillary may have hidden attribute in Windows)

Cheers
