I basically want to press a button, that starts timecode at 30fps. (called every 1/30th of a second). I want the timecode to be referenced to the clock built in to the computer. I could easily get the current time in HH:mm:ss using NSDate, but I need the counter to start from zero and implement frames- formatted like HH:mm:ss:ff
Thoughts?
Use a
CVDisplayLinkto generate a pulse with the video card’s accuracy, this will be much more accurate than anNSTimeror a dispatch queue. CoreMedia/CoreVideo also talks SMPTE natively.EDIT: After playing with this a bit, I’ve noticed that the SMPTE fields from the displaylink aren’t getting filled out, but OTOH the host time is accurate. Just use:
to obtain the number of seconds uptime, and
to get the remainder.
Here’s as far as I got: