igrr / esp32-cam-demo

Demo for working with a camera on ESP32
Apache License 2.0
627 stars 243 forks source link

Base64 conversion of jpeg data #101

Closed dinosauria123 closed 6 years ago

dinosauria123 commented 6 years ago

Hi,

I try to make a IoT web camera, it posts jpeg data to Node-RED server. The camera module is M5Camera, it works fine using by this demo code.

I try to convert image data to Base64 but no success. I use mbedtls_base64_encode() .

mbedtls_base64_encode(b64data, sizeof(b64data)+1, &olen, camera_get_fb(), camera_get_data_size());

Please tell me how to get jpeg data from frame buffer.....

dinosauria123 commented 6 years ago

Finally I could run base64 encode.

unsigned char  image[2048];

 size_t olen;

 mbedtls_base64_encode(image, sizeof(image), &olen, camera_get_fb(), 1024);

Thank you.