Does the Mapillary Uploader supports HEVC videos?

Quick question, to know if I can disable the H.264 recording on my GoPro

Edit: Another quick question, in these settings on GoPro cams, what are the best when shotting photos/videos for Mapillary?
Sharpness : High, Medium, Low
Color: Native, GoPro
White balance: Native, Auto

1 Like

@nikola do you know this?

BR, Yaro

I’m not sure, I think @tao will know more about our video support.

1 Like

I’d suggest you stay with H.264. H.265/HEVC is a better CODEC only in the video sense. There is more interframe distortion evident when the videos are converted to images. ie the end images β€œlook gluggy” similar to the degradation one gets from lowering JPG quality.

Having said that I did trial ffmpeg on both H.264 and H.265 BlackVue vids a few years ago. H.265 worked fine, but it used far more processing time (like >5x) to extract to the final JPGs. ffmpeg is used by the mapillary_tools CLI and I assume also by the Desktop Uploader so I suggest it would work.

Yes, HEVC videos should work I believe. Try uploading them using the desktop uploader beta and let us know if you have any problems: https://forum.mapillary.com/t/try-new-video-format-support-exiftool-in-the-the-desktop-uploader-beta/

In terms of the other settings, I would leave them at the defaults, but we haven’t done extensive testing to see if they make a difference (my hunch is that the difference would be minor).

What about HEIC compressed images, my uplink is slow

I’m not sure those will work, but try uploading one and let us know what happens!

I’m guessing this would need support server side if only to convert them to jpeg.

I’ve been doing a little testing this afternoon and found out the following:

4MB JPEG converts to a 1.2MB HEIC with no visible loss of quality or extra jpeg like artifacts.

4075924 VID_20230731_150718_00_011_normal-000001.jpg
1153213 test.heic
I used the following command, which seems to copy all the exit info too:
heif-enc -q 35 VID_20230731_150718_00_011_normal-000001.jpg -o test.heic

Cool, thanks for sharing! Did you also try uploading these to Mapillary?

# mapillary_tools process_and_upload tmp/
Extracting geotags from images: 0images [00:00, ?images/s]
Extracting GPS tracks from videos: 0videos [00:00, ?videos/s]
Verifying image EXIF writing: 0images [00:00, ?images/s]
2023-08-02 19:49:18,941 - INFO    - Nothing uploaded. Bye.

I was hoping for a simple change to look for .heic files, but altering utils.py
./lib/python3.9/dist-packages/mapillary_tools/utils.py: return path.suffix.lower() in (β€œ.jpg”, β€œ.jpeg”, β€œ.tif”, β€œ.tiff”, β€œ.pgm”, β€œ.pnm”, β€œ.heic”, β€œ.heif”)

I get the following:

# mapillary_tools process_and_upload tmp/
Extracting geotags from images:   0%|                                                                                                                                                                              | 0/1 [00:00<?, ?images/s]2023-08-02 20:25:41,117 - WARNING - Unknown error reading EXIF from image tmp/VID_20230731_150718_00_011_normal-000001.heic
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/mapillary_tools/geotag/geotag_from_exif.py", line 32, in to_description
    exif = ExifRead(image_path)
  File "/usr/local/lib/python3.9/dist-packages/mapillary_tools/exif_read.py", line 123, in __init__
    self.tags = exifread.process_file(fp, details=details, debug=True)
  File "/usr/lib/python3/dist-packages/exifread/__init__.py", line 242, in process_file
    offset, endian = heic.find_exif()
  File "/usr/lib/python3/dist-packages/exifread/heic.py", line 255, in find_exif
    assert self.get(exif_tiff_header_offset)[-6:] == b'Exif\x00\x00'
AssertionError
Extracting geotags from images: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 950.01images/s]
Extracting GPS tracks from videos: 0videos [00:00, ?videos/s]
Verifying image EXIF writing: 0images [00:00, ?images/s]
2023-08-02 20:25:41,120 - INFO    -        1 image(s) read in total
2023-08-02 20:25:41,120 - ERROR   - 	        1 image(s) failed due to AssertionError
2023-08-02 20:25:41,120 - ERROR   - MapillaryProcessError: Failed to process 1 files. To skip these errors, specify --skip_process_errors

Got it, thanks for testing! We can look at adding HEIC support as a backlog item (particularly if more cameras/devices start using it)

Isn’t it the default for iPhones since iOS 11?

Yes, I think that’s right. I’m mostly referring to action cameras, 360 cameras, dash-cameras because we don’t receive many images from iPhone’s native camera - almost all iPhone images come from the Mapillary iOS app.

HEVC should be supported.

The image format HEIC is not supported yet. To upload HEIC photos, you can always export images as JPEGs or try some external tool converting them to JPEGs first.

I do upload JPEGs but HEIC would be nice because the compression would make for faster uploads, as I wrote above my uplink is slow

That’s good to know. Do you have the comparison between the two formats?

Scroll up, I posted a 360 JPEG and converted it to HEIC and it went from 4MB to 1.2MB with no noticeable loss of quality or JPEG like artifacts…