New ESP32-CAM module

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Thu Jan 03, 2019 5:04 pm

Right now I don't plan to change format dynamically.

This seems to not return proper jpeg data

Code: Select all

size_t dsize = camera_get_data_size();
uint8_t *data = camera_get_fb();
I define following format:

Code: Select all

#define CAMERA_PIXEL_FORMAT CAMERA_PF_JPEG
#define CAMERA_FRAME_SIZE CAMERA_FS_QVGA
So all is initializing fine and camera seems running ok but jpeg frames are not being recognized as images
I am getting invalid format errors or format not supported.
Not sure what kind of compression it is - rgb565 to jpeg? or full rgb888?

Im guessing it is 16bit color space

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: New ESP32-CAM module

Postby chegewara » Thu Jan 03, 2019 11:40 pm

I dont know how to convert raw jpeg from camera to jpg file, but what i did was to send base64 raw jpeg to aws and store in jpg file on S3. Then file looks like normal jpg image.

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Fri Jan 04, 2019 2:35 am

I kindof figured out the stream has no jfif header.
The browser automatically appends that header based on simple content-disposition and size information
Now I have to do the same manually.
I checked jpeg stream files with JPEG Snoop tool https://www.impulseadventure.com/photo/ ... ?ver=1.7.3
I guess jpegs need standard header with IDCT and Q-table.
But I would assume there must be a way during camera init to pull that information from the device itself.
I wonder if anyone tried that. I was able to capture JPEG 320-x240 frame in 10ms - it is rgb565 compressed

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Sun Jan 06, 2019 4:38 pm

Small update: I was able to successfully capture image/video on PC from esp-cam board )
I changed the external clock frequency value which was 20Mhz by default.
With default value that module is not quite stable or needs some tweaking - I do not know.
However when I set between 10Mhz-16Mhz - it seems quite stable and can transfer 320x240 jpegs with no problem
Haven't tried other formats but I may check my other cam m5stack esp board and esp-eye maybe
I will post code soon - I changed menuconfog a little and it is all CMake.

CalinB
Posts: 15
Joined: Tue May 08, 2018 4:20 pm

Re: New ESP32-CAM module

Postby CalinB » Sun Jan 06, 2019 9:09 pm

I just made a project that include a esp32 camera webcam (m5stack camera) and a reciever: m5stack or any other esp32 based device with LCD.
Here it is: https://github.com/botofancalin/ESP32_Camera_System.git
Is based on espressif camera library. I adapted the camera component to be used as a library on PlatformIO
The 2 projects from that repository: camera sender and camera revciever, can be compiled using PlatformIO.
You just need to adapt the camera data pins for your camera model.

The camera can be accessed from web browser too and can set various settings on it:
esp32_camera_stream.png
esp32_camera_stream.png (243.78 KiB) Viewed 16372 times

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Mon Jan 07, 2019 1:09 pm

CalinB wrote:
Sun Jan 06, 2019 9:09 pm
I just made a project that include a esp32 camera webcam (m5stack camera) and a reciever: m5stack or any other esp32 based device with LCD.
....
Wow. Nice. Have you managed to capture full VGA 640x480 format ?
I would like to know the camera settings for it. Did you use JPEG or BMP (RGB565 etc)
I use Windows app and it works blasting fast - no browser needed

CalinB
Posts: 15
Joined: Tue May 08, 2018 4:20 pm

Re: New ESP32-CAM module

Postby CalinB » Mon Jan 07, 2019 3:11 pm

Deouss wrote:
Mon Jan 07, 2019 1:09 pm
Wow. Nice. Have you managed to capture full VGA 640x480 format ?
I would like to know the camera settings for it. Did you use JPEG or BMP (RGB565 etc)
I use Windows app and it works blasting fast - no browser needed

Yes. Even SVGA 800x600 if i lower the quality. (the higher number indicate the lower quality)
I think it can do even better with some tweaking... even if my camera module don't have PSRAM :)

I use JPEG format. The camera settings are the ones you can see on the image. I use OV2640 camera.

As browser, i tried Chrome, Firefox and Opera and it work just fine on all of them.
For some reason it don't work on Microsoft Edge browser...
What windows app are you talking about?

You can access the stream directly: 192.168.4.1:81/stream
Or you can get the independent frames by accessing 192.168.4.1/capture

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Mon Jan 07, 2019 5:46 pm

I am using same camera and this code:
https://github.com/donny681/ESP32_CAMERA_QR

I removed all references to http and qr recognition - just reading frames and get "frame buffer allocation failed"

I think I am using older idf though

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: New ESP32-CAM module

Postby Deouss » Mon Jan 07, 2019 10:08 pm

After some tests I discovered some instability related to powering this board.
It was triggering brownout detection until I changed to pure power source instead of ttl usb to serial adapter supplying power.
Apparently it needs some more current for camera and wifi. I am not sure what pin is good to supply power to the board.
I used 5V but maybe 3.3v directly is better. I will try that. Also I am getting quite deformed jpeg images at the end.
Will do more testing...

CalinB
Posts: 15
Joined: Tue May 08, 2018 4:20 pm

Re: New ESP32-CAM module

Postby CalinB » Mon Jan 07, 2019 10:40 pm

Deouss wrote:
Mon Jan 07, 2019 5:46 pm
I am using same camera and this code:
https://github.com/donny681/ESP32_CAMERA_QR

I removed all references to http and qr recognition - just reading frames and get "frame buffer allocation failed"

I think I am using older idf though

Oh.. so you prefer the idf version?
Try this one: https://github.com/botofancalin/esp32_idf_camera_app
Is much better than the version you try to use.
I toke the example from esp-who and made it a standalone project.

Stream is activated by default on http://192.168.4.1:81/stream

Who is online

Users browsing this forum: No registered users and 30 guests