ESP32-CAM format

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
chuck8530
Posts: 94
Joined: Sun Nov 21, 2021 2:45 am

ESP32-CAM format

Post by chuck8530 »

I've gotten a ESP32-CAM working - displays on Firefox and VLC but not in ZM. I think the problem is the incoming data:
^M
--123456789000ccc000000987654321^M
Content-Type: image/jpeg^M
Content-Length: 123200^M
^M
ÿØÿà^@^PJFIF^@^A^A^A^@^@^@^@^@^@ÿÛ^@C^@
^G^H ^H^F
^H ^K^K
^L^O^Y^P^O^N^N^O^_^V^W^R^Y$ &&$ #"(-:1(+6+"#2D36;=@A@'0GLF?K:?@>ÿÛ^@C^A^K^K^K^O^M^O^]^P^P^]>)#)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ÿÄ^@^_^@^@^A^E^A^A^A^A^A^A^@^@^@^@^@^@^@^@^A^B^C^D^E^F^G^H
^KÿÄ^@µ^P^@^B^A^C^C^B^D^C^E^E^D^D^@^@^A}^A^B^C^@^D^Q^E^R!1A^F^SQa^G"q^T2<81><91>¡^H#B±Á^URÑð$3br<82>
^V^W^X^Y^Z%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz<83><84><85><86><87><88><89><8a><92><93><94><95><96><97><98><99><9a>¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚ...

I've tried every combination I can think of to add it - no joy. Suggestions?
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: ESP32-CAM format

Post by mikb »

chuck8530 wrote: Wed May 11, 2022 8:38 pm
--123456789000ccc000000987654321^M
Content-Type: image/jpeg^M

JFIF
Looks like a MIME attachment of a JPEG (JFIF is the first 4 characters of a JPEG image).

Reminiscent of the data served up by "/video.cgi" on my DCS900 D-link Cameras, which claims to be MJPEG -- it's a really odd way of encoding an MJPEG. FFMPEG will accept it [edit: Oops. See Follow Up], if told format is "mjpeg" ... as a hint. Otherwise, I don't think it knew what to do with it.

D-Link: Attach a JPEG, attach a JPEG, attach a JPEG .... (each of which fully describes a single discrete JPG image/frame).

Proper MJPEG: A common header for *all* frames about to follow, then a stream of JPG coded data ... (more efficient in that all frames refer back to that first header). Oh, and not MIME encoded ... either!

Try JPEG or MJPEG?

Example output below ...

Code: Select all

/usr/bin/echo -e "GET /VIDEO.CGI HTTP/1.1\n" | nc 192.168.0.XX 80 | more

HTTP/1.0 200 OK
Server: Camera Web Server/1.0
Auther: Steven Wu
MIME-version: 1.0
Cache-Control: no-cache
Content-Type: multipart/x-mixed-replace;boundary=--video boundary--

--video boundary--Content-length: 25006
Content-type: image/jpeg

ÿØÿâJFIF .... blah blah

Code: Select all

 /usr/bin/echo -e "GET /IMAGE.JPG HTTP/1.1\n" | nc 192.168.0.XX 80 | more
HTTP/1.0 200 OK
Server: Camera Web Server/1.0
Auther: Steven Wu
MIME-version: 1.0
Cache-Control: no-cache
Content-Type: image/jpeg
Content-Length: 24646

ÿØÿâJFIF ... blah blah
Last edited by mikb on Fri May 13, 2022 5:35 pm, edited 1 time in total.
chuck8530
Posts: 94
Joined: Sun Nov 21, 2021 2:45 am

Re: ESP32-CAM format

Post by chuck8530 »

First, thanks for the help. Sorry for the delay - events and trying other things.

/usr/bin/echo -e "GET /stream HTTP/1.1\n" | nc 192.168.0.33 81 | more
screams

ZM log says Found unsupported content type. I've searched for ZM & JFIF - no joy. My biggest problem is I'm an end user and I don't know/understand ZM internals. And Google has not been any help at all.
--------------------------------
5 min later - grep'n for JFIF - ZM knows about it. - ./skins/classic/views/monitor.php has the entry:
fourcc('J','P','E','G') => '*JPEG', /* JFIF JPEG */
But in /usr/bin/zm* - nada
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: ESP32-CAM format

Post by mikb »

Update :-

I'm using ZM 1.ancient -- and I set up :-

Code: Select all

Source Type "Remote"
Protocol "HTTP/Simple"
And it just worked. Now, at some point no doubt "Remote" is deprecated and using FFMPEG etc. is the way to go.

