Updating VideoStream to cv2, refactoring and added codec kwarg
- Removing code lines commented out
- Updated VideoStream to use newer cv2
VideoWriter,cv.createVideoStreamis considered legacy. - Calculating
frametimeonce in the constructor, this value doesn't change. This way extra calculations are avoided. - Added a
codecparameter, so thatcodeccan be set from the outside and setting default to a newer codec likexvid.iyuvdoesn't work in many operating systems and it uses a lot of space for a video file.
To be honest, I know these might be many changes to go in a single commit in a single PR, sorry about that. In reality, these are quite minor changes.
iyuv creates huge video files, that's why I changed it to a newer codec and I've made possible to change it.
I believe the explanation of framefill is a little hard to follow. My first PR actually had a wrong misunderstanding of how it works. I've forced pushed a new commit (removing some changes, updating the description of this PR) that were hiding framefill away.
When framefill is set to True, the video output will be realtime, in the sense that it will be the same speed as the processing of video has been, not that the video will go at the same speed of the real life time, not sure if I explain myself. I actually would expect False to be the default.
If there is anything you want to discuss, let me know.
Cheers, Miguel