[Libav-user] av_open_input_file takes a while

Beni Weine onlineweinies at bluewin.ch
Mon May 7 14:20:41 CEST 2012

Flag AVFMT_FLAG_IGNIDX might help. 
We're using it with one of the latest libav (similar to ffmpeg) builds.
I don't 
know if the flag works with ffmpeg.

In our case we are having fragmented video files, which do not contain any hint 
data at all. 
This makes the av_open_input_file (or avformat_open_input as it called now) a lenghty procedure as well. 

But watchout: Fast load can lead to a (first time) slow seek. 
Based on my experience, an index is required for 
The first time you wish to seek, the library creates an index.


-- code --

   if( mIsFastload )

      mFormatContext = avformat_alloc_context();
      mFormatContext->flags |= AVFMT_FLAG_IGNIDX;

avformat_open_input( &mFormatContext, mFilePath.toStdString().c_str(), NULL, NULL )

----Ursprüngliche Nachricht----

Von: mika_rajala_2 at hotmail.com
Datum: 03.05.2012 11:22
An: <libav-user at ffmpeg.org>
Betreff: [Libav-user] 
av_open_input_file takes a while


I'm using the method avformat_open_input to load a ~2GB h264 encoded video file.

int err = avformat_open_input(&m_formatContext, path, NULL, NULL);

This takes a bit too long however, is there any 
way to make it faster?

Libav-user mailing list
user at ffmpeg.org

More information about the Libav-user mailing list