Streaming images with HttpResponse?

2013-11-15 Thread Alex Karargyris
I have this simple app that I opens webcam and processes the frames using OpenCV. In my views.py I have the following code: def processImage(): while True: rval, frame = settings.CAP.read() //Read frames from webcam gray = cv2.cvtColor(frame, cv2.COLOR_BGR2G

Re: Streaming images with HttpResponse?

2013-11-18 Thread Alex Karargyris
x={"src": "%s/image.jpeg" % (settings.MEDIA_URL), "alt": "Video Frame"} yield "" % x yield "\n" def camera(request): resp = StreamingHttpResponse(stream_response_generator()) return resp On Friday, November 15, 2

Re: Streaming images with HttpResponse?

2013-11-18 Thread Alex Karargyris
saves and the html is refreshed every 0.01 secs. This does not seem to be an elegant solution because a) there is latency and b) the browser keeps reloading constantly. Some of you suggested websockets. Is there some good example for Django + Websockets for streaming images to the browser? Than