How can I seek to frame No. X with ffmpeg?
I'm writing a video editor , and I need to seek to exact frame, knowing the frame number . Other posts on stackoverflow told me that ffmpeg may give me a few broken frames after seeking, which is not a problem for playback but a big problem for video editors. And I need to seek by frame number , not by time, which will become inaccurate when converted to frame number. I've read dranger's tuts (which is outdated now), and end up with: av_seek_frame(fmt_ctx, video_stream_id, frame, AVSEEK_FLAG_ANY); It always seek to frame No. 0 , and always return 0 which means success. Then I tried to read