Skip to content

Commit 839792d

Browse files
committed
Remove duplicated /video/stream endpoint/function (concatenating instead of more yields). Remove basic root serving a page with video stream as background image
1 parent bb06894 commit 839792d

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

main.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,6 @@ def video_stream(a_cam):
187187
yield frame
188188
yield "\r\n"
189189

190-
@app.route("/video")
191-
def handle_video():
192-
return """
193-
<html>
194-
<head>
195-
<style type=text/css>
196-
body { background-image: url(/video/stream); background-repeat:no-repeat; background-position:center top; background-attachment:fixed; height:100% }
197-
</style>
198-
</head>
199-
<body>
200-
&nbsp;
201-
</body>
202-
</html>
203-
"""
204-
205190
@app.route("/video/stream")
206191
def handle_video_stream():
207192
try:
@@ -213,25 +198,6 @@ def handle_video_stream():
213198
except:
214199
pass
215200

216-
def video_stream_cv(a_cam):
217-
while not app.shutdown_requested:
218-
frame = a_cam.get_image_cv_jpeg()
219-
yield ("--BOUNDARYSTRING\r\n" +
220-
"Content-type: image/jpeg\r\n" +
221-
"Content-Length: " + str(len(frame)) + "\r\n\r\n" +
222-
frame + "\r\n")
223-
224-
@app.route("/video/stream/cv")
225-
def handle_video_stream_cv():
226-
try:
227-
h = Headers()
228-
h.add('Age', 0)
229-
h.add('Cache-Control', 'no-cache, private')
230-
h.add('Pragma', 'no-cache')
231-
return Response(video_stream_cv(cam), headers=h, mimetype="multipart/x-mixed-replace; boundary=--BOUNDARYSTRING")
232-
except:
233-
pass
234-
235201
@app.route("/photos", methods=["GET"])
236202
def handle_photos():
237203
logging.info("photos")

0 commit comments

Comments
 (0)