Simple fast version of https://github.com/jameszah/ESP32-CAM-Video-Recorder
ESP32-CAM-Video-Recorder-junior
This program records an mjpeg avi video to the sd card of an ESP32-CAM.
You can just compile, download, power-on ... and it will record a series of 30 minute, HD videos, 12.5 fps on your SD card ... while you read on ...
Although if you put your ssid and password, and timezone into the config.txt file, and put that file on the SD card, things will be nicer! You can read the comments in config.txt and set your desired recording length, framesize, and internet on/off in there.
Check out https://github.com/jameszah/ESP32-CAM-JAMCAM with builtin video clipping, reduce framerate, and rebuild index, plus video display, ... and snakes!
Click here for a one-click installer of the current version of the program. It is pre-compiled, and it will run with no-internet, and the standard HD recording, or you can edit the config.txt and put it on a sd card, and then wifi will start and you can watch streaming video, and download your videos to your browser and computer/phone.
https://jameszah.github.io/ESP32-CAM-VideoCam/
You need all the files from the v58 folder:
https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior/tree/master/v58
esp32-arduino 2.0.2 busted a few things (mutexes, some sd_mmc chnages)
Obviously, you need the wifi running for all these wifi features - but you can do the simple recording with switch control without the wifi.
The main screen is the same, except for the link to the esp32_sd_file_manager to download or edit the avi's and config.txt.
Then there is the streaming screen (not shown) and the photos screen below - you can 10 photos at 3 second intervals.
This is the esp32_sd_file_manager_screen:
This system will download to Windows and Android, and presumably others.
There is a problem with Android downloading to the browser in a Sansumg phone - it saves the .avi file with a ".phps" file type. You can delete that and it will be recongnized as an .avi and will play properly, but I don't know where the "phps" comes from. ???
(Jan 12, 2022 - add date and time to files)
Here is the download file dialog on Windows.
You can also end recording and reboot from the webpage.
Under good conditions, you can download at about 2 Mbps while recording, 3 Mbps when not recording, from an esp32 max of about 3.5 Mbps.
You need all the files from the v57 folder:
https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior/tree/master/v57
Using this library to transfer files to your computer or phone:
https://github.com/jameszah/ESPxWebFlMgr/tree/master/esp32_sd_file_manager
Stay tuned for instructions.
Here is a timelapse sample, recorded and uploaded to Youtube. The settings were framesize UXGA (13), quality 15, 1 fps, 1800 seconds long, speedup 30 times. Click the image and it will take you to Youtube to see it.
Here is a realtime sample, recorded and uploaded to Youtube. The settings were framesize HD (11), quality 14, max fps or zero interval, 30 seconds long, speedup 1 times. It came out at about 12.4 fps. Lowering the quality slightly -- higher quality number -- will make the bytes per frame smaller, and keep the speed at the camera maximum of 12.5 fps for HD. Click the image and it will take you to Youtube to see it.
It records a video and sends it to your Telegram account - no SD card!
https://github.com/jameszah/ESP32-CAM-Video-Telegram
This is the same as the last version with a small mod to fix the broken jpeg problem. The critical line is here:
esp_err_t set_ps = esp_wifi_set_ps(WIFI_PS_NONE);
It sets the modem to no power saving. The power saving had put the modem to sleep for a time, and when it awoke, it caused a disturbance in the i2s system (my theory), that caused the i2s camera to become confused, and create a bad jpeg.
Read more here for my journey to this solution (2-3 months I think!)
https://github.com/espressif/esp32-camera/issues/244#issuecomment-831561336
Updated version I have been using.
Uses the current Arduino IDE 1.8.13, and the current esp32-arduino core 1.06, which handles the ov5640 camera in additon to the normal ov2640.
Framerates have improved - the ov2640 will record at 12.5 fps on regular HD 1280x720.
Also you can put a config file onto the SD card, called config.txt which will set all the parameters of the recording. See the config.txt file included here. So you can compile and install the version here, and then control everything by editing config.txt on the SD card. Much simpler even if you are working at your dev computer.
You can run full-speed at any framesize and quality, or timelapse, and stream or not stream as desired.
There is a issue with the esp32 camera and wifi that interact, so when the wifi is turned on, you will have an occasional broken frame -- one frame of the movie that will look odd. If you shut off the wifi, it should be perfect.
The config.txt has parameters to run without wifi, or start wifi to get the current time and then shut off, or use WiFi-Man wifi with streaming, or use WiFi ssid from the config file, and have it controlled with the pin 13 switch, to switch it on to look through the viewfinder, then switch it off to get a perfect recording.
Ground pin 12, so stop recording. And ground pin 13 to enable disable wifi, using the same hardware defined below.
Has the file delete code included, so it will delete old videos as long as the camera is running.
Also, this has tasks and mutexes and priorities, in defiance of the original design. All that makes sure that the camera and the sd and the wifi, can all operate at full speed without blocking each other. You can record the streaming video with VLC on your coomputer if you like.
v10x-wifiman - added WiFiManager to set your wifi ssid and password using your phone
use the normal WiFiManager procedure to set up ssid with 192.168.4.1 etc https://github.com/tzapu/WiFiManager
You must use the latest WiFiManager code which supports the ESP32 - currently 2.0.3-alpha which can be installed from Arduino IDE - Manage Libraries. And you must reboot the esp32 after you have set the ssid.
Some other new stuff in the comments - a version that adds back the ftp, and a version that slows down the recording for timelapses, or just lower framerates to save SD card space.
v10 - fast and just one version
v09 - faster version - controlled by switches
v07 - faster version - should operate at full speed of camera
v02 - basic version
v04 - added wifi, time, stream @ 5 fps, and photos @ 1 fps
both the streaming and the photos use the same images that are stored in the avi file, so it should not affect the frame-rate of the recording on the sd, but you might see partial images if you have slow wifi and the sd writer deletes the image while it it being transmitted. Let me know of problems in the comments. :smiley:
v04a - bugfix to the streaming when used in poor wifi situations, and more stats on webpage to track fps
by James Zahary Sep 12, 2020 jamzah.plc@gmail.com
https://github.com/jameszah/ESP32-CAM-Video-Recorder-junior
https://github.com/jameszah/ESP32-CAM-Video-Recorder
jameszah/ESP32-CAM-Video-Recorder is licensed under the
GNU General Public License v3.0
jameszah/ESP32-CAM-Video-Recorder-junior is licensed under the
GNU General Public License v3.0
The is Arduino code, with standard setup for ESP32-CAM
Partition Scheme Huge APP (3MB No OTA)
It is the junior version of https://github.com/jameszah/ESP32-CAM-Video-Recorder which has 100 other features of wifi, streaming video, http control, telegram updates, pir control, touch control, ftp downloads, .... and other things that make it very big and complex.
This one is written in simple arduino code without any semaphores, tasks, priorities, RTOS stuff ....
Just set 4 parameters, compile and download, and it will record on power-on, until sd is full, or power-off. Then pull out the sd and move it to your computer, and you will see all but the last file avi which died during the unplug.
Update: I added some complexity. Connect Pin 12 to GND to stop a video -- no dead videos -- and prevent recording. Release Pin 12 and it will record forever.
Compile Time Parameters
10 - UXGA (1600x1200 @ 6 fps), 9 - SXGA (1280x1024 @ 6 fps), 7 - SVGA(800x600 @ 24 fps), 6 - VGA(640x480 @ 24 fps), 5 - CIF(400x296 @ 50 fps)
Note that framesize and high quality will produce lots of bytes which have to written to the sd. Those frame rates above are for the OV2640 camera, and your sd card will have to be able to swallow all that data before the next frame. If the sd card cannot take all that data, then the camera will be idle waiting for the sd. Lower the framesize (UXGA -> SVGA), and lower the quality (10 -> 15 -> 20, higher number is lower quality) to improve framerate to the camera limits. If you have a fast enough sd card, it will record at the full speed of the camera.
Using a Lexar 633x circle10, U3, V30 SD card, with quality set at 20, it will record at full speed of the camera -- in dull indoor light. In bright outdoor light - looking at the sun - it will slow down by half - to about 12 fps SVGA. You could lower quality to keep that at a higher fps, if you insist on looking at the sun.
Using a dollarstore SD card - EAGET circle10, U1 - it will record at about half of the camera capacity -- in dull indoor light.
You can look at the blinking red led on the back of the chip to see the recording rate -- sd chips for video are made to be more predictable.
The files will have the name such as:
desklens 10.3 + 120s.avi
"desklens" is your devname 10 - is a number stored in eprom that will increase everytime your device boots 3 - is the 3rd file created during the current boot +120s - is an indictation of how long since we started recording on this boot
Small red led on the back blinks with every frame.