Skip to content

Update Video and NN examples #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a6ba007
Add Motion Detection Demo
PLSHHH Jan 19, 2023
5c45747
update coding style
M-ichae-l Jan 19, 2023
7a9d0e3
Merge branch 'ambiot:dev' into dev
pammyleong Jan 20, 2023
ace9032
Add NN API and examples
PLSHHH Jan 26, 2023
2c7eefb
Update coding style
M-ichae-l Jan 26, 2023
a7ad91b
Merge branch 'ambiot:dev' into dev
pammyleong Jan 26, 2023
b202d4c
Change folder for NN API and examples
PLSHHH Jan 26, 2023
850c8f8
Merge branch 'ambiot:dev' into dev
pammyleong Jan 26, 2023
0b66d7a
Merge branch 'ambiot:dev' into dev
pammyleong Jan 30, 2023
ca02897
Modify Video API and keywords.txt
pammyleong Jan 30, 2023
dd58e06
Merge branch 'ambiot:dev' into dev
pammyleong Feb 2, 2023
104272d
Update faaccfg.h
pammyleong Feb 2, 2023
fe811a9
Merge branch 'ambiot:dev' into dev
pammyleong Feb 2, 2023
8a2b97e
Update MP4Recording API and examples
pammyleong Feb 3, 2023
dab1657
Merge branch 'ambiot:dev' into dev
pammyleong Feb 6, 2023
a991a64
Merge branch 'ambiot:dev' into dev
pammyleong Feb 6, 2023
6477646
Merge branch 'ambiot:dev' into dev
pammyleong Feb 7, 2023
633006e
Update NN and VideoStreamOverlay API
pammyleong Feb 7, 2023
4d314cb
Merge branch 'ambiot:dev' into dev
pammyleong Feb 7, 2023
0f05e56
Merge branch 'ambiot:dev' into dev
pammyleong Feb 14, 2023
8903a1c
Merge branch 'ambiot:dev' into dev
pammyleong Feb 14, 2023
e44c057
Merge branch 'ambiot:dev' into dev
pammyleong Feb 17, 2023
bded61b
Merge branch 'ambiot:dev' into dev
pammyleong Feb 17, 2023
98ffb3b
Modify video examples
pammyleong Feb 17, 2023
45ab946
Merge branch 'ambiot:dev' into dev
pammyleong Feb 21, 2023
19f7020
Update VideoStream API
pammyleong Feb 22, 2023
c7f3d1e
Merge branch 'ambiot:dev' into dev
pammyleong Feb 24, 2023
83398f4
Update examples
pammyleong Feb 24, 2023
21a0b45
Update NN Example
pammyleong Feb 24, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "Password"; // your network password
int status = WL_IDLE_STATUS;

IPAddress ip;
int rtsp_portnum;

