bfeist / VideoQRAnalyser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automated Time Sync Detector

This app calculates the exact start time of a video file by searching it for QR code timestamps generated by CODA Clocksync and shown to the camera during recording. You can find CODA Clocksync here: https://apolloinrealtime.org/coda_clocksync/

This script uses Python multiprocessing to search the video. The main thread decodes the video with OpenCV and dispatches frames to worker processes that search for QR codes. The number of worker processes is determined by the number of CPUs detected by Python.

When the first QR code is detected, the script steps through the subsequent frames of video watching for when the seconds tick over and uses that point in the video to calculate the exact start time by taking the UTC encoded in the QR Code and subtracting the frame number where it was found divided by the video's framerate.

Setup

Tested on Python 3.9.5

Required pip packages:

Creating a Test Video

Record a short test video by filming someone holding up a device that is running the CODA Clocksync app: https://apolloinrealtime.org/coda_clocksync/

Running the Script

Open terminal in /scripts folder and run python decodeQRFromVideo.py [video_path]

Example: python decodeQRFromVideo.py ../vid/IMG_1722.MOV

About


Languages

Language:Python 100.0%