4/17/2017

video show and write keeping original fps


When the video write, we can set parameter in following function..

outVideo.open(".\\outVideo.avi", askFileTypeBox, capture.get(CV_CAP_PROP_FPS), S, Color);

And we can control play speed by waitKey.

double fps = capture.get(CV_CAP_PROP_FPS);
delay Per Second = 1/fps
in milliseconds = 1/fps * 1000

so we delay, waitKey( 1/fps * 1000 )

by the way, it is not exact fps. because it is delayed including other processing in the loop.
for example, data copy, sobel, imshow ...

< gist code >

< /gist code >




#tags

CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, VideoCapture, VideoWriter, waitKey

No comments:

Post a Comment