Event playback issues - Fresh Install with PVE Container [SOLVED]

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Event playback issues - Fresh Install with PVE Container [SOLVED]

Post by jeremyb »

Hello,

Issue:
When opening an event, it will start playback at correct rate. If timeline is selected to move forward or backwards, the rate is changed, forward or rewind buttons selected, playback will either stop, slow down or speed up to incorrect speed or just become unresponsive. Errors will also be generated at this time.

Thoughts:
I scrapped any custom configs and I don't think this is an issue with using "bleeding edge" zm. If it is, I will go backwards. I found more issues when I was using prior versions.This happens with Debian as a VM, and Ubuntu containers and VMs. I'm just sticking with the Debian container at the moment for testing. I haven't tried Zoneminder on anything else and have never had this working, so call me new. I'm thinking there has to be a setting change I'm not making after install to have this work. Please move me forward as I like zoneminder a lot, and thanks!


Note:
I get the "web_php ERR socket_sendto( ) failed: Connection refused" error just when viewing individual monitors that are live in zm.


Errors:

5/29/23, 8:25:36 PM UTC web_js 620 ERR getCmdResponse stream error: socket_sendto( /run/zm/zms-800772s.sock ) failed: Connection refused - checkStreamForErrors() ?view=event&eid=1&fid=700 -
5/29/23, 8:25:36 PM UTC web_php 620 ERR socket_sendto( /run/zm/zms-800772s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 8:18:44 PM UTC web_php 620 ERR socket_sendto( /run/zm/zms-170841s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 8:18:34 PM UTC web_php 620 ERR socket_sendto( /run/zm/zms-369683s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php

5/29/23, 9:32:28 PM UTC web_js 1519 ERR getCmdResponse stream error: Socket /run/zm/zms-499989s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=event&eid=21&fid=6700 -
5/29/23, 9:32:28 PM UTC web_php 1519 ERR Socket /run/zm/zms-499989s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 9:32:26 PM UTC web_js 232 ERR getCmdResponse stream error: Socket /run/zm/zms-499989s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=event&eid=21&fid=6700 -
5/29/23, 9:32:26 PM UTC web_php 228 ERR Socket /run/zm/zms-499989s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 9:32:22 PM UTC web_js 706 ERR getCmdResponse stream error: Socket /run/zm/zms-342787s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=event&eid=21&fid=6700 -
5/29/23, 9:32:22 PM UTC web_php 706 ERR Socket /run/zm/zms-342787s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 9:32:20 PM UTC web_js 2776 ERR getCmdResponse stream error: Socket /run/zm/zms-342787s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=event&eid=21&fid=6700 -
5/29/23, 9:32:20 PM UTC web_php 234 ERR Socket /run/zm/zms-342787s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 8:45:55 PM UTC web_php 621 ERR socket_sendto( /run/zm/zms-768878s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 8:44:01 PM UTC web_php 621 ERR socket_sendto( /run/zm/zms-339711s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882

5/29/23, 9:36:48 PM UTC web_php 233 ERR socket_sendto( /run/zm/zms-228202s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882

5/29/23, 9:58:18 PM UTC web_php 777 ERR No data to read from socket /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 9:58:18 PM UTC web_php 777 ERR Timed out waiting for msg /run/zm/zms-639813s.sock /usr/share/zoneminder/www/ajax/stream.php 114
5/29/23, 9:57:37 PM UTC web_php 706 ERR socket_sendto( /run/zm/zms-112282s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/29/23, 9:36:48 PM UTC web_php 233 ERR socket_sendto( /run/zm/zms-228202s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882

5/29/23, 11:31:11 PM UTC zms_e78 4477 ERR Can't send /var/cache/zoneminder/events/3/2023-05-29/78/02603-capture.jpg: Broken pipe zm_eventstream.cpp 731
5/29/23, 11:31:11 PM UTC zms_e78 4477 WAR Unable to send raw frame 2603: Broken pipe 23262 remaining zm_eventstream.cpp 1091
5/29/23, 10:03:51 PM UTC web_php 233 ERR socket_sendto( /run/zm/zms-334587s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882


Only thing I've tried besides searching for answers:
sudo zmupdate.pl
sudo zmupdate.pl -f


SERVER:
This is a fresh install with the following configuration:
- Latest Proxmox VE on Dell R710 (24 x Intel(R) Xeon(R) CPU X5670 @ 2.93GHz (2 Sockets)) w/ H700 HW RAID - RAID1 (2) SSD & RAID1 (2) HDD
- Container: 8 Cores, 32GiB Ram, 4GiB Swap, 500GiB Disk - Unprivileged and Nesting - Running Debian 11
- Latest Zoneminder v1.36.33 from ZM repo
- (3) 720p and (1) 1080p Ubiquiti Cam streams from RTSP Service

CLIENT:
- OS: Latest Windows 10
- Browsers: Latest Firefox, Chrome and Edge (Same issue on all)

NETWORK:
- Gigabit Ethernet
- Client to Switch to Server


*** You may not need further information, but here it is if you do ***


Install procedure:

####Debian 11
####PVE Container

##Initial Container Setup

##root login with console

#Update/Upgrade
apt update
apt upgrade

#Install sudo
apt install sudo

#Add sudo user
adduser jeremy
usermod -aG sudo jeremy

#Set timezone
timedatectl set-timezone UTC
timedatectl show

#Set timezone in PHP (doesn't seem to work - review later)
nano /etc/php/7.4/cli/php.ini
date.timezone = UTC

#reboot
reboot

#*Take snapshot*

##Install Zoneminder + LAMP / wiki method - (official failed) (https://wiki.zoneminder.com/Debian_11_B ... der_1.36.x)

#Install LAMP
sudo apt install apache2 php mariadb-server php-mysql libapache2-mod-php

#Secure MySQL or Mariadb, create root password et. al.
sudo mysql_secure_installation

current PW: enter for none
socket auth: Y
Change Root PW: Y (enter your new root mysql Password)
Remove anon: Y
Remove Remote: Y
Remove test: Y
Reload Priv: Y


#Mariadb additional settings The default values for the database are adequate for initial setup. However, I recommend you make these changes before installing Zoneminder. Note: If you have sufficient memory double the values below. Edit the Mariadb config file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Add the following in the [mysql] area:

innodb_file_per_table = ON
innodb_buffer_pool_size = 256M
innodb_log_file_size = 32M

*Note: it's mysqld area, not mysql

#Reatart Mariadb:
sudo service mysql restart

#Create install script
nano zm-install

#!/bin/sh
clear
read -p "This script installs ZoneMinder 1.36.x on Debian 11 with LAMP (MySQL or Mariadb) installed...
This script must be run as root!
Press Enter to continue or Ctrl + c to quit" nothing
clear
apt install -y lsb-release gnupg2
echo "deb https://zmrepo.zoneminder.com/debian/release-1.36 "`lsb_release -c -s`"/" | sudo tee /etc/apt/sources.list.d/zoneminder.list
wget -O - https://zmrepo.zoneminder.com/debian/ar ... eyring.gpg | sudo apt-key add -
read -p "Warning! Check above to insure the line says OK. If not the GPG signing key was not installed and you will need to figure out why before continuing.
Press enter to continue" nothing
apt update
clear
apt install -y zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload
clear
read -p "Install complete. Open Zoneminder/Options and set the timezone. Press enter to continue" nothing
clear

#change permissions
chmod 755 zm-install

#execute
sudo ./zm-install

#WORKING!!!!!!!!!!!!

##Basic initial setting changes on GUI
Options -> System -> LANG_DEFAULT = en_us
Options -> System -> TIMEZONE = UTC
Options -> System -> TELEMETRY_DATA = "uncheck"
Options -> Logging -> LOG_LEVEL-DATABASE = Warning


#*Take snapshot*


##Add Cameras on GUI
Console -> ADD -> ...
General:
Name = Office
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349744_0
Capture Resolution = 720p
Console -> ADD -> ...
General:
Name = Dining Room and Kitchen
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349745_0
Capture Resolution = 720p
Console -> ADD -> ...
General:
Name = Back Door
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349743_0
Capture Resolution = 720p
Console -> ADD -> ...
General:
Name = Tower - Lower
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349740_0
Capture Resolution = 1080p


#*Take snapshot*
Last edited by jeremyb on Tue May 30, 2023 4:36 am, edited 1 time in total.
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: Event playback issues - Fresh Install with PVE Container

Post by jeremyb »

Okay, I kept reading, then found "ZM for Dummies" and seen "JPEG saving, should be avoided on H264 streams when possible. Use H264 passthrough. Consider how decoding the H264 stream to JPEG uses CPU, while passthrough will avoid this conversion step." under tips.

Also under RTSP it explains "H264 is recommended when possible. Note: Users with 1.32+ can use H264 passthrough, which writes the h264 direct to mp4, and saves some CPU usage."

Now I think I might need to setup two streams because it mentions "You can record everything (good, but no way to find events). You can modect everything (light HDD use, but misses stuff). You can mocord everything (better, but uses HDD, and event list timeline in ZMNinja shows 10 minute segments). But all of these are flawed. Here's what you do: always record two streams per camera. One, the low res stream, is set to mocord/modect, with reasonable (but no need to be perfect) settings for detection. Two, the high res stream is set to either record and uses h264 passthrough.* The hi res compressed stream is saved directly to disk. Decoding and Analysis should be disabled as well in the source menu. See also this link for a way to use a high res stream under analysis with less CPU: viewtopic.php?f=10&t=31334&p=124410"

Conclusion:
Until I test this out, my understanding is... since I have h264 cameras, its best to use "passthrough" for the "video writer". this issue would still exists if I had to keep "video writer" set to "disabled".
I would have avoided this issue entirely if this information was in the Ubiquiti Cam setup wiki, as they are compatible for this.


My current setup until i setup two streams:

##Add Cameras on GUI
Console -> ADD -> ...
General:
Name = Office
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349744_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough
Console -> ADD -> ...
General:
Name = Dining Room and Kitchen
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349745_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough
Console -> ADD -> ...
General:
Name = Back Door
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349743_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough
Console -> ADD -> ...
General:
Name = Tower - Lower
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349740_0
Capture Resolution = 1080p
Storage:
Video Writer = Camera Passthrough
Last edited by jeremyb on Tue May 30, 2023 4:42 am, edited 1 time in total.
User avatar
burger
Posts: 386
Joined: Mon May 11, 2020 4:32 pm

Re: Event playback issues - Fresh Install with PVE Container

Post by burger »

jeremyb wrote: Tue May 30, 2023 12:51 am Conclusion:
Until I test this out, my understanding is... if you don't have h264 compatible cameras and must use jpeg, this issue still exists and isn't avoidable.
I would have avoided this issue if this information was in the Ubiquiti Cam setup wiki, as they are compatible for this.
I'm not sure if event playback issues are related to whether ZM uses h264 or jpeg. I've never noticed that, although it's possible. With enough CPU, you shouldn't have too much trouble.

Usually most questions have been answered on the forum, so always search there first.
viewtopic.php?p=130305
viewtopic.php?p=130577

What is the ubiquiti cam model you are using and what path? There is usually an RTSP/H264 path on all cameras nowadays.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: Event playback issues - Fresh Install with PVE Container

Post by jeremyb »

Thanks. Everything is resolved with this issue now except I keep getting the following errors in the log:

5/30/23, 4:07:37 AM UTC web_php 1361 ERR No data to read from socket /usr/share/zoneminder/www/includes/functions.php 1882
5/30/23, 4:07:37 AM UTC web_php 1361 ERR Timed out waiting for msg /run/zm/zms-841428s.sock /usr/share/zoneminder/www/ajax/stream.php 114
5/30/23, 4:07:32 AM UTC web_php 755 ERR socket_sendto( /run/zm/zms-050126s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/30/23, 4:07:27 AM UTC web_php 1361 ERR socket_sendto( /run/zm/zms-020058s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882


Playback is amazing since switching to passthrough. I'm going to mark this as solved and if i can't find an answer to the socket issue, just make another post. I'm searching and trying all sorts of things right now.

They are Gen3 UVC Cams. They were setup with their RTSP paths but had to change the default option to passthrough to get the benefit.
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: Event playback issues - Fresh Install with PVE Container [SOLVED]

Post by jeremyb »

I also modified my conclusion. haha

Until I test this out, my understanding is... since I have h264 cameras, its best to use "passthrough" for the "video writer". this issue would still exists if I had to keep "video writer" set to "disabled".
I would have avoided this issue entirely if this information was in the Ubiquiti Cam setup wiki, as they are compatible for this.
Headread
Posts: 1
Joined: Wed May 31, 2023 4:00 am

Re: Event playback issues - Fresh Install with PVE Container [SOLVED]

Post by Headread »

Great. I fixed my issue


papa's pizzeria
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: Event playback issues - Fresh Install with PVE Container [SOLVED]

Post by jeremyb »

Some of the pain getting things to work property had to do with the following as well:

viewtopic.php?p=130673#p130673
Post Reply