Custom file importer has inaccurate seeking frame index?
Hi all, I have developed a file importer for my own. With this plugin, Premire can recogize my file extension without error and it can import my files as expected.
But I noticed that the seeking frame index get from callback function SDKGetSourceVideo is not accurate sometimes. For example:
static
prMALError
SDKGetSourceVideo(
imStdParms *stdparms,
imFileRef fileRef,
imSourceVideoRec *sourceVideoRec)
{
int ret;
ImporterLocalRec8H ldataH = reinterpret_cast<ImporterLocalRec8H>(sourceVideoRec->inPrivateData);
ImporterLocalRec8Ptr localRecP = reinterpret_cast<ImporterLocalRec8Ptr>(*ldataH);
// Get parameters for ReadFrameToBuffer()
imFrameFormat* frameFormat = &sourceVideoRec->inFrameFormats[0];
prRect theRect;
// Windows and MacOS have different definitions of Rects, so use the cross-platform prSetRect
prSetRect(&theRect, 0, 0, frameFormat->inFrameWidth, frameFormat->inFrameHeight);
localRecP->PPixCreatorSuite->CreatePPix(sourceVideoRec->outFrame, PrPPixBufferAccess_ReadWrite, frameFormat->inPixelFormat, &theRect);
csSDK_int32 theFrame = static_cast<csSDK_int32>(sourceVideoRec->inFrameTime / (*ldataH)->theFile.frameRate);
...
}
The variable theFrame is the frame index with which Premiere get video frame from us. But the index is sometimes inaccurate. According to my log, it skipped some frames when playing:

We can see that the frame index is not continuous and it is even random sometimes. I don't know why. The file is kind of timelapse video with MJPEG format.
Can anybody give some advice? Thank you in advance.