Skip to content

Tag: jpeg

Turning an Open CV frame into a Base64 encoded JPEG

I want to take a frame from an Open CV webcam stream, produce a JPEG thumbnail and then encode it as Base64 (It will then be sent as an MQTT message, but this is not the problem). My Python “sendimage” function is: It seems to work as far as the cv2.imencode, but the base64.b64encode fails with. E…