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

funta lkm9125 at gmail.com
Fri Feb 14 09:37:02 CET 2014


double fps = 0.0;
avformat_open_input(&in, infile, NULL, NULL);
avformat_find_stream_info(in, NULL);

for(i = 0; i < in->nb_streams; i++) {
   AVStream *input_stream = in->streams[i];
   if(input_stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
      fps = (double)input_stream->r_frame_rate.num /
input_stream->r_frame_rate.den;
      break;
   }
}

printf("FPS: %f\n", fps);



--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Unable-to-Retrieve-Frame-Rate-it-always-zero-tp4659250p4659251.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list