ffmpeg-framecount.patch

Patch to repair FFMPEG frame counts via CV_CAP_PROP_FRAME_COUNT - Troy Sobotka, 2011-01-31 05:14 am

Download (620 Bytes)

 
opencv/modules/highgui/src/cap_ffmpeg.cpp (working copy)
648 648
        break;
649 649
	case CV_CAP_PROP_FRAME_COUNT:
650 650
	    if(video_st->duration != AV_NOPTS_VALUE_)
651
		    return (double)video_st->duration;
651
	        return (double)ceil(ic->duration * av_q2d(video_st->r_frame_rate) / AV_TIME_BASE);
652
		    //return (double)video_st->duration;
652 653
	    break;
653 654
    case CV_CAP_PROP_FRAME_WIDTH:
654 655
        return (double)frame.width;