Copy of https://github.com/opendatacam/opendatacam/issues/410
Copy of opendatacam/opendatacam#410