I am trying to write a C ++ program that will read keyframes from a video file using ffmpeg. So far, I managed to get all the frames using av_read_framewhere you sequentially read frame by frame.
But I have some problems with use av_seek_frame, which (if I'm right) was supposed to do the trick for keyframes.
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags);
I have FormatContext, but what other valid arguments only all keyframes consistently receive?
Is there any other function that I can use?
thank
EDIT: In av_read_frameI get an AVPacket that I can use to get the frame data, but how can I get the packet using av_seek_frame?
SOLUTION: OK in AVFrame-> key_frame is a simple boolean. True if its keyframe
kirbo source
share