Skip to content
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

Get more frame? #1

Open
NaxGH opened this issue Jul 19, 2022 · 7 comments
Open

Get more frame? #1

NaxGH opened this issue Jul 19, 2022 · 7 comments

Comments

@NaxGH
Copy link

NaxGH commented Jul 19, 2022

This the most simple project i've seen for record a video
Cool project btw

And i have question
For some reason i couln't get video beyon 10fps
I try change some of this value

FRAME_INTERVAL = 40
MAX_FRAME = 30
FRAMESIZE_SVGA // 800 x 600

it is need something to do with the AVI Header?

@red-car-nz
Copy link
Owner

red-car-nz commented Jul 19, 2022

Hi @Tri44

Have you read through this thread?... it mentions a number of ways to improve performance. The easiest is to use a faster SD card... there is a big difference between cards.

https://forum.arduino.cc/t/video-recording-with-an-esp32-pir-sensor/938687/37

... and yes, if you change the FPS you also need to change the matching variables in the AVI header. Search for "[based on FRAME_INTERVAL] " in the code.

@NaxGH
Copy link
Author

NaxGH commented Jul 19, 2022

Ahh... thanks for the replay i do read through that thread and have class10 sd card
And yes i able to record max frame(10fps) at 1280 x 1024 with no problem and no frame skip.

Also i move sensor reading to loop() because i often use wifi connection for uploading and move this code to sepreate header file.

I will look more into AVI header.

@red-car-nz
Copy link
Owner

Sometimes the SD cards are not as good as they say they are...

What speed are you seeing when the code runs?

18:52:47.655 -> Average frame size (bytes): 38580
18:52:47.655 -> Average frame write time (ms): 275
18:52:47.655 -> Average write speed (bytes/s): 140177

"Average write speed" - what value do you see?

@NaxGH
Copy link
Author

NaxGH commented Jul 19, 2022

Sorry i will back to you in couple hour i'm not on my workstation rn

@NaxGH
Copy link
Author

NaxGH commented Jul 19, 2022

ha... weird i only see this

[Sensor] Movement detected
[Sensor] Recording...
/sdcard/videos/VID00001.avi opened.
Waiting for AVI file, frame skipped.
File closed, size: 5104496

@red-car-nz
Copy link
Owner

@Tri44

Ah ok... there are 2 versions of the code... one is a power saving version that sleeps between movies... it has more debugging statements. Try using that one, or copy the debug code to the version you are using.

@NaxGH
Copy link
Author

NaxGH commented Jul 20, 2022

This is what i got
Using this code default setting and i need to change some of the code to make it work on PlatformIO
especially the sd card and run on 1 bit also if i take a look again its a class6 sd card

First run:
File closed, size: 11778890
Average frame size (bytes): 24463
Average frame write time (ms): 139
Average write speed (bytes/s): 47324

Second run:
File closed, size: 6375028
Average frame size (bytes): 26648
Average frame write time (ms): 142
Average write speed (bytes/s): 61016

And when i am being idiot implement this code to my code, i didn't notice if the config.fb is connected to MAX_FRAME🤦 and my config.fb = 2,
that why there no Frame buffer full, frame skipped. this message when use higher resolution.

Sorry for the confusion

Maybe i am accidentally sort of make it work to capture 1280x1024(or it being render back to 800x600 because of AVI Header?) at 10fps with DIV set to 5 <- (i need this to get more light at night)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants