Good afternoon,

After days of searching and trying, I still have a problem:

When I use avformat_seek_file() to go back to the very beginning of a file
and then av_read_frame(), I still don't get the first frames again.

The goal is to extract multiple chunks of audio from a stream.
My approach is to read the stream, discard what I don't need. While doing
that I create a list of "points of interest" where I need to go back later.

My intermediate approach is to always go back to the beginning and start
discarding again.
What I am doing exactly is:


//read frames, discard what's not needed:
while(...) av_read_frame(...)

//go back to the beginning (that's the part that doesn't work):
avcodec_flush_buffers(avcc); //flush the codec's buffers
avformat_seek_file(
        avf, streamIndex,
        bytepos, bytepos, bytepos,      
        AVSEEK_FLAG_BYTE
); //bytepos is packet.pos of the first packet I have read
   //and will later be a position from the index that I will build

As it doesn't work as expected, I obviously am missing something vital. But
I can't find out what. Can somebody give a hint?

Thanks and best regards
Benjamin
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to