n3wtron/simple_mjpeg_streamer_http_server

Strict Compliance to MIME multi-part content

tom131313 opened this issue · 0 comments

Need CRLF surrounding the boundary:

self.wfile.write("\r\n--jpgboundary\r\n")

The end boundary marker at the end of a MIME part has to have two dashes in front of the boundary that was specified in the Content-Type so remove the extraneous dashes in Content-Type (or add two more dashes when writing the boundary in the message).

self.send_header('Content-type','multipart/x-mixed-replace; boundary=jpgboundary')

Now the message is much closer to the standard and should work on most or all browsers.

For no dependencies using only Python 3 and openCV 3 (but unfortunately also includes simplified logic with the HTML section removed and with example drawing commands and some other camera hints added) look at my posting in the associated Gist https://gist.github.com/n3wtron/4624820

Another handy list when setting the camera properties is all the openCV properties. Print everything or limit your lists of the openCV goodies.

import cv2
events = [i for i in dir(cv2) if 'PROP' in i]
print(events)
events = [i for i in dir(cv2) if 'EVENT' in i]
print(events)
events = [i for i in dir(cv2)]
print(events)