def find_camera_model()

in mapillary_tools/geotag/geotag_from_blackvue.py [0:0]


def find_camera_model(video_path: str) -> T.Optional[bytes]:
    with open(video_path, "rb") as fd:
        fd.seek(0, io.SEEK_END)
        eof = fd.tell()
        fd.seek(0)
        while fd.tell() < eof:
            try:
                box = Box.parse_stream(fd)
            except Exception as ex:
                return None
            if box.type.decode("utf-8") == "free":
                return T.cast(bytes, box.data[29:39])
        return None