[Libav-user] Rewind file to start

wm4 nfxjfg at googlemail.com
Fri Aug 29 22:59:54 CEST 2014


On Fri, 29 Aug 2014 21:42:10 +0100
Lyndon Hill <emptystate-at-yahoo.co.uk at ffmpeg.org> wrote:

> J Decker d3ck0r at gmail.com  wrote:
> 
> > You also need to flush the codec contexts.
> > av_flush_buffer
> > http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/17549
> >
> > also you probably need SEEK_BACKWARD ... I found that seek( 0, SEEK_ANY )
> > would skip the first keyframe
> 
> 
> I tried changing to backward but the problem remains, HEVC bitstreams don't have timestamps; so default timestamp is AV_NOPTS_VALUE which on my system is negative - seeking to timestamp 0 takes you to the end of the file.
> 
> 
> > There is also av_seek_file()
> 
> Do you mean avformat_seek_file() ?
> It also uses timestamps and has a warning in the documentation to not use it.
> 
> 
> Sorry all if threading is broken; I have been browsing the archives rather than receiving the list and there is no option to receive only replies to your own posts. So I can't post this as a proper reply. I am now setting to receive the list when I post anything.
> 

For such files, doing byte based seeks is probably the only thing that
works.


More information about the Libav-user mailing list