ffmpeg getProperty CV_CAP_PROP_POS_MSEC incorrect + fix (Bug #91)
Description
in cvcap_ffmpeg line 622-625:
case CV_CAP_PROP_POS_MSEC:
if(video_st->cur_dts != AV_NOPTS_VALUE_)
return (((double)video_st->cur_dts-1) *1000) / av_q2d (video_st->r_frame_rate);
break;
should be:
case CV_CAP_PROP_POS_MSEC:
if(video_st->cur_dts != AV_NOPTS_VALUE_) {
return (((double)video_st->cur_dts-1) *1000.0f * av_q2d (video_st->time_base));
}
break;
i.e use ffmpeg time_base and not r_frame_rate as the base frame rate. applying this fix give the correct results for some file formats (such as flv) when before it did not
Associated revisions
Merge pull request #91 from taka-no-me/warnings/windows
Merge pull request #91 from apavlenko:adaptive_bilateral_filter
History
Updated by Anatoly Baksheev about 15 years ago
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-video