# Borked westbound Garmin Virb image directions

**URL:** <https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531>\
**Category:** Action cameras\
**Created:** [February 21, 2018, 9:13pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531 "2018-02-21T21:13:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hjart](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@Hjart](https://forum.mapillary.com/u/Hjart)\
**Post date:** [February 21, 2018, 9:13pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/1 "2018-02-21T21:13:29Z")

</div>

I often use the [JOSM Photogeotagging Plugin](https://wiki.openstreetmap.org/wiki/JOSM/Plugins/Photo_Geotagging) to check/correct sequences taken with my Garmin Virb elite.

Doing so I have noticed that the directions of all images taken while moving east (1-180°) are calculated correctly by the Virb, while all images taken while moving west (180-360°) are borked in some weird way that by the plugin is always shown as 90° left to the actual direction of travel.

![HojrupBuen1](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/2X/3/30f3d5f5737ec6b5e17267007ef9c467fa5fcbfb.jpg)  
Travelling slightly SE

![HojrupBuen2](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/2X/d/d6077b10c8c5afb6b35ca588ed32cf1866ec8d13.png)  
Travelling slightly SW

Now I’d like to know how to compute the correct direction from this. Is it possible?

---

<div class="post-metadata">

**Author:** ![tryl](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/tryl/32/62_2.png) [@tryl](https://forum.mapillary.com/u/tryl)\
**Post date:** [February 22, 2018, 1:39pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/2 "2018-02-22T13:39:34Z")

</div>

In [https://github.com/mapillary/mapillary\_tools/tree/master/python](https://github.com/mapillary/mapillary_tools/tree/master/python) there is a script which will write a direction based on your tracel direction. You can also tell it that the camera did not point forward and it will correct for that.

There is no tool to just adjust the direction - I don’t know if it is possible with exiftool.

If you would like to run the script and needs help, we have the thread [Page not found](http://mapillary.trydiscourse.com/t/running-the-python-scripts/130) for that.

---

<div class="post-metadata">

**Author:** ![Hjart](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@Hjart](https://forum.mapillary.com/u/Hjart)\
**Post date:** [February 22, 2018, 1:54pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/3 "2018-02-22T13:54:01Z")

</div>

What I would like to know is how to fix just the images where the direction is broken, based on the information that is obviously there.

---

<div class="post-metadata">

**Author:** ![Gness](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Gness](https://forum.mapillary.com/u/Gness)\
**Post date:** [February 22, 2018, 9:42pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/4 "2018-02-22T21:42:59Z")

</div>

What I think is happening is:  
4294967295 Is the maximum number an unsigned integer can show. It cannot store negative numbers. Maybe the Virb records the compass heading as +/-180 from the zero degree mark (probably north).  
As the plugin can’t handle a negative value, it wraps around, giving you your weird value.  
If there’s a way to change the settings to make the heading absolute, rather than relative to north, it might fix it. I don’t have a Virb to advise further though.  
A bit of maths could modify the exif files potentially, too. E.g. subtract 4294966935 (this is 4294967295 -360) and it will give you the correct heading.

It could possibly also be fixed in the plugin. If you have access to the code, or a similar setting is available.

---

<div class="post-metadata">

**Author:** ![allen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/allen/32/137_2.png) [@allen](https://forum.mapillary.com/u/allen)\
**Post date:** [February 28, 2018, 12:25am UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/5 "2018-02-28T00:25:32Z")

</div>

@hjart, I have a couple Garmin elites. sometimes they just get the direction wrong. Others are in the side window of the car. I just go into the mapillary map after uploading them and change the sequence direction. Give me a holler if it would help for me to share an example with screen shots.

---

<div class="post-metadata">

**Author:** ![Hjart](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@Hjart](https://forum.mapillary.com/u/Hjart)\
**Post date:** [March 7, 2018, 8:38pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/6 "2018-03-07T20:38:35Z")

</div>

I’ve played a bit with exiftool now and found that the commandline

`exiftool -GPSimgdirection -if '$GPSImgDirection > 360' *.JPG`

will find the images on the Virb which has broken values.

Now I just need to figure out how to subtract 4294966935 from GPSImgDirection in that commandline and write it to the images.

For your info the following is what Exiftool reports on one imagefile from the Virb:  
 ![VirbImagedirection](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/2X/7/77bc0ba2ec037699ff7993feb58b5beab0c3cdac.png)

Note that the problem is in the Virb image, not the JOSM plugin (which unlike i.e. the Mapillary website just happens to make some sense from the value).

Also note that my Virb is usually firmly mounted on my bicycle handlebar (when I’m not using it like an ordinary camera) and always pointing straight forward and that it doesn’t “just sometimes get the direction wrong”. It’s always when it’s pointing west.

**Update:**

I had tried to use decrement, but without any luck.

After reading [http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4462.0.html](http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4462.0.html) though, I realize that increment is what i need to use:

`exiftool -GPSimgdirection+=-4294966935 -if '$GPSImgDirection > 360' *.JPG`

This commandline succesfully finds and fixes Virb images with broken GPSImgDirection values.

Maybe the Mapillary website could include this?

---

<div class="post-metadata">

**Author:** ![cookry](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/cookry/32/1046_2.png) [@cookry](https://forum.mapillary.com/u/cookry)\
**Post date:** [March 9, 2018, 11:41pm UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/7 "2018-03-09T23:41:46Z")

</div>

@Hjart thanks for your research notes regarding the metadata format from the Garmin Virb Elite model and EXIF format.

To improve reliability, the camera offset direction can be set using our [open-source Command Line Tools](https://github.com/mapillary/mapillary_tools/tree/master/python) on Github.

While using `upload_with_preprocessing.py` you would adjust the numeric value after the flag `--offset_angle 0`. Use together with `--interpolate_directions`. See the parser argument descriptions here:  
[https://github.com/mapillary/mapillary\_tools/blob/master/python/upload\_with\_preprocessing.py](https://github.com/mapillary/mapillary_tools/blob/master/python/upload_with_preprocessing.py).

Set 90 for right facing, 180 for rear facing, -90 for left facing.

As a workflow tip, when you are transferring files from your camera to your computer, create a new directory for each offset angle.

---

<div class="post-metadata">

**Author:** ![Hjart](https://avatars.discourse-cdn.com/v4/letter/h/ac8455/32.png) [@Hjart](https://forum.mapillary.com/u/Hjart)\
**Post date:** [March 10, 2018, 10:03am UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/8 "2018-03-10T10:03:20Z")

</div>

Thank you. The Garmin Virb Elite is quite reliable though (except for the small bug described above) and none of those tools will improve on it’s reliability.

Note that the device calculates image directions from the direction it’s moving and that I consider those slightly more reliable than interpolated directions calculated later by scripts etc

---

<div class="post-metadata">

**Author:** ![RynHong](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@RynHong](https://forum.mapillary.com/u/RynHong)\
**Post date:** [May 31, 2026, 6:45am UTC](https://forum.mapillary.com/t/borked-westbound-garmin-virb-image-directions/1531/9 "2026-05-31T06:45:51Z")

</div>

Dealing with inverted or offset heading data in EXIF logs is always a headache, especially when you have to run manual scripts just to flip the sequence directions back to normal. It’s wild how easily a camera’s internal sensor or a specific mounting angle can throw the entire track off by exactly 90 or 180 degrees.

Whenever I’m setting up a dashcam sequence or trying to figure out if my mounting array is causing an orientation conflict with the GPS log, I use [https://123compass.org/](https://123compass.org/) on my phone for a quick baseline check. It runs a minimal, browser-based compass with calibration options, which is super handy for verifying the vehicle’s true heading relative to the camera mount before you start shooting. Definitely saves some time troubleshooting metadata errors after the fact!
