[Libav-user] Unable to Retrieve Frame Rate. it always zero.
Keestu Pillo
get2jils at gmail.com
Fri Feb 14 07:35:43 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140214/cb6fc3f7/attachment.html>
More information about the Libav-user
mailing list