-
Notifications
You must be signed in to change notification settings - Fork 2
Resolution
Q-engineering edited this page Mar 9, 2022
·
1 revision
You can change the resolution of the recorded video, depending on the supported formats of the RPi camera and your computing power.
For instance, a Raspberry Pi Zero will have troubles with a large format, as where the RPi 4 may still run quietly.
The format for the background subtractor will always be 320x240. The output is a percentage, no need for CPU absorbing large resolutions.
See line 43 in Qstreamer.cpp
cv::resize(frame, norm_frame, cv::Size(320, 240));
The resolution is defined at the end of /etc/rc.local
In the example below 680x480.
#start streaming (notice the & at the end)
ffmpeg -input_format h264 -f video4linux2 -video_size 680x480 -framerate 15 -i /dev/video0 -c:v copy -an -f flv rtmp://localhost/live/rpi &
exit 0
You can get the available formats with the next command $v4l2-ctl --device=/dev/video0 -D --list-formats-ext