Open RasikaShejul opened 5 years ago
motion.conf
file.netcam_keepalive on
reduces bandwidth, improves fps and removes stuttering. Data rate reduced to 510KB/s max. I found that the data rate was capped at this level and changing the resolution did nothing.sudo service motion start
. To solve this, resave /etc/default/motion
file as yes
. After this run, sudo service motion status
. Should get the following output:
● motion.service - LSB: Start Motion detection
Loaded: loaded (/etc/init.d/motion; generated; vendor preset: enabled)
Active: active (running) since Sat 2019-07-20 15:02:49 IST; 10s ago
Docs: man:systemd-sysv-generator(8)
Process: 3375 ExecStop=/etc/init.d/motion stop (code=exited, status=0/SUCCESS)
Process: 3721 ExecStart=/etc/init.d/motion start (code=exited, status=0/SUCCESS)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/motion.service
└─3738 /usr/bin/motion
Jul 20 15:02:49 raspberrypi systemd[1]: Starting LSB: Start Motion detection... Jul 20 15:02:49 raspberrypi motion[3721]: Starting motion detection daemon: motion. Jul 20 15:02:49 raspberrypi systemd[1]: Started LSB: Start Motion detection. Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] motion_startup: Motion 4.0 Started Jul 20 15:02:50 raspberrypi motion[3733]: [0:motion] [NTC] [ALL] motion_startup: Logging to file (/var/log/motion/motion.log)
+ motion.conf changes:
```bash
daemon on # enable running the process in background
v4l2_palette 8 # select mjpeg encoding
tunerdevice /dev/tuner0 # Not using this feature [REMOVED]
width 1280
height 720
framerate 100 # max frames possible
netcam_keepalive on # does not refresh connection on every http request
stream_maxrate 100 # max framerate on browser streaming
stream_localhost off # can access stream from a remote host
# changing this improved my data rate by 53% (currently 200KB/s)
threshold 920000 # threshold above which motion is detected, kept as 1280 * 720 aprox
# changin inthis improved the performance further by 150% (currently 500KB/s). I am getting a smooth 720p video with minimal stuttering but with high latency (around 750ms)
noise_level 920000 # noise is detected is 1280 * 720 pixels change... basically never
noise_tune off
lightswitch 100 # ignore 100% pixels of light intensity changes
output_pictures off # picture are not stored after motion is detected
mask_file /etc/motion/black-mask.pgm # adds a black mask to each video frame. Frame with a black mask is not processed. I added a completely black mask
Result: The camera works fine @720p with acceptable framerates (20-25ish) Edited files: motion-config-files.zip
I think that the raspi can run one more USB camera in parallel. Are there any available for testing? @vedangasDARKNINJA @RasikaShejul
1) IP VANDALPROOF CAMERA DS-2CD2120F-I HIKVISION datasheet: https://shopdelta.eu/ip-vandalproof-camera-ds-2cd2120f-i-onvif-1080p-2-8-mm-hikvision_l2_p8857.html 2) USB camera https://bluerobotics.com/store/sensors-sonars-cameras/cameras/cam-usb-low-light-r1/
testing these 2