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

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.

Python scripts to generate geotaged images from Viofo A129 DUO (and simillar) dashcam videos. Images are ready to use at 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.

7 Likes

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

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.

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.

2 Likes

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”?

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

https://www.openstreetmap.org/user/mvexel/diary/400560

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.

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?)


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)


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.

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

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

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

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.

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 :slight_smile:

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.

In my case, scripts from https://sergei.nz/ and Dashcam OpenStreetMap mapping – (re)Tired Tech(ie) 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

1 Like