# My new scripts to generate geotaged images from Viofo A129 DUO (and simillar) dashcam videos. 

**URL:** <https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462>\
**Category:** Contributing and equipment\
**Created:** [October 12, 2021, 8:14pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462 "2021-10-12T20:14:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [October 12, 2021, 8:14pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/1 "2021-10-12T20:14:28Z")

</div>

Hello all

I am using Mapillary as the mapping source in OpenStreetMap.  
I recently purchased a VIOFO A129 DUO dashcam and want to share the street level images generated from it.  
I tried several tools to convert MP4 video files from dashcam to geotagged images but no one was good for me so

I wrote my own scripts.

> **[GitHub - edc22osm/viofo2jpg: Python scripts to generate geotaged images from...](https://github.com/edc22osm/viofo2jpg)**
>
> Python scripts to generate geotaged images from Viofo A129 DUO (and simillar) dashcam videos. Images are ready to use at e.g Mapillary.com - GitHub - edc22osm/viofo2jpg: Python scripts to generate ...

Python scripts to generate geotaged images from Viofo A129 DUO (and simillar) dashcam videos. Images are ready to use at [Mapillary.com](http://Mapillary.com)

Main added features:

- support for dual cameras.  
Images generated by rear cam (\*R.MP4 files.) has bearing corrected by 180 degrees and moved 2 meters behind.  
It is useful at Mapillary app for separate two identical tracks (one from front and one from rear dashcam)  
(Remember to upload front and back series of images as separate Mapillary tracks.)

- Crop images options. This options are useful if you don’t want to share your sensitive data saved in the video by dashcam, or if your view is partially obscured.

- Images are generated every one second during video, but only if gps position is known.

Scripts published as open source, feel free to use and modify.

---

<div class="post-metadata">

**Author:** ![Establish7968](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Establish7968](https://forum.mapillary.com/u/Establish7968)\
**Post date:** [July 9, 2022, 12:26am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/2 "2022-07-09T00:26:04Z")

</div>

I tried running the script on Archlinux … then I realised it’s WinOS only (due to exiftool.exe).

---

<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:** [July 9, 2022, 3:41am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/3 "2022-07-09T03:41:17Z")

</div>

Regarding qscale:v in the ffmpeg subcommand.

I don’t know the default with the current ffmpeg, but -qscale:v 1 actually defaults to -qscale:v 2 for mp4\>jpg, unless one also adds -qmin 1 and possibly -qmax 1.

The net result is that the extracted jpg is a “lower quality” and thus could contain jpeg artefacts. This also affects filesize.

---

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [July 12, 2022, 8:42pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/4 "2022-07-12T20:42:55Z")

</div>

exiftool.exe for windows is included at my GitHub repository, but you can use your own exiftool (and ffmpeg) from your OS.  
Remove /exiftool/ directory and script will try use exiftool defined on system path  
Or use -de option (or -df for ffmpeg) to provide your directory with exiftool.  
I’ve tested it on Linux Mint and it worked.

---

<div class="post-metadata">

**Author:** ![RJ1002](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/rj1002/32/71731_2.png) [@RJ1002](https://forum.mapillary.com/u/RJ1002)\
**Post date:** [December 14, 2022, 6:37pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/5 "2022-12-14T18:37:22Z")

</div>

hello, I like the script but i was wondering is there way to manually set the distance between pic?

also, is there a way to add data so the “Captured with” section will have the type of camera im using instead of “none none”?

---

<div class="post-metadata">

**Author:** ![asturksever](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/asturksever/32/72007_2.png) [@asturksever](https://forum.mapillary.com/u/asturksever)\
**Post date:** [December 15, 2022, 4:15pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/6 "2022-12-15T16:15:23Z")

</div>

@mvexel has also OSM diary on how to upload Viofo A129 Dashcam Video to Mapillary.

[https://www.openstreetmap.org/user/mvexel/diary/400560](https://www.openstreetmap.org/user/mvexel/diary/400560)

---

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [December 16, 2022, 12:41am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/7 "2022-12-16T00:41:39Z")

</div>

> is there way to manually set the distance between pic  
> No, it’s not possible. GPS data are stored at video file every fixed amount of time (1 second) and script get images from this timestamps.  
> is there a way to add data so the “Captured with” section  
> Currently no, but it will be possible to add this feature, I’ll think about it.

---

<div class="post-metadata">

**Author:** ![RJ1002](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/rj1002/32/71731_2.png) [@RJ1002](https://forum.mapillary.com/u/RJ1002)\
**Post date:** [December 18, 2022, 4:37am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/8 "2022-12-18T04:37:16Z")

</div>

> No, it’s not possible. GPS data are stored at video file every fixed amount of time (1 second) and script get images from this timestamps.

sorry, let me rephrase my question. i’m talking about the script part that skips images that are too close to each other. the default is 5m i was wondering if i can change it to 2m or something similar.

also i notice an issue(just notice today). for some reason it skipping a gps position and now all the pictures is in the wrong position. idk why it unable to read that gps position when i use the script (i have -f in cmd so it should not skip any gps position). unless my dash cam recorded weird. it look like it combined 2 gps position into one pic which shifted all the gps position(it might have an extra gps position maybe?)

 ![gps position](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/3X/b/d/bd3dd4057e9f2288577db5526191259e5f110b91.jpeg)  
 ![pic position](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/3X/2/7/279609fb6f287ed7fd303c48565883e36447b0c2.jpeg)

update: i tried another file and it the same thing.  
i check files that i uploaded a month ago and they also are having that issue. so something is wrong. just not sure.

update2: it look like it normally the first .mp4 file they both have a duplicated gps position on pos 157 and 158 (pic with more details)

 ![Screenshot 2022-12-18 003251](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/3X/4/a/4aaedde71dce65185711c05cedc5d8fbe83fc9b6.jpeg)  
 ![Screenshot 2022-12-18 003421](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/3X/c/5/c5e1f30ab879203fbdb62eda0f05801ef55b13c4.jpeg)

---

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [December 19, 2022, 1:27am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/9 "2022-12-19T01:27:45Z")

</div>

> the default is 5m i was wondering if i can change it to 2m

Currently there is no option for this. But You can edit nvtk\_mp42gpx\_v2.py file at line 168 to set this distance to your preferred value.

> also i notice an issue

I don’t know what can be wrong now. Maybe it is some issue with other dashcam model or firmware version. I need your input files to analyse this cases.

---

<div class="post-metadata">

**Author:** ![RJ1002](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/rj1002/32/71731_2.png) [@RJ1002](https://forum.mapillary.com/u/RJ1002)\
**Post date:** [December 21, 2022, 6:52am UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/10 "2022-12-21T06:52:00Z")

</div>

> [@edc22](#):
>
> But You can edit nvtk\_mp42gpx\_v2.py file at line 168

thanks! I was trying to find it but I could not

> [@edc22](#):
>
> I need your input files to analyse this cases.

You want my mp4 files? I can DM them to you.

---

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [December 23, 2022, 11:06pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/11 "2022-12-23T23:06:03Z")

</div>

yes, i can try to analyze this problem but i must have your input mp4 video files

---

<div class="post-metadata">

**Author:** ![RJ1002](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/rj1002/32/71731_2.png) [@RJ1002](https://forum.mapillary.com/u/RJ1002)\
**Post date:** [January 5, 2023, 5:46pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/12 "2023-01-05T17:46:59Z")

</div>

Thanks for info. Maybe I will try that in the future but I’m to busy to mess with that stuff right now.

this script make it easier for me to upload pictures.

---

<div class="post-metadata">

**Author:** ![mvexel](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/mvexel/32/71750_2.png) [@mvexel](https://forum.mapillary.com/u/mvexel)\
**Post date:** [January 18, 2023, 3:14pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/13 "2023-01-18T15:14:35Z")

</div>

This is cool I was messing with this myself (see linked diary entry above) before I saw this work. I will have to compare the two approaches.

I have since converted my script to a Python script as well. It seems to work well enough, but doesn’t have as many flags 🙂

One issue I keep having is with discarding duplicates (images that are too close together while waiting for a light to change etc). The Mapillary tools settings here are a bit confusing. There’s another thread about this on the forum that dates back to October. It seems that you ran into similar problems?

I can share my latest script if there’s interest.

---

<div class="post-metadata">

**Author:** ![edc22](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@edc22](https://forum.mapillary.com/u/edc22)\
**Post date:** [January 18, 2023, 11:31pm UTC](https://forum.mapillary.com/t/my-new-scripts-to-generate-geotaged-images-from-viofo-a129-duo-and-simillar-dashcam-videos/5462/14 "2023-01-18T23:31:05Z")

</div>

In my case, scripts from [https://sergei.nz/](https://sergei.nz/) and [Dashcam OpenStreetMap mapping – (re)Tired Tech(ie)](https://retiredtechie.fitchfamily.org/2018/05/13/dashcam-openstreetmap-mapping/) was the best option to handle my Viofo video files.  
That scripts don’t use mapillary\_tools video\_process\_and\_upload but converts mp4 file to set of geotaged jpgs. So it was possible to add features like removing too close points or correct bearing for rear cam.  
Now I’m working on some improvements, check dashcam2josm\_v3.py on my [github](https://github.com/edc22osm/viofo2jpg)
