Viofo A119 V3 / Blueskysea B4K and Mapillary

Regarding the wifi - this script handles any files it has access to. So it can be integrated into workflow with some other script downloading the videos onto local device.

If the camera runs some kind of a server (FTP, SMB etc), it is possible to automate the downloading.

Did some tests today and on first sight it works as intended!
Below is one example - road where I have made 2 stops on the traffic lights

Time-sampling: 1 sec interval

Distance-sampling: 10m

Distance-sampling: 15m

Coordinates interpolation seems to be working very well.

In the latest version of the script Tanel has added image crop and image mask support and it works like a charm!
--mask #masking image, must be same dimensionally as video, mask area is black 0,0,0
--crop_left #number of pixels to crop from left
--crop_right #number of pixels to crop from right
--crop_top #number of pixels to crop from top
--crop_bottom #number of pixels to crop from bottom

Hello, thank you for developing this tool, it looks very useful! So I just got a Viofo A129 Pro Duo and had a few questions.

  1. What operating system i need to use for this tool? I have Windows 10 and Linux Mint installed.

  2. Should I enable time-lapse in my camera or is MP4 fine?

script development credits should be going to @jorrarro :clap:

Answering your questions:

  1. Any system which is capable of running Python. Both Linux and Windows will work
  2. Video. Script will do the rest

However, couple of important notes:

  • Different dashcams models may (and in many cases will) have different GPS data storage formats
  • script is based on Novatek 9666x specs and works great with Viofo A119 V3 dashcam with .TS recording format enabled.
  • MP4 is also supported (tested with A119 V3) - there is one minor change required to the script to make it work (see here)

A129 Duo Pro is based on Novatek 96685
Does it support saving video files in TS format? If yes, you could test it with TS file and see if it works (if not, please share a raw recording in PM, so I can have a look).
If only MP4 format is supported - please send me in private message a raw recording sample with GPS enabled (upload it to google drive) - I will check if the script will be able to handle it and will adjust if needed.

1 Like

just did a quick test with MP4 files produced by A129 Pro and A129 Plus (running on FW from 2020) - both work fine with the script after this adjustment

TS files should be processed fine out of the box, but let me know if not.

Script pre-requisites:

  • python installed
  • install additional libraries not included in default python installation:
    pip install opencv-python
    pip install exif

So I tried entering those two commands into Python and got these syntax errors. What did I do wrong?

Hi Larry

pip runs from the command prompt.

@gpsmapper can you link to a sequence? I would be interested to see the quality if it’s taken from video (with compression) rather than timelapse.

I tried running those two commands in the Admin Command Prompt but get the following errors.

I have tried, but sequence got stuck in the queue and and after 1 week of waiting I have deleted it.
But here you go:
raw video
processed sequence

it’s strange, pip should be installed automatically with python 3.9
maybe some path variables were not updated, please try re-installing python with Admin rights and reboot after installation.
If path variables are properly set, you should be able to call python anywhere from command prompt:

I’ll try rebooting but first, should I click this button? It popped up after installation.

Path length limit

yes, it’s safe and better to do so

nope, if path variable are properly set, it would not matter,

Let’s go to PM for further troubleshooting

1 Like

Hi both @gpsmapper @jorrarro I just had the chance to use your script and wanted to say thank you, it’s fantastic.

I will probably set up on Heroku or similar so my colleagues can just upload their videos and see them turn up on Mapillary.

Actually it does not quite work for me - I’m using MP4s and it seems not to extract the correct amount & with sufficient EXIF. I did see on your notes currently only TS is supported though.

Hi Tom,
please try this one
It’s a modified version I am currently using (works well for both Novatek/Viofo MP4s and TS). Latest code on github may not work properly.

UPDATE: @jorrarro has updated the code on github already, but it 's still not working well
https://github.com/taneljairus/random-mapillary-stuff/issues/6
Feel free to use my modded version for now.

In regards to script performance: on my PC 1 min video with 1 sec sampling interval takes ~30sec for processing on average (with image crop enabled).
But this is totally acceptable while it does everything in one shot and saves you a lot of time anyway.

mapilary_tools can do the video sampling and EXIF processing noticeably faster, but MT workflow requires a lot of manual/side tasks to do on top (extract GPS data with external script, synchronize GPS data with the sampled images, interpolation, enable proper stitching, do the crop, etc.)
And some of the functions like distance-based sampling are unique to the script from Tanel

BTW, here is the uploaded sequence sample (camera mounted on the back)
https://www.mapillary.com/map/im/ahNoIThYZGMRHOG8HiNIw0

  • processed with the modded script (--sampling_interval 1 --timeshift 0.5 --crop_bottom 50 --bearing_modifier 180)
  • processed with mapillary_tools (process -advanced --import_path "FOLDER" --user_name "USERNAME" --duplicate_distance 2 --interpolate_directions --offset_angle 180 --overwrite_EXIF_direction_tag)
  • uploaded with mapillary_tools (upload --import_path "FOLDER")

interpolate directions is required to fix direction angle, while it’s not always captured correctly by Viofo
offset_angle - tells to reverse angle 180 grad (applicable for the back camera only)

Hi, this is great script :slight_smile: But I have problem with setting folder as input source under Linux. I tried to use ‘*.MP4’ or inserting full path to folder with videos, but I only get “No input file found”

Second problem is that I use command:
python3 ts_processor2.py --input ‘*.MP4’ --sampling_interval 0.5 --timeshift 0.5 --folder output

And from file recorded with 60fps and timelapse set to 500miliseconds i got 53 images… Videoplayer says that movie is 27 seconds long.

What I`m doing wrong?

it would be much easier to answer if you could share your video sample (upload to google drive or similar)
But if you video length is 27 sec and sampling interval is 0.5 sec, you should normally expect 53/54 samples

re input - I am not using linux, but I guess script author (@jorrarro) does, maybe he will be able to clarify how input folder should be specified on linux.

In Linux, paths should be without quotes. For current folder, like this:

python3 ts_processor2.py --input . --sampling_interval 0.5 --timeshift 0.5 --folder output

For full path like this:

python3 ts_processor2.py --input /home/mapillary/videos --sampling_interval 0.5 --timeshift 0.5 --folder output