Notifications
Clear all

ESP32 CAM Video Steam Performance

6 Posts
4 Users
1 Likes
781 Views
ronpenrose
(@ronpenrose)
Member
Joined: 1 year ago
Posts: 25
Topic starter  

i implemented the ESP32 CAM project following the :

ESP32 CAM - 10 Dollar Camera for IoT Projects YouTube video's.

The video stream is very slow. I takes about 20 seconds to refresh. In other words, if I move the camera, it does not refresh for about 20 seconds.

I used the code in the tutorial to perform a signal test (I am using the built in antenna on the CAM). The values from the test were -37 to -39 which as I understand is a pretty good value. I have not yet tried an external antenna since I do not have.

Looking for suggestions for troubleshooting. Thanks.

Ron Penrose


   
Quote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Posted by: @ronpenrose

i implemented the ESP32 CAM project following the :

The video stream is very slow. I takes about 20 seconds to refresh. In other words, if I move the camera, it does not refresh for about 20 seconds.

I didn't experience it when I tried it out.  It had enough lag to make you dizzy, but I dare say it wasn't over half a second.  However, I did use a different source https://github.com/s60sc/ESP32-CAM_MJPEG2SD because it had lots of options like motion detection, SD card storage.

 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7083
 

Posted by: @ronpenrose

i implemented the ESP32 CAM project following the :

ESP32 CAM - 10 Dollar Camera for IoT Projects YouTube video's.

The video stream is very slow. I takes about 20 seconds to refresh. In other words, if I move the camera, it does not refresh for about 20 seconds.

I have used over a dozen esp32cam's, and there is some lag, but not 20 seconds.

What board are you using (pictures will help) and provide a link to the source code you are using as there are older versions floating around.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1710
 

Hi @ronpenrose,

  Others have a lot more experience than I have, so this is just a couple of comments to ponder.

With these cheap small camera/small computer systems, it is inevitable that they can't handle both top quality resolution and high frame rates at the same time; some compromises have to be accepted.

One possibility is the frame rate has to reduce. That is reduce the number of times the entire screen is updated. The minimum frame rates normally accepted for 'everyday TV quality video' is around 25 frames per second .. so 40 milliseconds per frame.

With TV transmission systems, there will often be a lag between the time a frame occurs and the time it reaches the user screen. However, it follows that there must be a form of storage implicit in the transmission chain (pipeline) to temporarily store the frames between occurrence and display.

For 20 seconds at 25 frames per second, this would be 500 frames in length, and would imply many Megabytes, possibly Gigabytes of memory. I would estimate the ESP-CAM module could store 2-3 frames at the most, mainly within the camera chip itself.

---------

A possibility, if the the frame rate is reasonable, though probably less than 25 frames per second, and motion of most objects reasonably smooth,  but events appear on the screen some 20 seconds later, then the display system, which I'll assume is a PC, with the image is being viewed in browser like Firefox or Edge, then most of the pipeline buffer is within the PC. A PC has the memory resource for a substantial lag delay, although I am not sure how realistic it is to have (most of) a 20 second lag within the PC.

---------

Another possibility, is the camera only captures at a very slow frame rate. That is, it is effectively capturing a limited number of 'still' frames. With a pipeline capacity of (say) 2 frames, and a lag of 20 seconds, this implies about 1 frame every 10 seconds. If objects are moving significantly in the image, the observed motion will clearly be very jerky.

In this case, the bottleneck could be at the ESP-Camera stage, or in the PC. As the ESP-Camera that different forum member have are (probably) similar, though there are certainly variants around, then if you publish your timing measurements, including settings of frame resolution, etc etc, someone else may be able to provide comparative figure.

----------------------------------------------------

So, I have presented a number of different plausible scenarios and tried to point out how the  differnet scenarios affect the displayed image. This might be helpful in determining the limits of your overall system, and hence where to look for a solution.

Best wishes and good luck, Dave


   
ReplyQuote
ronpenrose
(@ronpenrose)
Member
Joined: 1 year ago
Posts: 25
Topic starter  

@zander Actually, it tamed down to a reasonable refresh. Still jerky but possibly every 1/2 second or so. Also, I changed vid resolution to 640 x 480 and much better.

Ron Penrose


   
ReplyQuote
ronpenrose
(@ronpenrose)
Member
Joined: 1 year ago
Posts: 25
Topic starter  

@davee Thanks. I reduced the vid size to 640 x 480 and much better. As it turned out the video stablized so the refresh is very short - still jerky be reasonable.

Ron Penrose


   
DaveE reacted
ReplyQuote