Video Playback Error in events feature-h264-videostorage

Forum for questions and support relating to the 1.31.x releases only.
Locked
bruno_mlopes
Posts: 2
Joined: Wed Aug 02, 2017 3:13 am

Video Playback Error in events feature-h264-videostorage

Post by bruno_mlopes »

I installed ZoneMinder 1.31.3 from ppa:iconnor/zoneminder-storageareas in Ubuntu 16.04.02 usinghttps://wiki.zoneminder.com/Shell_script_zm_install and directly using just apt-get install zoneminder, both methods the ZoneMinder worked partially, I could add a monitor using rtsp h264 onvif, watch real-time video camera in browser and record the events through Modect and H264 Camera Passthrough with no sound, the file is recorded but I can't watch it in browser, I can watch the video opening the file in VLC. I see a black image in browser with the message The video could not be loaded, either because the server or network failed or because the format is not supported. The errors are:

In browser:

Code: Select all

Request URL:http://localhost/zm/index.php?view=view_video&eid=1
Request Method:GET
Status Code:404 Not Found
Remote Address:localhost:80
Referrer Policy:no-referrer-when-downgrade
And in log:

Code: Select all

Date/Time			Component	PID	Level	Message	File																																																																															Line
2017-08-02 00:25:04.045457	web_js		36848	ERR	getCmdResponse stream error: Socket /var/run/zm/zms-459334s.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/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information. - checkStreamForErrors()	?view=event	
2017-08-02 00:25:04.025566	web_php		36848	ERR	Socket /var/run/zm/zms-459334s.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/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.	/usr/share/zoneminder/www/includes/functions.php	2032
2017-08-02 00:25:02.275262	web_js		36846	ERR	Uncaught TypeError: Cannot read property 'hasClass' of null	http://192.168.1.106/zm/skins/classic/views/js/event.js	214
2017-08-02 00:25:01.767502	web_js		36851	ERR	Uncaught ReferenceError: addVideoTimingTrack is not defined	http://192.168.1.106/zm/index.php?view=event	184
2017-08-02 00:24:57.224882	web_js		36854	ERR	Uncaught TypeError: Cannot read property 'isDisplayed' of undefined	http://192.168.1.106/zm/tools/mootools/mootools-more.js	1
Configuration in /etc/zm/conf.d/01-system-paths.conf

Code: Select all

ZM_DIR_EVENTS=/var/cache/zoneminder/events
ZM_DIR_IMAGES=/var/cache/zoneminder/images
ZM_DIR_SOUNDS=sounds
ZM_DIR_EXPORTS=/tmp/zm
ZM_PATH_ZMS=/zm/cgi-bin/nph-zms
ZM_PATH_MAP=/dev/shm
ZM_PATH_SOCKS=/var/run/zm
Configuration in /etc/apache2/conf-enabled/zoneminder.conf

Code: Select all

ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>

Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
  Options -Indexes +FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
The owner of symbolic link nph-zms was root and I got "Forbidden Access" when tried http://localhost/zm/cgi-bin/nph-zms, when I changed the owner, the message in browser stopped but the error is the same. /usr/lib/zoneminder/cgi-bin

Code: Select all

   0 lrwxrwxrwx 1 www-data www-data       3 Jul 31 13:14 nph-zms -> zms
1540 -rwxrwxrwx 1 www-data www-data 1574176 Jul 31 13:14 zms
I tried other configurations for ZM_PATH_ZMS but the default seems ok. I spent hours reading a lot of posts in this forum and in the internet but nothing I tried have worked. Is there any other configuration I must check?
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Video Playback Error in events feature-h264-videostorage

Post by iconnor »

The issue may have been fixed. Yesterday (August 2, around 4pm), I fixed a problem that caused the stored h264 stream to be corrupt when the camera delivers the audio on stream 0 and the video on stream 1. We store it the other way around.

So please update and let me know if that fixes your problem.
bruno_mlopes
Posts: 2
Joined: Wed Aug 02, 2017 3:13 am

Re: Video Playback Error in events feature-h264-videostorage

Post by bruno_mlopes »

Hi, I upgraded the version to the last in ppa (1.31.3~20170802161639-xenial) and the problem still exists and I have a new one now: the page that I watch the real-time camera does not show the status and I can't use the "Force Alarm" option. The errors I get are:

Code: Select all

2017-08-05 14:19:02.152571	web_js		91995	ERR	Uncaught TypeError: Cannot read property 'send' of undefined	http://192.168.1.111/zm/skins/classic/views/js/watch.js	376
2017-08-05 14:18:25.275635	web_js		91999	ERR	Uncaught ReferenceError: auth_hash is not defined	http://192.168.1.111/zm/skins/classic/views/js/watch.js	97
I tried changing the AUTH_RELAY to None but nothing happend. I don't remember the version but old ppa with h264 and without videostorage was working well.
digital-gnome
Posts: 17
Joined: Mon Sep 04, 2017 12:47 am

Re: Video Playback Error in events feature-h264-videostorage

Post by digital-gnome »

I know this is going on a month old but in case you haven't given up and for future searches here's my experience with those errors.

For the non-playing video problem I've had this with new installs. For me it's usually a time zone issue. If I forget to set the system time zone (or php time zone) zoneminder will save it to the wrong directory. I then remember to set the time zone but forget to restart mysql. So double check both system timezone and php timezone and either reboot or restart apache/mysql.

For the problem with no controls and undefined errors I fixed mine by enabling OPT_USE_AUTH and AUTH_HASH_LOGINS. Alternatively you can add

Code: Select all

var auth_hash;
above

Code: Select all

<?php if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS ) { ?>
var auth_hash = '<?php echo isset($_SESSION['AuthHash']) ? $_SESSION['AuthHash'] : ''; ?>';
<?php } ?>
in /usr/share/zoneminder/www/skins/classic/js/skin.js.php

It probably isn't a real fix but it's simple and it works.
pavlo
Posts: 11
Joined: Wed Jan 09, 2019 11:46 pm

Re: Video Playback Error in events feature-h264-videostorage

Post by pavlo »

I spent a day tracking down this error when I experimented with H264 passthrough a few days ago, and just want to confirm that the error "The video could not be loaded, either because the server or network failed or because the format is not supported" I was getting when trying to view H264 events was due to mismatched timezones, server was on Etc/GMT+8 and php.ini was on America/Vancouver. I changed the server's time zone last winter as I wanted it to stop observing daylight savings due to a little timelapse experiment I've got going on as a side-project.
Locked