Closed AndreySibiryakov closed 4 months ago
Some thoughts to your detailed description (thanks):
You start the Arduino before the cameras. So there will be trigger pulses all the time. As you start the cameras sequentially, the first camera might already have one or two frames captured.
Recommendation is to activate the cameras first then send serial command to Arduino to start the trigger.
You don't release the grab results, this will leave you without buffers after a while.
The CV.waitkey should be after releasing the buffers so you fully service the grab engine as fast as possible.
The crystal on your Arduino is possibly way more off than your prosumer recording equipment. https://jorisvr.nl/article/arduino-frequency#:~:text=Frequency%20stability&text=The%20crystal%20is%20quite%20stable,resonator%20is%20much%20more%20variable.
To debug, you can record the timestamps of the images grab1.TimeStamp and compare the diff of last and first timestamp to the time of your prosumer time
Thank you for the help, Thies!
Describe what you want to implement and what the issue & the steps to reproduce it are:
Two cameras are triggered by an Arduino pulse and are perfectly synchronized with each other. Video is recorded at 30fps. Audio is also recorded, and I'm clapping my hands to check for sync drift later. I've recorded several 60-second clips with clapping at the beginning and end. In Adobe Premiere, the audio and video clips are visually synced by the claps at the beginning, but the claps at the end can be 1-2 frames off. Audio is recorded on a prosumer recorder, so there should be no issues there. Please help me find the cause of the sync issue. The code for Arduino and Python is provided below.
Is your camera operational in Basler pylon viewer on your platform
Yes
Hardware setup & camera model(s) used
cameras: Basler daA1920-160uc connection: 1.5m usb cables system: Windows 10 cpu: i5 10400f gpu: 1080 ssd: Samsung 980
Runtime information: