0

I am currently attempting to develop a player that can perform accurate seeking based on an mpeg4 elementary video stream. I'm in the planning stage and trying to decide how to go about things and I'd like some advice before I start. Some things to note are:

  • I will have complete control over the encoding of the file.
  • The original content will be I-frame only
  • FFmpeg is the encoding/decoding library
  • Audio can be disregarded for now. I will only be dealing with the video stream.
  • Frame accurate seeking must be implemented

So, when I'm encoding the content, can I query what type of frame (I, P, B) has been encoded so I can construct an additional index stream for the seeking operation. If not, I can query the GOP after it has been encoded to find the I-frame.

As for playback, the user needs to be able to type in a specific time and go to that frame (the nearest I-frame will be suitable for now). We can assume that the GOP is closed and the length is fairly short (e.g. 15 frames). My thoughts are to query the index stream that I created during encode and determine the relevant distance into the stream for the requested time.

I'm not sure how to seek using the FFMpeg library when playing back files.

Has anyone done anything similar and if so, can you give a brief explanation of how you did it?

Sonoman
  • 3,379
  • 9
  • 45
  • 61
  • Have you been able to do this? Or you need answers to some questions still? – av501 Aug 28 '12 at 16:08
  • Yes we have been able to create an additional index containing the relevant data. But further input for the sake of discussion is always welcome. – Sonoman Sep 10 '12 at 09:39
  • Could you give some details about your implementation? I too need seeking, and already for MJPG it is *very* hacky, especially because the frame number ffmpeg says it just decoded is often way off by several frames. – Simon A. Eugster Dec 21 '13 at 13:05

0 Answers0