On Aug 1, 2008, at 11:40 AM, Colin Braley wrote:
>
> -Where is the current file position stored when FFMpeg is reading a  
> file?  I
> figure that if I can't get av_seek_frame(...) working well, I could  
> just
> index the file myself and get frame
> accurate seeking working in this manner.


The problem is that "generalized" calculation of a timestamp that can  
be passed to av_seek_frame() for frame accurate seeking is not  
possible. For some formats it will work, and for others it won't.  
Seems you've already figured this out.

I've built an index-based solution: See: 
http://lists.mplayerhq.hu/pipermail/libav-user/2008-July/001029.html

It uses time stamps as an index so you can use vanilla ffmpeg  
libraries and it will build a seek-table that contains the frame  
numbers of the keyframes and their time stamps. There are alot of  
gotchas in different formats with this approach. Too many to list  
here. I've tested it pretty extensively and it's not perfect but much  
more accurate than naive time stamp calculations.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to