Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"resolution" and "framerate" parameters are ignored by VideoStream when using webcam source #55

Closed
xoxota99 opened this issue Mar 3, 2018 · 6 comments

Comments

@xoxota99
Copy link

xoxota99 commented Mar 3, 2018

According to https://github.com/jrosebr1/imutils/blob/master/imutils/video/videostream.py , the constructor arguments for resolution and fps are only used if the PI Camera is the source for the the videostream. Is this intentional?

@jrosebr1
Copy link
Contributor

jrosebr1 commented Mar 3, 2018

Yes. If you are using a cv2.VideoCapture then any properties would be need to be set via the .set method of the object.

@jrosebr1
Copy link
Contributor

jrosebr1 commented Mar 3, 2018

I'll add that a better implementation of VideoStream would accept a pre-initialized PiVideoStream and cv2.VideoCapture object. This would allow the user to add any customizations to the object that they see fit and then pass it into VideoStream to make it threaded.

However, this class must be kept backwards compatible as many other implementations rely on it, as do all (current) articles on the PyImageSearch blog.

Another option would be to have a stream parameter to the constructor which is a pre-instantiated PiVideoStream or WebcamVideoStream.

Checking the type of the src object would fix it, but the VideoStream class in particular would need an overhaul.

@xoxota99
Copy link
Author

xoxota99 commented Mar 3, 2018

Feature request, then? Or "Won't Fix"?

@jrosebr1
Copy link
Contributor

jrosebr1 commented Mar 4, 2018

It's a feature request but it needs to be carefully done to ensure backwards compatibility.

@Momilijaz96
Copy link

So in conclusion how can we achieve a faster frame rate with videostream?

@jrosebr1
Copy link
Contributor

@Momilijaz96 This PR, which I'll merge in next week, will allow for arbitrary cv2.VideoCapture parameters to be set within VideoStream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants