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

Termination of Python when not able to find video device #13

Open
ebaumer opened this issue Jan 28, 2015 · 2 comments
Open

Termination of Python when not able to find video device #13

ebaumer opened this issue Jan 28, 2015 · 2 comments

Comments

@ebaumer
Copy link

ebaumer commented Jan 28, 2015

Dear Gerbart,

Thank you for the awesome python wrapper for v4l2!!!

I running into an issue when v4l2capture can not find a device at the specified path. I have a try/catch statement surrounding the opening of the video device in case the user specifies an incorrect path:

import v4l2capture as vc
try:
    self.cam = vc.Video_device(self.cnfg['devLoc'])       
except:
    ...

As one might expect, for an incorrect path an IOError is returned:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/dev/video5/'

However, unexpectedly, python is immediately terminated as well, whether it be a program or python interactive shell. Is there a way to handle this such that the python shell or program is not immediately terminated?

Thanks!!

@jnohlgard
Copy link
Owner

Sorry, I have no time to work on this project for now. I have not seen the problem you describe, but I have not tried to use it like that either. Is the Python interpreter killed with a segfault or is it a normal exit?

I would also like to clarify that I did not originally create this library, I only added it to my GitHub because I wanted to make some changes to the upstream code which has been abandoned for some time: https://launchpad.net/python-v4l2-capture
The project was originally written by Fredrik Portström (I do not know him, only know his name from the homepage)

@jcoffland
Copy link

@ebaumer I don't know if you are still interested in this but I've created a pull request which fixes this problem.

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