Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9249433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:11:15+00:00 2026-06-18T10:11:15+00:00

I basically want to press a button, that starts timecode at 30fps. (called every

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:11:16+00:00Added an answer on June 18, 2026 at 10:11 am

    Use a CVDisplayLink to generate a pulse with the video card’s accuracy, this will be much more accurate than an NSTimer or a dispatch queue. CoreMedia/CoreVideo also talks SMPTE natively.

    CVReturn MyDisplayCallback(CVDisplayLinkRef displayLink,
      const CVTimeStamp *inNow,
      const CVTimeStamp *inOutputTime,
      CVOptionFlags flagsIn,
      CVOptionFlags *flagsOut,
      void *displayLinkContext) {
    
        CVSMPTETime timecodeNow = inNow->smpteTime; // it's that easy!
    
        DoStuffWith(timecodeNow); // you might have to modulo this run a bit if the display framerate is greater than 30fps.
    
        return kCVReturnSuccess;
    }
    
    CVDisplayLinkRef _link;
    CVDisplayLinkCreateWithCGDisplay(CGMainDisplayID(),&_link);
    CVDisplayLinkSetOutputCallback(_link, MyDisplayCallback, NULL);
    CVDisplayLinkStart(_link);
    

    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:

    inNow->videoTime / inNow->videoTimeScale;
    

    to obtain the number of seconds uptime, and

    inNow->videTime % inNow->videoTimeScale
    

    to get the remainder.

    Here’s as far as I got:

    @implementation JHDLTAppDelegate
    
    CVReturn MYCGCallback(CVDisplayLinkRef displayLink,
                          const CVTimeStamp *inNow,
                          const CVTimeStamp *inOutputTime,
                          CVOptionFlags flagsIn,
                          CVOptionFlags *flagsOut,
                          void *displayLinkContext) {
    
    
        dispatch_async(dispatch_get_main_queue(), ^{
    
            JHDLTAppDelegate *obj = (__bridge JHDLTAppDelegate *)displayLinkContext;
    
            uint64_t seconds = inNow->videoTime / inNow->videoTimeScale;
               [obj.outputView setStringValue:[NSString stringWithFormat:@"days: %llu/hours: %llu/seconds: %llu (%llu:%u)",
                                              seconds / (3600 * 24),
                                               seconds / 3600,
                                               seconds,
                                              inNow->videoTime, inNow->videoTimeScale]];
    
    
        });
    
        return kCVReturnSuccess;
    }
    
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    {
        CVDisplayLinkCreateWithCGDisplay(CGMainDisplayID(), &_ref);
        CVDisplayLinkSetOutputCallback(_ref, MYCGCallback, (__bridge void *)self);
        CVDisplayLinkStart(_ref);
    }
    
    - (void)dealloc
    {
        CVDisplayLinkStop(_ref);
        CVDisplayLinkRelease(_ref);
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically want something like: TextView Button Button . . . TextView TextView SeekBar
I basically want to open a browser window from Word using VBA that does
hi im creating a app that generates random text when i press a button
Ok. so basically i have a div that i want to load it with
Basically I want to create 48 button outlets. I have created the buttons in
I basically want to setup a relationship similar to Netflix's DVD rental model. There
I basically want to do: git checkout branchA git checkout -b branchB <commit_id> which
I basically want the same functionality as facebook, twitter and all those other infinite
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I basically want to be able to deploy multiple versions of the same EAR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.