I was using motioneyeos for a project with a raspberry pi zero w and was easily getting 20fps@1280x720 so I decided to take a quick swipe at buildroot to cut out the features I don't need (I only need the stream) and hopefully free up some cpu usage for later.
I now have the default buildroot config for the pi zero w plus the minimum to get wifi working and motion.
I tweaked the /etc/init.d/S99motion file and changed it to:
#!/bin/sh
NAME=motion
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/bin/$NAME
start() {
printf "Starting $NAME: "
motion -m -c /etc/motion/motion.config -p $PIDFILE
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
printf "Stopping $NAME: "
start-stop-daemon -K -q -p $PIDFILE
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit $?
I also tried running the motion command with chrt 99
but nothing changed.
I also changed the motion.conf file to disable the web controller, video saving and change the video params. These are the things that I changed from the defaults:
daemon on
mmalcam_name cv.ril.camera
width 1280
height 720
movie_output off
framerate 20
webcontrol_port 0
stream_maxrate 20
But the video is incredibly laggy (maybe 2-3fps@1280x720) and I cannot for the life of me figure out why the performance is so bad. I also took a look through some of the code in the motioneyeos github repository but I cannot figure out where the motion process is actually started (I tracked down motioneye.sh based on their custom init.d files but that's the furthest I got).
Edit I have also just noticed that I only get that kind of performance on motioneyeos when I enable the setting "fast network camera", otherwise the framerate is roughly the same.