[FFmpeg-user] Unable to Retrieve Frame Rate. it always zero.

whoami Jils get2jils at gmail.com
Fri Feb 14 10:14:15 CET 2014


I m trying to retrieve Frame rate in following manner.


        context = avformat_alloc_context();

        int err;
        err = avformat_open_input (&context, "<rtsp IP>", NULL, NULL);
        for (i = 0; i < context->nb_streams; i++)
        {
                codec =
avcodec_find_decoder(context->streams[i]->codec->codec_id);
                if (codec->type  == AVMEDIA_TYPE_VIDEO ) {
                        videoStreamIndex = i;
                        video_stream = context->streams[videoStreamIndex];
                      AVRational fr = av_guess_frame_rate(context,
video_stream, NULL);
                     LOGD(" Frame RAte = %d/%d ", fr.num, fr.den);

                }
        }




I am getting ways 0/0   printed. What am i doing wrong?


More information about the ffmpeg-user mailing list