Commit f609ddba authored by grundman's avatar grundman

Fix incorrect FPS value returned by cap.get(CV_CAP_PROP_FPS)

Current implementation returns NaN for some configs of FFMPEG, call default get_fps() instead (as also used by PROP_POS_MSEC)
parent 6e2a68fd
......@@ -823,14 +823,7 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
case CV_FFMPEG_CAP_PROP_FRAME_HEIGHT:
return (double)frame.height;
case CV_FFMPEG_CAP_PROP_FPS:
#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54, 1, 0)
return av_q2d(video_st->avg_frame_rate);
#elif LIBAVCODEC_BUILD > 4753
return av_q2d(video_st->r_frame_rate);
#else
return (double)video_st->codec.frame_rate
/ (double)video_st->codec.frame_rate_base;
#endif
return get_fps();
case CV_FFMPEG_CAP_PROP_FOURCC:
#if LIBAVFORMAT_BUILD > 4628
return (double)video_st->codec->codec_tag;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment