Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
myc42351781
SimpleVideoServer
提交
9aaf1391
S
SimpleVideoServer
项目概览
myc42351781
/
SimpleVideoServer
与 Fork 源项目一致
Fork自
云逸之 / SimpleVideoServer
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SimpleVideoServer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9aaf1391
编写于
2月 02, 2023
作者:
云逸之
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
兼容合宙S3
上级
d8ed2339
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
89 addition
and
19 deletion
+89
-19
simpleVideoRecorder/platformio.ini
simpleVideoRecorder/platformio.ini
+17
-4
simpleVideoRecorder/src/cam_pins.h
simpleVideoRecorder/src/cam_pins.h
+47
-0
simpleVideoRecorder/src/main.cpp
simpleVideoRecorder/src/main.cpp
+25
-15
未找到文件。
simpleVideoRecorder/platformio.ini
浏览文件 @
9aaf1391
...
...
@@ -7,12 +7,25 @@
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs
=
heZhouS3
[env:esp32cam]
platform
=
espressif32
board
=
esp32cam
framework
=
arduino
upload_speed
=
115200
upload_port
=
COM3
monitor_speed
=
115200
monitor_port
=
COM3
\ No newline at end of file
upload_speed
=
115200
monitor_speed
=
115200
[env:heZhouS3]
platform
=
espressif32
board
=
esp32-s3-devkitc-1
framework
=
arduino
upload_speed
=
921600
monitor_speed
=
115200
; 重载摄像头配置 指定合宙S3引脚
build_flags
=
-DOVER_LOAD_CAM_CONF
-DHE_ZHOU_S3
; 指定帧大小
-DFRAMESIZE
=
FRAMESIZE_SVGA
;
-DFRAMESIZE
=
FRAMESIZE_HD
\ No newline at end of file
simpleVideoRecorder/src/cam_pins.h
0 → 100644
浏览文件 @
9aaf1391
//
// Created by lustre on 2023/2/2.
//
#ifndef CAM_PINS_H
#define CAM_PINS_H
#ifdef CAMERA_MODEL_AI_THINKER
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
#elif defined(HE_ZHOU_S3)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 39
#define SIOD_GPIO_NUM 21
#define SIOC_GPIO_NUM 46
// 这里Y几并非真正的原理图上引脚的标号 而是 适配 D0 ~ D7 固定一套 Y标号的写法 以便于兼容其它esp32摄像头的定义
#define Y9_GPIO_NUM 40 //D7
#define Y8_GPIO_NUM 38 //D6
#define Y7_GPIO_NUM 37 //D5
#define Y6_GPIO_NUM 35 //D4
#define Y5_GPIO_NUM 33 //D3
#define Y4_GPIO_NUM 48 //D2
#define Y3_GPIO_NUM 47 //D1
#define Y2_GPIO_NUM 34 //D0
#define VSYNC_GPIO_NUM 42
#define HREF_GPIO_NUM 41
#define PCLK_GPIO_NUM 36
#endif
#endif // CAM_PINS_H
simpleVideoRecorder/src/main.cpp
浏览文件 @
9aaf1391
#include <Arduino.h>
#include <WiFi.h>
#include "esp_camera.h"
#define CAMERA_MODEL_AI_THINKER
#include "UdpClient.hpp"
#include "ai_thinker_esp32_cam_meta.h"
const
char
*
ssid
=
"test0"
;
const
char
*
passwd
=
"12345687"
;
const
char
*
host
=
"192.168.137.1"
;
#ifndef OVER_LOAD_CAM_CONF
#define CAMERA_MODEL_AI_THINKER
#define FRAMESIZE FRAMESIZE_SVGA
//#define HE_ZHOU_S3
#endif
#include "cam_pins.h"
const
char
*
ssid
=
"test0"
;
const
char
*
passwd
=
"12345687"
;
const
char
*
host
=
"192.168.137.1"
;
const
uint16_t
serverUdpPort
=
8004
;
const
uint16_t
localUdpPort
=
2333
;
LightUDP
streamSender
;
void
connectWifi
(
const
char
*
ssid
,
const
char
*
passphrase
)
{
void
connectWifi
(
const
char
*
ssid
,
const
char
*
passphrase
)
{
WiFi
.
mode
(
WIFI_STA
);
WiFi
.
begin
(
ssid
,
passphrase
);
...
...
@@ -48,25 +54,29 @@ void setup() {
config
.
pin_pclk
=
PCLK_GPIO_NUM
;
config
.
pin_vsync
=
VSYNC_GPIO_NUM
;
config
.
pin_href
=
HREF_GPIO_NUM
;
config
.
pin_s
s
cb_sda
=
SIOD_GPIO_NUM
;
config
.
pin_s
s
cb_scl
=
SIOC_GPIO_NUM
;
config
.
pin_s
c
cb_sda
=
SIOD_GPIO_NUM
;
config
.
pin_s
c
cb_scl
=
SIOC_GPIO_NUM
;
config
.
pin_pwdn
=
PWDN_GPIO_NUM
;
config
.
pin_reset
=
RESET_GPIO_NUM
;
config
.
xclk_freq_hz
=
20000000
;
config
.
pixel_format
=
PIXFORMAT_JPEG
;
config
.
grab_mode
=
CAMERA_GRAB_WHEN_EMPTY
;
config
.
fb_location
=
CAMERA_FB_IN_PSRAM
;
config
.
jpeg_quality
=
12
;
config
.
fb_count
=
1
;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if
(
psramFound
())
{
config
.
frame_size
=
FRAMESIZE_UXGA
;
config
.
jpeg_quality
=
10
;
config
.
fb_count
=
2
;
config
.
grab_mode
=
CAMERA_GRAB_LATEST
;
}
else
{
// 使用非psram申请
config
.
frame_size
=
FRAMESIZE_SVGA
;
config
.
jpeg_quality
=
12
;
config
.
fb_count
=
1
;
config
.
fb_location
=
CAMERA_FB_IN_DRAM
;
}
// camera init
esp_err_t
err
=
esp_camera_init
(
&
config
);
if
(
err
!=
ESP_OK
)
{
...
...
@@ -74,9 +84,9 @@ void setup() {
return
;
}
Serial
.
println
(
"get sensor "
);
sensor_t
*
s
=
esp_camera_sensor_get
();
sensor_t
*
s
=
esp_camera_sensor_get
();
// drop down frame size for higher initial frame rate
s
->
set_framesize
(
s
,
FRAMESIZE
_SVGA
);
s
->
set_framesize
(
s
,
FRAMESIZE
);
connectWifi
(
ssid
,
passwd
);
streamSender
.
begin
(
WiFi
.
localIP
(),
localUdpPort
);
...
...
@@ -84,7 +94,7 @@ void setup() {
}
void
loop
()
{
camera_fb_t
*
fb
=
NULL
;
camera_fb_t
*
fb
=
NULL
;
size_t
len
=
0
;
Serial
.
println
(
"do loop"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录