Re: Videocapture in python
Can you post your code or a code segment? I would be interested in seeing how this works. On Thu, Jan 1, 2009 at 3:29 AM, koranth...@gmail.com wrote: I face issues in videocapture in python. Cant find anyplace where we can raise bug reports, so mentioning here. Also help required if somebody has solved it earlier. On using videocapture (python 2.4), I am facing the following issues while creating a video sort of application. - Pull out the usb cable : Videocapture gets the data stored initially in the buffer and returns always. The images are not updated - but also there is no error returned. i.e. there is no information to the viewer that it is not working anymore. Especially because since the timestamp is updated everytime (it is done inside videocapture.py - wherein current time is overwritten on the received image), it gives a feeling that video is running. Currently I have done a workaround in that every 2 captures, i setup the camera again - but it takes too much time. Anyone has any suggestions on solving this? -- http://mail.python.org/mailman/listinfo/python-list -- А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
On Jan 1, 1:58 pm, alex goretoy aleksandr.gore...@gmail.com wrote: Can you post your code or a code segment? I would be interested in seeing how this works. On Thu, Jan 1, 2009 at 3:29 AM, koranth...@gmail.com wrote: I face issues in videocapture in python. Cant find anyplace where we can raise bug reports, so mentioning here. Also help required if somebody has solved it earlier. On using videocapture (python 2.4), I am facing the following issues while creating a video sort of application. - Pull out the usb cable : Videocapture gets the data stored initially in the buffer and returns always. The images are not updated - but also there is no error returned. i.e. there is no information to the viewer that it is not working anymore. Especially because since the timestamp is updated everytime (it is done inside videocapture.py - wherein current time is overwritten on the received image), it gives a feeling that video is running. Currently I have done a workaround in that every 2 captures, i setup the camera again - but it takes too much time. Anyone has any suggestions on solving this? -- http://mail.python.org/mailman/listinfo/python-list -- А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я Since the code uses a lot of other variables - due to being a part of a larger project, I will try to provide pseudocode. At initialization: def setup_cam(): global cam, i cam = Device (devnum = 0) i = 0 def take_photo(obj): i += 1 if i 2: setup_cam() obj.img = cam.getImage(timestamp=3) I actually would like to have the code as try: obj.img = cam.getImage(timestamp=3) except CamException: setup_cam() But, since no exception is provided, I have to resort to the kludge shown. Please let me know if you need any more information. -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
On Thu, 01 Jan 2009 04:28:21 -0800, koranthala wrote: Please let me know if you need any more information. Where does `videocapture.py` coming from? It's not part of the standard library. And which operating system are we talking about? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
Marc 'BlackJack' Rintsch wrote: On Thu, 01 Jan 2009 04:28:21 -0800, koranthala wrote: Please let me know if you need any more information. Where does `videocapture.py` coming from? It's not part of the standard library. And which operating system are we talking about? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list Hope this is not off topic, I am new to python. I use linux and use the subprocess module, feel free to point out my noviceness; #!/usr/bin/python import subprocess def take_shot_func(): streamer = /usr/bin/streamer s_arg1 = -c s_device = /dev/video0 s_arg2 = -b s_rate = 16 s_arg3 = -o save_to = /tmp/camshot.jpeg print Taking picture with webcam and saved to /tmp/camshot.jpeg subprocess.call([streamer, s_arg1, s_device, s_arg2, s_rate, s_arg3, save_to]) def main(): take_shot_func() if __name__ == __main__: main() -- Powered by Gentoo GNU/LINUX http://www.linuxcrazy.com pgp.mit.edu -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
On Jan 1, 7:26 pm, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Thu, 01 Jan 2009 04:28:21 -0800, koranthala wrote: Please let me know if you need any more information. Where does `videocapture.py` coming from? It's not part of the standard library. And which operating system are we talking about? Ciao, Marc 'BlackJack' Rintsch Hi Marc, It is not part of standard library. Sorry for me being very brief earlier. It is taken from http://videocapture.sourceforge.net/, - a very good tool for webcam capture in Win32. Hi David, I am in Windows. And there is a possibility that I might be using device 0 or 1. So, I am using the excellent VideoCapture tool created by Markus Gritsch. -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
koranth...@gmail.com wrote: It is taken from http://videocapture.sourceforge.net/, - a very good tool for webcam capture in Win32. Hi David, I am in Windows. And there is a possibility that I might be using device 0 or 1. So, I am using the excellent VideoCapture tool created by Markus Gritsch. Does the capture software require 2.4? Given I actually would like to have the code as try: obj.img = cam.getImage(timestamp=3) except CamException: setup_cam() But, since no exception is provided, I do not think the tool is so excellent. It should either return a picture or raise and exception. Request that of the author. -- http://mail.python.org/mailman/listinfo/python-list
Re: Videocapture in python
koranth...@gmail.com wrote: On using videocapture (python 2.4), I am facing the following issues while creating a video sort of application. - Pull out the usb cable : Videocapture gets the data stored initially in the buffer and returns always. The images are not updated - but also there is no error returned. i.e. there is no information to the viewer that it is not working anymore. Especially because since the timestamp is updated everytime (it is done inside videocapture.py - wherein current time is overwritten on the received image), it gives a feeling that video is running. Currently I have done a workaround in that every 2 captures, i setup the camera again - but it takes too much time. Anyone has any suggestions on solving this? The right way to fix this is to modify the C++ code that sets up the DirectShow filter graph. The graph builder has the ability to deliver events asynchronously, like when the device goes away, but it would not be trivial to incorporate that into the module as written. -- Tim Roberts, t...@probo.com Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list
Videocapture in python
I face issues in videocapture in python. Cant find anyplace where we can raise bug reports, so mentioning here. Also help required if somebody has solved it earlier. On using videocapture (python 2.4), I am facing the following issues while creating a video sort of application. - Pull out the usb cable : Videocapture gets the data stored initially in the buffer and returns always. The images are not updated - but also there is no error returned. i.e. there is no information to the viewer that it is not working anymore. Especially because since the timestamp is updated everytime (it is done inside videocapture.py - wherein current time is overwritten on the received image), it gives a feeling that video is running. Currently I have done a workaround in that every 2 captures, i setup the camera again - but it takes too much time. Anyone has any suggestions on solving this? -- http://mail.python.org/mailman/listinfo/python-list