I will appreciate your advice on the following. I'am developing a video converter which based on FFmpeg's libavformat, and I need to implement an accurate seeking API. First of all, I developed an indexer of video stream which just saves a presentation timestamps(PTS) of every packet. And then my encoder uses this index to seek the video file. Before this operations, I remux file to mp4 container, for example. Remux is needed for videos which have no correct index inside, or video has no index at all. I need to implement seeking by bytes, of course with previously built index. I tried many ways to implement this, but without any success. Maybe you know how to implement an accurate seeking by bytes in FFmpeg? Best regards.
Asked
Active
Viewed 2,371 times
4
-
1There seems to be some updates on this, http://stackoverflow.com/questions/3032929/problem-ffmpeg-seeking-with-av-seek-frame-using-byte-positions. – Baris Demiray Jul 27 '15 at 15:17
1 Answers
1
Yury! You must seek until you meet the correct frame in the GOP area in where is destination frame. Before that you have to decode two both GOP in where are first frame and last frame of segment and save their positions. This position values will use finding your correct frames.
I've found that matters in two years ago. If you don't have correct understood, I'll give you new algorithm. Best regards.

Aleksa Misovic
- 26
- 7
-
I am not following, why are we getting a first and last frame of a segment? – NiteRain Nov 12 '20 at 20:17
-
If you seek B frame or P frame, seek method may out put I frame related B(P) frame. – Aleksa Misovic Nov 18 '20 at 15:34