[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 
seeking. 
The first time you wish to seek, the library creates an index.

Beni

-- 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


Hi

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?

-mika 		 	   		  
_______________________________________________
Libav-user mailing list
Libav-
user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user





More information about the Libav-user mailing list