Hi,

Well.. guess i found the problem (at least it solved my problem)..

I was missing the call for this function: av_find_stream_info(pFormatCtx)

So inserting it after the av_open_input_file, it shows all the info
for the video file..

My code is like this now:

    AVFormatContext *pFormatCtx;

    for(int j=0; j < listaDeVideos.size(); j++){
        // Open video file
        if(av_open_input_file(&pFormatCtx, ((QString)
listaDeVideos.at(j)).toLocal8Bit(), NULL, 0, NULL)!=0)
          qDebug()<< "Couldn't open file";
        int i;

        //get the stream
        if(av_find_stream_info(pFormatCtx)<0)    //Here I get some
errors like: max_analyze_duration_reached
        {
            qDebug() << "cant initialize the Stream";
        }

        dump_format(pFormatCtx, 0, ((QString)
listaDeVideos.at(j)).toLocal8Bit(), 0);

        // Find the first video stream
        int videoStream=-1;
        for(i=0; i<pFormatCtx->nb_streams; i++)
          if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) {
            videoStream=i;
            break;
          }

        if(videoStream==-1)
            qDebug() <<  "Didn't find a video stream";
        else
            qDebug() << pFormatCtx->streams[videoStream]->duration;


Thanks for the help..

On Tue, Feb 1, 2011 at 2:17 PM, Leonardo Farage Freitas
<[email protected]> wrote:
> Thanks for your reply.
>
> But, how do I set this values?
>
> Thanks
>
> On Mon, Jan 31, 2011 at 6:49 PM, Erik Van Grunderbeeck <[email protected]> 
> wrote:
>>
>>>Input #0, mpeg, from '5_vide_a_gente_apresenta.mpg':
>>>  Duration: N/A
>>>N/A, bitrate:
>>>, bitrate: N/A
>>>N/A
>>
>> Try to set your context probesize and/or max_analyze_duration higher.
>>
>> erik
>>
>> _______________________________________________
>> libav-user mailing list
>> [email protected]
>> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>>
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to