void setup() {
Serial.begin(115200);

Expand All @@ -50,7 +53,8 @@ void setup() {
// wait 2 seconds for connection:
delay(2000);
}

ip = WiFi.localIP();

// Configure camera video channels with video format information
// Adjust the bitrate based on your WiFi network quality
//config.setBitrate(2 * 1024 * 1024); // Recommend to use 2Mbps for RTSP streaming to prevent network congestion
Expand All @@ -61,6 +65,7 @@ void setup() {
// Configure RTSP with corresponding video format information
rtsp.configVideo(config);
rtsp.begin();
rtsp_portnum = rtsp.getPort();

// Configure object detection with corresponding video format information
ObjDet.configVideo(configNN);
Expand Down Expand Up @@ -102,6 +107,13 @@ void loop() {
void ODPostProcess(std::vector<ObjectDetectionResult> results) {
uint16_t im_h = config.height();
uint16_t im_w = config.width();

Serial.print("Network URL for RTSP Streaming: ");
Serial.print("rtsp://");
Serial.print(ip);
Serial.print(":");
Serial.println(rtsp_portnum);
Serial.println(" ");

printf("Total number of objects detected = %d\r\n", results.size());
OSD.clearAll(CHANNEL);
Expand Down Expand Up @@ -131,4 +143,4 @@ void ODPostProcess(std::vector<ObjectDetectionResult> results) {
}
}
OSD.update(CHANNEL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "Password"; // your network password
int status = WL_IDLE_STATUS;

IPAddress ip;
int rtsp_portnum;

void setup() {
Serial.begin(115200);

Expand All @@ -50,6 +53,7 @@ void setup() {
// wait 2 seconds for connection:
delay(2000);
}
ip = WiFi.localIP();

// Configure camera video channels with video format information
// Adjust the bitrate based on your WiFi network quality
Expand All @@ -61,6 +65,7 @@ void setup() {
// Configure RTSP with corresponding video format information
rtsp.configVideo(config);
rtsp.begin();
rtsp_portnum = rtsp.getPort();

// Configure object detection with corresponding video format information
ObjDet.configVideo(configNN);
Expand Down Expand Up @@ -99,6 +104,13 @@ void loop() {
uint16_t im_h = config.height();
uint16_t im_w = config.width();

Serial.print("Network URL for RTSP Streaming: ");
Serial.print("rtsp://");
Serial.print(ip);
Serial.print(":");
Serial.println(rtsp_portnum);
Serial.println(" ");

printf("Total number of objects detected = %d\r\n", results.size());
OSD.clearAll(CHANNEL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "Password"; // your network password
int status = WL_IDLE_STATUS;

IPAddress ip;
int rtsp_portnum;

void setup() {
Serial.begin(115200);

Expand All @@ -43,6 +46,7 @@ void setup() {
// wait 2 seconds for connection:
delay(2000);
}
ip = WiFi.localIP();

// Configure camera video channels with video format information
// Adjust the bitrate based on your WiFi network quality
Expand All @@ -54,6 +58,7 @@ void setup() {
// Configure RTSP with corresponding video format information
rtsp.configVideo(config);
rtsp.begin();
rtsp_portnum = rtsp.getPort();

// Configure face detection with corresponding video format information
facedet.configVideo(configNN);
Expand Down Expand Up @@ -95,6 +100,13 @@ void loop() {
void FDPostProcess(std::vector<FaceDetectionResult> results) {
uint16_t im_h = config.height();
uint16_t im_w = config.width();

Serial.print("Network URL for RTSP Streaming: ");
Serial.print("rtsp://");
Serial.print(ip);
Serial.print(":");
Serial.println(rtsp_portnum);
Serial.println(" ");

printf("Total number of faces detected = %d\r\n", results.size());
OSD.clearAll(CHANNEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "Password"; // your network password
int status = WL_IDLE_STATUS;

IPAddress ip;
int rtsp_portnum;

void setup() {
Serial.begin(115200);

Expand All @@ -54,6 +57,8 @@ void setup() {
delay(2000);
}

ip = WiFi.localIP();

// Configure camera video channels with video format information
// Adjust the bitrate based on your WiFi network quality
//config.setBitrate(2 * 1024 * 1024); // Recommend to use 2Mbps for RTSP streaming to prevent network congestion
Expand All @@ -64,6 +69,7 @@ void setup() {
// Configure RTSP with corresponding video format information
rtsp.configVideo(config);
rtsp.begin();
rtsp_portnum = rtsp.getPort();

// Configure face detection with corresponding video format information
facedet.configVideo(configNN);
Expand Down Expand Up @@ -124,13 +130,24 @@ void loop() {
facerecog.restoreRegisteredFace();
}
}

delay(1000);
OSD.clearAll(CHANNEL);
OSD.update(CHANNEL);
}

// User callback function for post processing of face recognition results
void FRPostProcess(std::vector<FaceRecognitionResult> results) {
uint16_t im_h = config.height();
uint16_t im_w = config.width();

Serial.print("Network URL for RTSP Streaming: ");
Serial.print("rtsp://");
Serial.print(ip);
Serial.print(":");
Serial.println(rtsp_portnum);
Serial.println(" ");

printf("Total number of faces detected = %d\r\n", results.size());
OSD.clearAll(CHANNEL);

Expand Down Expand Up @@ -163,4 +180,3 @@ void FRPostProcess(std::vector<FaceRecognitionResult> results) {
}
OSD.update(CHANNEL);
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Default preset configurations for each video channel:
// Channel 0 : 1920 x 1080 30FPS H264
// Channel 1 : 1280 x 720 30FPS H264
// Channel 2 : 1920 x 1080 30FPS MJPEG
// Channel 2 : 1280 x 720 30FPS MJPEG

VideoSetting config(CHANNEL);
RTSP rtsp1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Default preset configurations for each video channel:
// Channel 0 : 1920 x 1080 30FPS H264
// Channel 1 : 1280 x 720 30FPS H264
// Channel 2 : 1920 x 1080 30FPS MJPEG
// Channel 2 : 1280 x 720 30FPS MJPEG

VideoSetting configV1(VIDEO_FHD, CAM_FPS, VIDEO_H264, 0);
VideoSetting configV2(VIDEO_HD, CAM_FPS, VIDEO_H264, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Default preset configurations for each video channel:
// Channel 0 : 1920 x 1080 30FPS H264
// Channel 1 : 1280 x 720 30FPS H264
// Channel 2 : 1920 x 1080 30FPS MJPEG
// Channel 2 : 1280 x 720 30FPS MJPEG

VideoSetting configV(CHANNEL);
Audio audio;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Default preset configurations for each video channel:
// Channel 0 : 1920 x 1080 30FPS H264
// Channel 1 : 1280 x 720 30FPS H264
// Channel 2 : 1920 x 1080 30FPS MJPEG
// Channel 2 : 1280 x 720 30FPS MJPEG

VideoSetting config(CHANNEL);
RTSP rtsp;
Expand Down