Suggestions for hacks to get a frame_sync signal out of the camera? (a 7D)

Started by howiem, November 02, 2015, 11:09:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

howiem

I've built a motion control rig - steppers / servos / arduino controlling the focus, etc - and I need to find a way to sync its motion with my 7D. My motors are all driven with Teensy microcontrollers, and the whole rig is controlled by a Mac.

I can start my rig moving at any time I like (accurate to +/- 1 millisecond). But at 25 fps, frames are captured 40ms apart, and that means my rig's motion and the camera's frame capture can be out of sync by up to 20ms each way. I don't care how many whole-frames' delay there is between them (that's just editing), but I need their sub-frame timing to be as in sync as possible, so I can lay multiple takes over each other and be confident they'll line up perfectly. So I need some sort of signal or cue to let me know where in the frame capture "loop" the camera is, so I can start my rig moving at the right time. The signal doesn't need to be accurate, but it needs to be consistent, so if I turn off the camera to change the battery, when I turn it back on I need to know I can sync things up again.

I'm not going to try doing a full-on genlock kinda thing; I just want to be able to reset all my microcontrollers' timing loops at the beginning of a recording and know that they'll be in sync relative to the camera's frame capture.

So how can I find out what the camera's timebase is doing?

Is the A/V output's refresh rate likely to be consist in phase with the frame capture, or is there buffering going on that may introduce an unknown and variable delay?

Are there any cheeky Magic Lantern features that would reveal the timing to me more simply? (eg can ML output a tone or click or bleep at the start of recording?)

Is the LCD refreshed in sync with the camera's timebase? That is, could I just use a photo-transistor to watch for an LCD refresh (and then mebbe flash a light in front of the lens to give it a nice strong transition to sync to)?

Any thoughts welcome :)

a1ex

This sounds similar: http://www.magiclantern.fm/forum/index.php?topic=8912

You could try to blink either the card LED or the LCD backlight LED from a vsync hook (in a ML module) - that way, the timing will be in sync with the captured image. You can do that for the first recorded frame (and if that is not enough, this method will let you do a full genlock as well).

If you sync before pressing record, it probably won't be consistent (just a wild guess - because there is a delay on the LCD image, I guess the frame timing changes as well). To be sure recording actually started, you might have to wait a few frames after RECORDING becomes true (again, not tested).

Here's how to control the LCD backlight quickly (in real-time). Changing the backlight via properties is slower, since it's done in a different task.

howiem

Thanks for the tips a1ex. I'll log it as a feature request for now, but if I have time, I'll learn how to compile ML and have a go myself.

Might have a look at the composite video coming out of the A/V port and see if the syncs seem to line up reliably with the frame capture - it'd be nice to have a solution that'd work with any of the cameras (ie even if not, heaven forfend, running ML)

:)