Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ There are a lot of boards available that are all called ESP32-CAM.
However, there are differences in CPU (type/speed/cores), how the camera is connected, presence of PSRAM or not...
To select the right board use the table below and use the configuration that is listed below for your board:

| Board | Image | CPU | SRAM | Flash | PSRAM | Camera | | Site |
| Board | Image | CPU | SRAM | Flash | PSRAM | Camera | Extras | Manufacturer site |
|--- |--- |--- |--- |--- | --- |--- |--- |--- |
| Espressif ESP32-Wrover CAM | ![img](assets/boards/esp32-wrover-cam.jpg) | ESP32 | 520KB | 4Mb | 4MB | OV2640 | | |
| AI-Thinker ESP32-CAM | ![img](assets/boards/ai-thinker-esp32-cam-ipex.jpg) ![img](assets/boards/ai-thinker-esp32-cam.jpg) | ESP32-S | 520KB | 4Mb | 4MB | OV2640 | | [https://docs.ai-thinker.com/esp32-cam](https://docs.ai-thinker.com/esp32-cam) |
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_ai_thinker.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_espressif_esp32s2_cam_board.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_espressif_esp32s2_cam_header.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_espressif_esp32s3_cam_lcd.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_espressif_esp32s3_eye.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
Expand Down
4 changes: 2 additions & 2 deletions boards/esp32cam_espressif_esp_eye.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"arduino":{
"arduino": {
"ldscript": "esp32_out.ld",
"partitions": "huge_app.csv"
},
Expand Down Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=1'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_freenove_wrover_kit.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
4 changes: 2 additions & 2 deletions boards/esp32cam_m5stack_camera.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"arduino":{
"arduino": {
"ldscript": "esp32_out.ld",
"partitions": "huge_app.csv"
},
Expand Down Expand Up @@ -28,7 +28,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=1'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D GROVE_SDA=13'",
"'-D GROVE_SCL=4'"
],
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_m5stack_camera_psram.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D GROVE_SDA=13'",
"'-D GROVE_SCL=4'"
],
Expand Down
4 changes: 2 additions & 2 deletions boards/esp32cam_m5stack_esp32cam.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"arduino":{
"arduino": {
"ldscript": "esp32_out.ld",
"partitions": "huge_app.csv"
},
Expand Down Expand Up @@ -32,7 +32,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D MICROPHONE_GPIO=32'",
"'-D GROVE_SDA=13'",
"'-D GROVE_SCL=4'"
Expand Down
4 changes: 2 additions & 2 deletions boards/esp32cam_m5stack_unitcam.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"arduino":{
"arduino": {
"ldscript": "esp32_out.ld",
"partitions": "huge_app.csv"
},
Expand Down Expand Up @@ -30,7 +30,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=1'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_m5stack_unitcams3.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D I2C_MEMS_SDA=17'",
"'-D I2C_MEMS_SCL=41'",
"'-D TF_CS=9'",
Expand Down
4 changes: 2 additions & 2 deletions boards/esp32cam_m5stack_wide.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"arduino":{
"arduino": {
"ldscript": "esp32_out.ld",
"partitions": "huge_app.csv"
},
Expand Down Expand Up @@ -30,7 +30,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_seeed_xiao_esp32s3_sense.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=2'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_PSRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D I2C_MEMS_SDA=41'",
"'-D I2C_MEMS_SCL=42'",
"'-D TF_CS=21'",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_ttgo_t_camera.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=1'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'",
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'",
"'-D LCD_SSD1306_PIN_SDA=21'",
"'-D LCD_SSD1306_PIN_SCL=22'",
"'-D BUTTON_RIGHT_PIN=34'",
Expand Down
2 changes: 1 addition & 1 deletion boards/esp32cam_ttgo_t_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"'-D CAMERA_CONFIG_LEDC_CHANNEL=LEDC_CHANNEL_0'",
"'-D CAMERA_CONFIG_FB_COUNT=1'",
"'-D CAMERA_CONFIG_FB_LOCATION=CAMERA_FB_IN_DRAM'",
"'-D SCCB_I2C_PORT=I2C_NUM_0'"
"'-D CAMERA_CONFIG_SCCB_I2C_PORT=I2C_NUM_0'"
],
"f_cpu": "240000000L",
"f_flash": "40000000L",
Expand Down
1 change: 1 addition & 0 deletions dotnet_riscv
Submodule dotnet_riscv added at 70e3cb
6 changes: 6 additions & 0 deletions include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

#define OTA_PASSWORD "ESP32CAM-RTSP"

// Time servers
#define NTP_SERVER_1 "nl.pool.ntp.org"
#define NTP_SERVER_2 "europe.pool.ntp.org"
#define NTP_SERVER_3 "time.nist.gov"
#define NTP_SERVERS NTP_SERVER_1, NTP_SERVER_2, NTP_SERVER_3

#define RTSP_PORT 554

#define DEFAULT_FRAME_DURATION 200
Expand Down
18 changes: 18 additions & 0 deletions lib/micro-jpg/include/jpg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stddef.h>

#include "jpg_section.h"

class jpg
{
public:
bool decode(const uint8_t *jpg, size_t size);

const jpg_section_dqt_t *quantization_table_luminance_;
const jpg_section_dqt_t *quantization_table_chrominance_;

const uint8_t *jpeg_data_start;
const uint8_t *jpeg_data_end;

private:
static const jpg_section_t *find_jpg_section(const uint8_t **ptr, const uint8_t *end, jpg_section_t::jpg_section_flag flag);
};
107 changes: 107 additions & 0 deletions lib/micro-jpg/include/jpg_section.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#pragma once

#include <stddef.h>
#include <stdint.h>

// http://www.ietf.org/rfc/rfc2345.txt Each table is an array of 64 values given in zig-zag order, identical to the format used in a JFIF DQT marker segment.
constexpr size_t jpeg_quantization_table_length = 64;

typedef struct __attribute__((packed))
{
enum jpg_section_flag : uint8_t
{
DATA = 0x00,
SOF0 = 0xc0,
SOF1 = 0xc1,
SOF2 = 0xc2,
SOF3 = 0xc3,
DHT = 0xc4,
SOF5 = 0xc5,
SOF6 = 0xc6,
SOF7 = 0xc7,
JPG = 0xc8,
SOF9 = 0xc9,
SOF10 = 0xca,
SOF11 = 0xcb,
DAC = 0xcc,
SOF13 = 0xcd,
SOF14 = 0xce,
SOF15 = 0xcf,
RST0 = 0xd0,
RST1 = 0xd1,
RST2 = 0xd2,
RST3 = 0xd3,
RST4 = 0xd4,
RST5 = 0xd5,
RST6 = 0xd6,
RST7 = 0xd7,
SOI = 0xd8,
EOI = 0xd9,
SOS = 0xda,
DQT = 0xdb,
DNL = 0xdc,
DRI = 0xdd,
DHP = 0xde,
EXP = 0xdf,
APP0 = 0xe0,
APP1 = 0xe1,
APP2 = 0xe2,
APP3 = 0xe3,
APP4 = 0xe4,
APP5 = 0xe5,
APP6 = 0xe6,
APP7 = 0xe7,
APP8 = 0xe8,
APP9 = 0xe9,
APP10 = 0xea,
APP11 = 0xeb,
APP12 = 0xec,
APP13 = 0xed,
APP14 = 0xee,
APP15 = 0xef,
JPG0 = 0xf0,
JPG1 = 0xf1,
JPG2 = 0xf2,
JPG3 = 0xf3,
JPG4 = 0xf4,
JPG5 = 0xf5,
JPG6 = 0xf6,
JPG7 = 0xf7,
JPG8 = 0xf8,
JPG9 = 0xf9,
COM = 0xfe,
JPG10 = 0xfa,
JPG11 = 0xfb,
JPG12 = 0xfc,
JPG13 = 0xfd
};

const uint8_t framing; // 0xff
const jpg_section_flag flag;
const uint8_t length_msb;
const uint8_t length_lsb;
const uint8_t data[];

static bool is_valid_flag(const jpg_section_flag flag);
static const char *flag_name(const jpg_section_flag flag);
uint16_t data_length() const;
uint16_t section_length() const;
} jpg_section_t;

typedef struct __attribute__((packed)) // 0xffe0
{
char identifier[5] = {'J', 'F', 'I', 'F', 0}; // JFIF identifier, zero-terminated
uint8_t version_major = 1;
uint8_t version_minor = 1; // JFIF version 1.1
uint8_t density_units = 0; // no density units specified
uint16_t density_hor = 1;
uint16_t density_ver = 1; // density: 1 pixel "per pixel" horizontally and vertically
uint8_t thumbnail_hor = 0;
uint8_t thumbnail_ver = 0; // no thumbnail (size 0 x 0)
} jpg_section_app0_t;

typedef struct __attribute__((packed)) // 0xffdb
{
uint8_t id; // 0= quantLuminance, 1= quantChrominance
uint8_t data[jpeg_quantization_table_length];
} jpg_section_dqt_t;
14 changes: 14 additions & 0 deletions lib/micro-jpg/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "micro-jpg",
"version": "1.0.0",
"description": "JPEG library",
"keywords": "",
"repository": {
"type": "git",
"url": "https://github.com/rzeldent/"
},
"build": {
"srcDir": "src/",
"includeDir": "include/"
}
}
Loading
Loading