Fixes for MJPEG video format. Should help with video on iPhone. re: #242
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 29 Jan 2020 21:42:11 +0000 (13:42 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 29 Jan 2020 21:42:11 +0000 (13:42 -0800)
CHANGELOG.md
src/py/bbctrl/Camera.py

index d52449773339dec393a3a641c965e75c5cf40c27..2cc78dead4ac52678060373be1719e96048f5e1b 100644 (file)
@@ -5,6 +5,7 @@ Buildbotics CNC Controller Firmware Changelog
  - Support for OMRON MX2 VFD.
  - Better error handling in WiFi configuration.
  - Fix open WiFi access.
+ - Fixes for MJPEG video format.  Should help with video on iPhone.
 
 ## v0.4.12
  - Segments straddle arc in linearization.
index 385c3810b108ee22e1dbd4f5d090d0c7a440091f..31a2b14009075961681718b0fdf1591ae65d1c54 100755 (executable)
@@ -65,10 +65,10 @@ def string_to_fourcc(s): return v4l2.v4l2_fourcc(s[0], s[1], s[2], s[3])
 
 
 def format_frame(frame):
-    frame = [
+    frame = [b'--', VideoHandler.boundary.encode('utf8'), b'\r\n',
         b'Content-type: image/jpeg\r\n',
         b'Content-length: ', str(len(frame)).encode('utf8'), b'\r\n\r\n',
-        frame, VideoHandler.boundary.encode('utf8'), b'\n']
+        frame, b'\r\n\r\n']
 
     return b''.join(frame)
 
@@ -445,7 +445,7 @@ class Camera(object):
 
 
 class VideoHandler(web.RequestHandler):
-    boundary = '---boundary---'
+    boundary = 'f36a3a39e5c955484390e0e3a6b031d145ec893ae98489416d11409bc478e38'
 
 
     def __init__(self, app, request, **kwargs):