Ask Your Question

Blocking after call VideoCapture set CV_CAP_PROP_POS_MSEC

asked 2018-07-11 10:56:09 -0500

chuliqiang gravatar image

updated 2018-07-11 20:06:28 -0500

We use OpenCv to play a http url video.We use VideoCapture get a wrong frame number from video(possible my video format having problem). but when use VideoCapture set frame index for a wrong number. OpenCV will blocking. Please help me.

string m_strFilePath = szFilePath; //url;
double fTotalFrams = m_vidCapture.get(CV_CAP_PROP_FRAME_COUNT); //get wrong frame number
m_vidCapture.set(CV_CAP_PROP_POS_MSEC, nPosTime); // set wrong frame number rely on wrong total frames number,it will blocking for a long times
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-07-12 01:38:14 -0500

berak gravatar image

properties like CAP_PROP_FRAME_COUNT or CAP_PROP_POS_MSEC only make sense for video files , not for ip cams, where those are not supported at all (or report bogus values).

remove those lines from your code. you can't "seek" in an ip cam webstream.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-07-11 10:56:09 -0500

Seen: 18 times

Last updated: Jul 12