Was able to compile the latest source from 5-12-17 with neon optimizations. I added the h264_mmal line as well. I redid the cpu testing for the original unmodified zoneminder and ffmpeg from the repo using pidstat cause the numbers were jumping around a bit for the neon optimized version. I think also time of day matters due to difference in lighting.
OS: Raspbian "GNU/Linux 8 (jessie)"
Time : 10:15 AM
RPI : Raspberry PI 3 with active vc1 codec
Camera : SV3C with Resolution 640x360
Mode: modect, single zone covering full frame Default settings
Zoneminder Version : 1.29.0+dfsg-1~bpo8+1 ( from repo )
FFMpeg version : 7:3.2.4-1~bpo8+1 ( from repo, no h264_mmal codec)
Code: Select all
PIDSTAT zmc : Reporting average of 12 readings at 5 seconds intervals
ZMC Process ID : 507 ==> ( 25.40 + 26.60 + 26.80 + 25.80 + 25.80 + 25.80 + 26.00 + 27.00 + 25.80 + 26.00 + 25.20 + 25.00 ) / 12
AVERAGE : 25.93
ZMC Process ID : 545 ==> ( 26.20 + 26.20 + 18.80 + 30.00 + 25.80 + 26.40 + 26.20 + 26.40 + 25.60 + 26.40 + 26.60 + 26.00 ) / 12
AVERAGE : 25.88
PIDSTAT zma : Reporting average of 12 readings at 5 seconds intervals
ZMA Process ID : 554 ==> ( 27.00 + 26.40 + 26.20 + 26.00 + 25.80 + 25.80 + 25.60 + 25.60 + 26.40 + 26.00 + 26.80 + 26.00 ) / 12
AVERAGE : 26.13
ZMA Process ID : 729 ==> ( 26.60 + 26.00 + 26.00 + 25.80 + 25.40 + 26.40 + 25.40 + 26.20 + 26.00 + 25.80 + 26.40 + 26.60 ) / 12
AVERAGE : 26.05
OS: Raspbian "GNU/Linux 8 (jessie)"
Time : 10:40 AM
RPI : Raspberry PI 3 with active vc1 codec
Camera : SV3C with Resolution 640x360
Mode : modect, single zone covering full frame Default settings
Zoneminder Version: zoneminder tarball 5/12/17 with neon optimizations ( I added the h264_mmal line)
FFMpeg version : 7:3.2.4-1~bpo8+1 ( from repo, h264_mmal codec available )
Code: Select all
PIDSTAT zmc : Reporting average of 12 readings at 5 seconds intervals
ZMC Process ID : 6897 ==> ( 10.60 + 10.80 + 10.60 + 10.20 + 10.20 + 11.20 + 11.80 + 10.40 + 10.80 + 10.80 + 10.40 + 10.60 ) / 12
AVERAGE : 10.70
ZMC Process ID : 6937 ==> ( 10.00 + 9.80 + 11.00 + 11.40 + 10.40 + 9.80 + 10.40 + 10.40 + 10.20 + 7.40 + 14.00 + 10.20 ) / 12
AVERAGE : 10.42
PIDSTAT zma : Reporting average of 12 readings at 5 seconds intervals
ZMA Process ID : 6906 ==> ( 19.80 + 18.00 + 22.00 + 18.20 + 20.20 + 19.20 + 19.40 + 18.40 + 17.80 + 18.40 + 18.00 + 18.40 ) / 12
AVERAGE : 18.98
ZMA Process ID : 6946 ==> ( 18.20 + 19.00 + 19.40 + 21.40 + 20.00 + 19.80 + 19.00 + 18.40 + 19.60 + 19.00 + 9.60 + 18.20 ) / 12
AVERAGE : 18.47
I wrote a bash script for this for anyone interested in testing:
Code: Select all
#!/bin/bash
interval=5
numreports=12 #1 minute
tail_n=$((${numreports} +1))
zmc_array=(`ps ax | grep -w z[m]c | awk '{print $1}'`)
echo "PIDSTAT zmc : Reporting average of $numreports readings at $interval seconds intervals"
for i in "${zmc_array[@]}"
do
zmc=(`pidstat -p $i -u $interval $numreports | tail -${tail_n} | awk '{print $7}'`)
bc_arg=();
zm_counter=${#zmc[@]}
for j in "${zmc[@]}"
do
((zm_counter--))
if [ $zm_counter -gt 0 ]; then
bc_arg=(${bc_arg[@]} "$j + ")
fi
done
bc_arg=(`echo ${bc_arg[@]} | sed 's/..$//g'`)
echo ""
echo "ZMC Process ID : $i ==> ( ${bc_arg[@]} ) / ${numreports} "
echo "AVERAGE : ${zmc[$((${#zmc[@]}-1))]}"
done
echo ""
zma_array=(`ps ax | grep -w z[m]a | awk '{print $1}'`)
echo "PIDSTAT zma : Reporting average of $numreports readings at $interval seconds intervals"
for i in "${zma_array[@]}"
do
zma=(`pidstat -p $i -u $interval $numreports | tail -${tail_n} | awk '{print $7}'`)
bc_arg=();
zm_counter=${#zma[@]}
for j in "${zma[@]}"
do
((zm_counter--))
if [ $zm_counter -gt 0 ]; then
bc_arg=(${bc_arg[@]} "$j + ")
fi
done
bc_arg=(`echo ${bc_arg[@]} | sed 's/..$//g'`)
echo ""
echo "ZMA Process ID : $i ==> ( ${bc_arg[@]} ) / ${numreports} "
echo "AVERAGE : ${zma[$((${#zma[@]}-1))]}"
done
echo ""
It's certainly faster. I wish somebody would test with more than 2 h264 cameras to see what happens. I am wondering how many can be supported by a single RPI3.
It seems switching to 32 bit color depth gives zmc a performance boost although, not zma.
32 bit color:
Code: Select all
PIDSTAT zmc : Reporting average of 12 readings at 5 seconds intervals
ZMC Process ID : 5517 ==> ( 8.80 + 6.60 + 6.60 + 6.80 + 8.00 + 7.20 + 8.00 + 7.60 + 7.40 + 5.80 + 6.39 + 7.40 ) / 12
AVERAGE : 7.22
ZMC Process ID : 5527 ==> ( 8.60 + 8.80 + 8.60 + 8.60 + 9.00 + 6.60 + 6.20 + 8.00 + 7.20 + 7.40 + 7.40 + 6.80 ) / 12
AVERAGE : 7.77
PIDSTAT zma : Reporting average of 12 readings at 5 seconds intervals
ZMA Process ID : 4954 ==> ( 18.20 + 21.80 + 23.00 + 19.20 + 19.00 + 15.60 + 22.60 + 24.20 + 24.00 + 24.80 + 22.40 + 16.60 ) / 12
AVERAGE : 20.95
ZMA Process ID : 5011 ==> ( 21.60 + 23.60 + 23.60 + 23.20 + 23.40 + 16.20 + 0.00 + 20.00 + 22.20 + 23.80 + 20.20 + 21.60 ) / 12
AVERAGE : 19.95
24 bit color:
Code: Select all
PIDSTAT zmc : Reporting average of 12 readings at 5 seconds intervals
ZMC Process ID : 6293 ==> ( 10.60 + 11.00 + 10.40 + 11.80 + 11.20 + 10.20 + 10.40 + 10.60 + 12.00 + 10.80 + 10.20 + 11.00 ) / 12
AVERAGE : 10.85
ZMC Process ID : 6303 ==> ( 10.60 + 10.40 + 10.20 + 9.80 + 9.78 + 10.00 + 10.40 + 10.00 + 10.40 + 10.80 + 10.60 + 10.00 ) / 12
AVERAGE : 10.25
PIDSTAT zma : Reporting average of 12 readings at 5 seconds intervals
ZMA Process ID : 5811 ==> ( 20.80 + 20.20 + 18.80 + 19.00 + 18.40 + 18.20 + 18.40 + 19.00 + 22.40 + 21.00 + 20.00 + 20.20 ) / 12
AVERAGE : 19.70
ZMA Process ID : 5946 ==> ( 18.20 + 18.20 + 18.60 + 20.60 + 18.80 + 19.40 + 18.80 + 18.80 + 18.40 + 19.00 + 21.00 + 19.16 ) / 12
AVERAGE : 19.08
Will libturbo-jpeg provide a performance boost? If so, how can that be used instead of libjpeg?
Thanks,
Chris