However -- I just looked at my old scripts for capturing from these cameras outside of ZoneMinder (which spit JPEGs as MIME headered stuff, in place of proper video) and FFMPEG did *NOT* understand it at all.

I (badly) wrote a C hack filter, to strip out all the one-time-header and repeating-per-frame-headers rubbish, leaving only the meat of the JPEG images -- and put this in line between the "netcat" (nc) and FFMPEG reading from stdin, at which point it was happy. I still had to tell it "-f mjpeg" so it knew what was coming in. It tolerated that just fine!

So -- if you are using FFMPEG as your camera type, it may not support this camera without extra work, unless FFMPEG has become much more tolerant in terms of the garbage fed in ;)
chuck8530
Posts: 94
Joined: Sun Nov 21, 2021 2:45 am

Re: ESP32-CAM format

Post by chuck8530 »

Ver 1.34.26
I purchased a pair: Frienda 2 Pieces ESP32-CAM WiFi Board ESP32-CAM-MB Micro USB to Serial Port CH340G with OV2640 2MP Camera Module Compatible with Arduino IDE Arduino Raspberry Pi via Amazon.

Then using Ardunio I loaded it with code for CAMERA_MODEL_AI_THINKER. It outputs 2 different pages: 80 which has a large menu - res, bright, contrast, flip, and another 20 settings. #2 is IP:81/stream which gives just the image. In Firefox, VLC it pops right up and runs fine. I have tried every ZM configuration possible and - no joy. Logs: Protocol not found - and Google hasn't been my friend. Education please.
tks
dg3r1
Posts: 1
Joined: Sat Sep 10, 2022 1:31 pm

Re: ESP32-CAM format

Post by dg3r1 »

As an ancient user, but not too skilled, i have running 2 ESP32-Cam, each one with different sw and different ZM configs as well as different performances, as shown attached files.

My ZM v1.36.25 is running under Ubuntu 20.04 on RPi4 4GB, recording on 1x 4TB WD Purple (about 1 month @320x240) the follows:

1 Panasonic PTZ
1 Axis 207
5 Rpi (2x RPi0 + 3x Rpi (2 & 3 version) ) with Cam Module
3 Dlink
2 Esp32-Cam (third one ESP32-Cam by choosing and, obviously, applying the best sw to all of them, asap)

Cheers, 3r1
Attachments
ESP32Cam_ZM_Configs.7z
(134.25 KiB) Downloaded 215 times
ZM_ESP32Cams.JPG
ZM_ESP32Cams.JPG (55.58 KiB) Viewed 7979 times
marcschh
Posts: 16
Joined: Mon Jul 11, 2011 8:48 pm

Re: ESP32-CAM format

Post by marcschh »

chuck8530 wrote: Fri May 20, 2022 5:57 pm Ver 1.34.26
I purchased a pair: Frienda 2 Pieces ESP32-CAM WiFi Board ESP32-CAM-MB Micro USB to Serial Port CH340G with OV2640 2MP Camera Module Compatible with Arduino IDE Arduino Raspberry Pi via Amazon.

Then using Ardunio I loaded it with code for CAMERA_MODEL_AI_THINKER. It outputs 2 different pages: 80 which has a large menu - res, bright, contrast, flip, and another 20 settings. #2 is IP:81/stream which gives just the image. In Firefox, VLC it pops right up and runs fine. I have tried every ZM configuration possible and - no joy. Logs: Protocol not found - and Google hasn't been my friend. Education please.
tks
same here for me with zm 1.37.25 - no success with ESP32-CAM AI-Thinker Model
It gets more and more commononly from my point of view - so any suggestions?

the tip with libvlc from this thread ESP32 Cam not working properly with ZM
is not working for me
URL:
http://192.168.xx.xx:81/stream%27,NULL, ... ,NULL,NULL

also this url is not working
URL:
http://192.168.xx.xx:81/stream
marcschh
Posts: 16
Joined: Mon Jul 11, 2011 8:48 pm

Re: ESP32-CAM format

Post by marcschh »

I switched ESP32-CAM project from the arudino example "CameraWebServer" and some other LiveWebserver to

* TITLE: HOW TO BUILD A $9 RSTP VIDEO STREAMER: Using The ESP-32 CAM Board || Arduino IDE - DIY #14
* DESCRIPTION: This sketch creates a video streamer than uses RTSP. You can configure it to either connect to an existing WiFi network or to create
* a new access point that you can connect to, in order to stream the video feed.

and it is working fine with zoneminder

you may choose https://github.com/bnbe-club or some other forks
Post Reply