Skip to content

Commit

Permalink
Fix incorrect FPS value returned by cap.get(CV_CAP_PROP_FPS)
Browse files Browse the repository at this point in the history
Current implementation returns NaN for some configs of FFMPEG, call default get_fps() instead (as also used by PROP_POS_MSEC)
  • Loading branch information
grundman committed Oct 31, 2015
1 parent 6e2a68f commit f609ddb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions modules/videoio/src/cap_ffmpeg_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f609ddb

Please sign in to comment.