Assuming the video track has track number 0 (use FFMS_GetFirstIndexedTrackOfType if unsure), that you have indexed the file and have the index object handy (if you have already opened the video, just use FFMS_GetTrackFromVideo instead of FFMS_GetTrackFromIndex):
Code:
FFMS_Track *track = FFMS_GetTrackFromIndex(index, 0);
const FFMS_TrackTimeBase *timebase = FFMS_GetTimeBase(track);
const FFMS_FrameInfo *current_frame;
std::vector<int> timecodes;
int num_frames = FFMS_GetNumFrames(track);
for (int i = 0; i < num_frames; i++) {
current_frame = FFMS_GetFrameInfo(track, i);
if (current_frame->KeyFrame) {
// true if frame is a keyframe.
// do something?
}
int timestamp = (int)((current_frame->PTS * timebase->Num) / timebase->Den); // wallclock milliseconds
timecodes.push_back(timestamp);
}
Naturally you should always check the return value of all functions against NULL to see if they failed. I skipped that here, for brevity. Note that FFMS_GetNumFrames will return 0 for an unindexed track. That should probably never happen with a video track, but I'm just sayin'.
Of course you can use any data structure of your liking to store the list of integer timestamps, I just used a std::vector for this example. You could also store the timestamps as floats or doubles if you wanted to.