# \[Bug report\] Mapillary\_tools commit 1f9cfb6 cannot process GoPro videos

**URL:** <https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101>\
**Category:** Command line tools\
**Created:** [July 5, 2021, 4:23pm UTC](https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101 "2021-07-05T16:23:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macsico](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/macsico/32/69156_2.png) [@Macsico](https://forum.mapillary.com/u/Macsico)\
**Post date:** [July 5, 2021, 4:23pm UTC](https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101/1 "2021-07-05T16:23:21Z")

</div>

**Describe the problem you’re having:**

mapillary\_tools fail to process GoPro videos sucessfully and throws error message

**If possible include steps to reproduce the problem:**

- run mapillary\_tools to process multiple GoPro videos with GPS coordinates

**Expected behaviour:**

- program should create GPS data in EXIF section of each extracted JPEG file

**Observed behaviour:**

- with realease 0.7.2 an error message for each image file was given: “Warning, geotag process failed for image …”

- after updating to commit 1f9cfb6 the above mentioned warning disappeared and a bunch of multiple error was shown:

```auto
Running geotag_process for 2212 images, skipping 0 images.
Traceback (most recent call last):
  File "/usr/local/bin/mapillary_tools", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/ __main__.py", line 93, in main
    command.run(args)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/commands/video_process.py", line 416, in run
    process_geotag_properties(
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/process_geotag_properties.py", line 111, in process_geotag_properties
    geotag_properties = processing.geotag_from_gopro_video(
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/processing.py", line 215, in geotag_from_gopro_video
    gpx_path = gpx_from_gopro(gopro_video)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpx_from_gopro.py", line 73, in gpx_from_gopro
    gopro_data = get_points_from_gpmf(gopro_video)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpx_from_gopro.py", line 44, in get_points_from_gpmf
    gpmf_data = parse_bin(bin_path)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpmf.py", line 113, in parse_bin
    data: bytes = f.read(val_size)
ValueError: read length must be non-negative or -1

```

**Used hardware and software:**

- GoPro Hero 8 Black: capturing FullHD video (1920x1080)
- mapillary\_tools commit 1f9cfb6 running on macOS 10.14
- used command: `mapillary_tools video_process --import_path "IMAGE-PATH" --video_import_path "VIDEO-PATH" --user_name "macsico" --advanced --geotag_source "gopro_videos" --geotag_source_path "VIDEO-PATH" --interpolate_directions --video_sample_interval 1 --overwrite_EXIF_gps_tag`

**Please provide any additional information below:**

- EXIFTOOL was able to sucessfully extract GPS data from each of the affected MP4 video files into a GPX file. Therefore GPS data is definitely present in each file.

Thanks for your time and your support in advance.

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [July 5, 2021, 5:39pm UTC](https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101/2 "2021-07-05T17:39:37Z")

</div>

Hey @Macsico pushed a fix here [fix: unpack bytes at wrong location · mapillary/mapillary\_tools@2692b09 · GitHub](https://github.com/mapillary/mapillary_tools/commit/2692b09f530e8669672a955cd5dd860ccd8f8387)

Could you update tools with:

```auto
python3 -m pip install --upgrade --force-reinstall git+https://github.com/mapillary/mapillary_tools

```

and then retry again?

Thanks for reporting.

---

<div class="post-metadata">

**Author:** ![Macsico](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/macsico/32/69156_2.png) [@Macsico](https://forum.mapillary.com/u/Macsico)\
**Post date:** [July 5, 2021, 6:40pm UTC](https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101/3 "2021-07-05T18:40:30Z")

</div>

Hey @tao - thanks for the fresh commit.

MTools updated with your command, and retried processing. Sorry, failed again, but with different error message at the end:

```auto
Running geotag_process for 2212 images, skipping 0 images.
Traceback (most recent call last):
  File "/usr/local/bin/mapillary_tools", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/ __main__.py", line 93, in main
    command.run(args)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/commands/video_process.py", line 416, in run
    process_geotag_properties(
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/process_geotag_properties.py", line 111, in process_geotag_properties
    geotag_properties = processing.geotag_from_gopro_video(
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/processing.py", line 215, in geotag_from_gopro_video
    gpx_path = gpx_from_gopro(gopro_video)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpx_from_gopro.py", line 73, in gpx_from_gopro
    gopro_data = get_points_from_gpmf(gopro_video)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpx_from_gopro.py", line 44, in get_points_from_gpmf
    gpmf_data = parse_bin(bin_path)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpmf.py", line 116, in parse_bin
    methods[label](data, d, s)
  File "/usr/local/lib/python3.9/site-packages/mapillary_tools/gpmf.py", line 27, in parse_time
    datetime_object = datetime.datetime.strptime(str(toparse), "%y%m%d%H%M%S.%f")
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data "b'210704133929.450'" does not match format '%y%m%d%H%M%S.%f'

```

Thanks for dealing with the issue.

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [July 5, 2021, 8:34pm UTC](https://forum.mapillary.com/t/bug-report-mapillary-tools-commit-1f9cfb6-cannot-process-gopro-videos/5101/4 "2021-07-05T20:34:45Z")

</div>

Should be fixed. Let’s follow up here [Mapillary\_tools cannot process GoPro videos and throws errors · Issue #424 · mapillary/mapillary\_tools · GitHub](https://github.com/mapillary/mapillary_tools/issues/424)
