I'm trying to seek to a byte offset in an MP4 file.  I can't use 
avformat_seek_file() because the AVFMT_NO_BYTE_SEEK flag is set in the demuxer.

I'm reading the first 150 frames in the file, then seeking to a known file 
location.  I've been able to use avio_seek to set the m_pFormatCtx->pb->pos 
value to the correct offset, but the next call to av_read_frame() puts it right 
back to where it was, such that the next frame read is #151.  The seek code is:

                     int64_t filePos = m_posData.GetFrameOffset(frameNum);
                     int64_t ret = avio_seek(m_pFormatCtx->pb, filePos, 
SEEK_SET);
                     avformat_flush(m_pFormatCtx);
                     avcodec_flush_buffers(m_pVideoCodecCtx);
                     avcodec_flush_buffers(m_pAudioCodecCtx);

Is there something else that needs to be called to actually clear up the 
internal buffers so that av_read_frame will start at the correct location?

Thanks,
Blake


Blake Williams
Principal Software Engineer, Training and Control Systems
DRS Technologies, Inc.

[Final-New-DRS-Color.png]

645 Anchors Street
Fort Walton Beach, Florida 32548
Tel: 850.302-3281
 [email protected]<mailto:[email protected]>  || 
www.drs.com<http://www.drs.com/>

This communication is intended only for use by the addressee(s) named herein 
and may contain business proprietary and/or legally privileged information. If 
you are not the intended recipient of this e-mail, you are hereby notified that 
any dissemination, distribution, disclosure or copying of this e-mail and its 
contents is strictly prohibited. If you have received this e-mail in error, 
kindly notify the sender by replying to this message. In addition, please 
permanently delete the message and any attachments without copying or 
disclosing the contents. Thank you for your cooperation.

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to