• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Still image importer - how to figure frame rate

New Here ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

Hi, I am developing still image importer and I am confused how to compute frame number in asynchronous aiInitiateAsyncRead method. Theoretically, it should be something like imSourceVideoRec.inFrameTime / ticksPerFrame.  I can use GetTicksPerVideoFrame() to figure out ticks count per some specific framerate, but how do I figure out which framerate is used?   (users can change framerate that is used in "settings - media - indeterminate media timebase" and I don't want to provide incorrect frames...)

Is this information provided somewhere along lifycycle of importer and I just didn't noticed it? Or am I using completely wrong approach?

TOPICS
SDK

Views

541

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 25, 2016 Feb 25, 2016

Copy link to clipboard

Copied

Hi Michal,

Rather than frame number, you receive a request for a frame time: imSourceVideoRec->inFrameTime

From there, you can calculate the frame number by framerate that you calculate and save in local data.  For example, in SDK_Async_Import.cpp:

csSDK_int32   theFrame = static_cast<csSDK_int32>(inSourceRec.inFrameTime / (*localRecH)->theFile.frameRate);

One thing I will mention is that internally, all of our still importers use the synchronous model.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2016 Feb 26, 2016

Copy link to clipboard

Copied

LATEST

I forgot to explain that I am importing sequence of files, standalone images. There is no wrapper or metainformation that specifies frame rate of those files. As far as I can tell, imSourceVideoRec->inFrameTime is dependent on whatever user selected in "settings - media - indeterminate media timebase" . For example, if setting is 29.97 fps then second frame has inFrameTime 8475667200, but if setting is 30 fps, then second frame has inFrameTime 8467200000. So to correctly compute frame number I need to know what setting is used. And I weren't able to find it in any structure passed to me in any selector.

thanks for your time

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines