Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38873

Re: OpenCV and WIFI IP Camera Issue

Date 2013-02-14 18:12 +0000
From MRAB <python@mrabarnett.plus.com>
Subject Re: OpenCV and WIFI IP Camera Issue
References <66afe6f9-c89f-4944-8102-57bae76c358d@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1773.1360865533.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 2013-02-14 17:25, Sam Berry wrote:
> Hey,
>
> Iv installed OpenCV on my windows machine. I can successfully view the
 > camera stream from my laptop so the installation was successful.
 > However when i edited the code adding in the address of my IP camera
 > like so....
>
> import cv2
>
> cv2.namedWindow("preview")
> vc = cv2.VideoCapture('http://192.168.1.72:1025/videostream.cgiUSERNAMEANDPASSWORD')
>
> if vc.isOpened(): # try to get the first frame
>      rval, frame = vc.read()
> else:
>      rval = False
>
> while rval:
>      cv2.imshow("preview", frame)
>      rval, frame = vc.read()
>      key = cv2.waitKey(20)
>      if key == 27: # exit on ESC
>          break
>
> When run, python tries to open the window to display the camera feed
 > then closes  before displaying the feed. Anyone have any ideas why? I
> read somewhere that there is an issue with this been run on windows?
>
> Any insight would be appreciated! Im all googled out.
>
I wonder whether you should be waiting for the key and _then_ reading
the next frame.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

OpenCV and WIFI IP Camera Issue Sam Berry <sambez_14@hotmail.co.uk> - 2013-02-14 09:25 -0800
  Re: OpenCV and WIFI IP Camera Issue MRAB <python@mrabarnett.plus.com> - 2013-02-14 18:12 +0000

csiph-web