[SOLVED] Mint 17.3 No video

Forum for questions and support relating to the 1.29.x releases only.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

[SOLVED] Mint 17.3 No video

Post by zamar17 »

Hi,

I have socket_sendto errors, and there are no files nph-zms found on my system Linux Mint 17.3 when trying to view stream of TOP-201 H264 RTSP IP Cam in ZoneMinder. The folder /usr/lib/zoneminder/cgi-bin contains 2 files: link nph-zms to file zms, and file zms. How to fix that? Should nph-zms be a regular file instead of link? If YES, how to change its file type or get a copy of normal file?

Also, how to find out, what local folder path corresponds to web path to zms streaming server like zm/cgi-bin/nph-zms ?
Last edited by zamar17 on Sun Apr 17, 2016 10:03 pm, edited 5 times in total.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: [SOLVED] Monitor/Camera seems to be working but no video in console

Post by SteveGilvarry »

nph-zms as a symlink is normal, folder definitions are part of Zoneminder's Apache config cgi section, here is one from a standard ubuntu install, would be no need to modify standard zoneminder.conf or install locations for a package. Also it makes one more point to check, that you have run a2enmod cgi.

Code: Select all

# Remember to enable cgi mod (i.e. "a2enmod cgi").
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>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Monitor/Camera seems to be working but no video in console

Post by zamar17 »

I checked all settings, switched off authentication, ZM api and jason links are all green, ZoneMinder is capturing and decoding stream from my TOP-201 H264 RTSP Onvif IP Cam normally, but I still have no picture. Not getting my cam identified with Probe, the list is empty.

Had to choose ffmpeg capture method, since Remote method gives some stream decode errors in addition to socket_sendto errors. Despite Remote method defaults to TCP, I'm getting typical for UDP capture packet drop errors, unless switch to FFMpeg capture. Set 1280x720 pic size, the same command results in perfect pic in ffplay:

Code: Select all

ffplay -rtsp_transport tcp -i 'rtsp://192.168.1.218:554/user=admin_password=admin_channel=1_stream=0.sdp?real_stream'
but in ZM level 9 debug log I'm getting:

Code: Select all

2016-04-14 20:58:10.559936	web_js		32746	ERR	getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-219515s.sock ) failed: No such file or directory - checkStreamForErrors()	?view=watch	
2016-04-14 20:58:10.556951	web_js		32746	DBG	LogOpts: level=DBG/DBG, screen=OFF, database=DBG, logfile=DBG->/var/log/zm/zm_debug.log.32746, weblog=OFF, syslog=INF	/usr/share/zoneminder/www/includes/logger.php	168
While any log level shows normal capture & decode:

Code: Select all

2016-04-14 21:12:57.543865	zmc_m3		713	INF	Elm: 6000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
2016-04-14 21:12:40.374651	zmc_m3		661	INF	Elm: 6000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
2016-04-14 21:12:24.457771	web_php		505	DBG	LogOpts: level=DBG/DBG, screen=OFF, database=DBG, logfile=DBG->/var/log/zm/zm_debug.log.505, weblog=INF, syslog=INF	/usr/share/zoneminder/www/includes/logger.php	168
2016-04-14 21:11:26.684317	zmc_m3		713	INF	Elm: 5000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
2016-04-14 21:11:09.566079	zmc_m3		661	INF	Elm: 5000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
2016-04-14 21:09:55.909451	zmc_m3		713	INF	Elm: 4000 - Capturing at 11.11 fps	zm_monitor.cpp	3131
2016-04-14 21:09:38.734278	zmc_m3		661	INF	Elm: 4000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
Checked /var/run/zm/ , its owned by www-data:www-data. What should I check next? Pls don't suggest to search the forum, I did "almost" everything said on this forum about this particular error.
Last edited by zamar17 on Fri Apr 15, 2016 11:36 am, edited 1 time in total.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: [SOLVED] Monitor/Camera seems to be working but no video in console

Post by bbunge »

You will not like this but:

https://wiki.zoneminder.com/Ubuntu#Guid ... tu_Desktop

If you followed one of the "Easy" Ubuntu install procedures to the letter and are still having problems you have not configured your cameras right. Zoneminder is not at fault for that! And we state time and time again your camera resolution has to be spot on or the cameras will not work...
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Monitor/Camera seems to be working but no video in console

Post by zamar17 »

@ bbunge

On the contrary, I followed to the letter your very clean Guide, while installing on Mint 17.3. I found 2 things:

- you may not like it, but the guide is not exhaustive. There are cases like this one, when following your guide does not result in picture on screen
- if you change user and password in ZM, no matter what you do suggested here or anywhere in the posts, it won't result in green API and jason browser tabs, unless you revert to default user and password

Assuming for a minute that I indeed followed your guides, and set resolution 1280x720 exactly matching my cam 720P reso, what else can I do to get my cam working with ZM? Can you pinpoint to a particular problem or troubleshooting steps rather than generic advice which I already followed? :) ZM keeps a detail log of what's up. Can the above log be used to pinpoint the problem?
Last edited by zamar17 on Fri Apr 15, 2016 2:01 pm, edited 1 time in total.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Mint 17.3 No video

Post by zamar17 »

I got ZM from Isaac Connor's PPA. It offers several versions, I installed 1.29.0-trusty to match Mint 17.3 based on Ubuntu 14.04.4 Trusty. May be ZM is missing some dependencies?

Code: Select all

user@Mint17 ~ $ apt-cache show zoneminder
Package: zoneminder
Priority: optional
Section: net
Installed-Size: 24120
Maintainer: Dmitry Smirnov <onlyjob@debian.org>
Architecture: i386
Version: 1.29.0-trusty
Recommends: apache2 (>= 2.4.7~) | nginx | httpd, libapache2-mod-php5 | php5-fpm, mysql-server | virtual-mysql-server, zoneminder-doc (>= 1.29.0-trusty)
Suggests: fcgiwrap, logrotate
Depends: libavcodec54 (>= 6:9.1-1) | libavcodec-extra-54 (>= 6:9.18), libavformat54 (>= 6:9.1-1), libavutil52 (>= 6:9.1-1), libc6 (>= 2.15), libcurl3-gnutls (>= 7.16.2), libgcc1 (>= 1:4.1.1), libjpeg8 (>= 8c), libmysqlclient18 (>= 5.5.24+dfsg-1), libpcre3, libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.2.1), libswscale2 (>= 6:9.1-1), libvlc5 (>= 1.1.1), zlib1g (>= 1:1.1.4), libjs-mootools (>= 1.4.5~debian1), perl, javascript-common, libav-tools | ffmpeg, libdate-manip-perl, libmime-lite-perl, libmime-tools-perl, libphp-serialization-perl, libmodule-load-conditional-perl, libnet-sftp-foreign-perl, libarchive-zip-perl, libdbd-mysql-perl, libdevice-serialport-perl, libimage-info-perl, libjson-any-perl, libsys-mmap-perl, liburi-encode-perl, libwww-perl, mysql-client | virtual-mysql-client, perl-modules, php5-mysql, policykit-1, rsyslog | system-log-daemon, zip
Filename: pool/main/z/zoneminder/zoneminder_1.29.0-trusty_i386.deb
Size: 2849300
MD5sum: 3323f0040d1ba363cf7b52596b320297
FvdLaar
Posts: 10
Joined: Sat Apr 02, 2016 12:55 pm

Re: Mint 17.3 No video

Post by FvdLaar »

I had socket errors too. After long investigation I found out it's a webserver config mistake! Might work for you too.

Apache2 on Ubuntu 14.04 or later:
- disable all sites (list of sites by executing command line: "sudo ls /etc/apache2/sites-enabled -al")
- enable zoneminder.conf
- restart of reload Apache

Worked form me as long as I followed the regular installation instructions!

Even provides the solution for a similar problem when trying a clean install of Zoneminder on Docker on top op Ubuntu Host.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Mint 17.3 No video

Post by zamar17 »

Hi FvdLaar,

I did have an extra site and followed your topic to disable it. Unfortunately, it didn't help. After ZM reinstall (of course by following the reknown guide), I'm getting exact same errors:

Code: Select all

2016-04-15 20:49:34.363366	web_js		13393	ERR	getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-178436s.sock ) failed: No such file or directory - checkStreamForErrors()	?view=watch	
2016-04-15 20:49:34.342519	web_php		13393	ERR	socket_sendto( /var/run/zm/zms-178436s.sock ) failed: No such file or directory	/usr/share/zoneminder/www/includes/functions.php	2371
2016-04-15 20:48:44.233113	web_js		13390	ERR	TypeError: e[c] is undefined	http://127.0.0.1/zm/tools/mootools/mootools-more.js	1
2016-04-15 20:48:36.565568	zmc_m1		13813	INF	Elm: 1000 - Capturing at 10.99 fps	zm_monitor.cpp	3131
I'm using just ZM own embedded viewer, it opens by clicking on the monitor name. Not sure what causes the mootools error, and subsequent socket errors. API and Jason test pages are "green", I didn't enable authentication. Of course, no video in ZM, but perfect video in both VLC and FFPlay using the same command. Is there anything else I can look at (besides following the Install Guide again)? I don't think its realistic to re-install Mint as the next step. Note there is no attempt from ZM staff to troubleshoot the issue, since their log wouldn't provide more detail about it at any log level. They never commented on the forum on motools issue either, probably a symlink type error. :)

Do you know what viewer type ZM uses internally to display the stream? Is it QT-based, does it use QuickTime for H264 RTSP streams? Or its VLC plugin based? It looks like the viewer opens just another Firefox page, and of course it shows no video.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Mint 17.3 No video

Post by bbunge »

Why don't you start by giving us your camera make/model and how you have it configured in Zoneminder?

Did you enable CGI?

Did you do the last step in the install procedure?

If you want to try an install that works out of the box see:
https://wiki.zoneminder.com/Lubuntu_14. ... _CD_or_USB
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Mint 17.3 No video

Post by zamar17 »

Thanks for not answering my Q about viewer type used by ZM. It seems to be a top secret, can't find info on the web either. YES, I followed you Install Guide.

In contrast, I gave above info about the IP Cam and settings here. Just added another cam type for testing, old Logitech QuickTime Communicate STX, settings it exactly as stated here. Everything is green except log, no luck either, same socket errors, but it plays perfect in Cheese.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Mint 17.3 No video

Post by zamar17 »

@bbunge

I just tried ZM ISO running in the same VMWare. I have to admit, it works perfect, very clean, USB cam was recognized by Probe, IP Cam not, but both gave good videos right away. IP Cam worked with both Remote and FFMpeg settings, I used the same options as before. Remote gave decode errors likely dropping some frames, but pic is stable and clean. FFMpeg gave no errors at all. Libvic gives decode errors, likely needs extra options, since in VLC the IP cam shows up OK (without extra options). As ZM Remote preset likely uses FFMpeg, may I suggest to add -rtsp_transport tcp option to it, otherwise it shows a flow of dropped frame errors. No place in Remote GUI to add this option, but it seems preset for FFMpeg source.

Overall I'm glad to finally move forward to study ZoneMinder features. Not sure however, if I install Ubuntu from scratch, the preview results will be the same as playing the ISO setup by the dev pros. Also, no web_php option visible in log features, possibly due to some packages installed being different from mine. :)
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Mint 17.3 No video

Post by SteveGilvarry »

FYI your log shows the camera is capturing fine, you just have some issues with you cgi-bin configuration, which is not part of ZM, just required to be setup in Apache in the way ZM expects it to be. Normally this error will pop every time you click on the monitor to view it.

If you are still interested in solving Mint issues please provide the following data.
Contents of /etc/apache2/sites-enabled, so list the files so we can be sure you only have one config enabled and if one is Zoneminder.conf then paste it's contents, if not then post your actual apache config in use.

Run 'apachectl -m | grep cgi' paste returned result.

Copy ZMS_PATH value from Zoneminder config page.


ffmpeg is the primary monitor type for IP cameras, the Remote doesn't always work with all cameras and libvlc was an alternate option that no volunteers work on that much. Remote and ffmpeg both use RTP/RTSP method control to force TCP.

We don't have a 'viewer', it is a stream, jpeg or mpeg based, generated by a program running under CGI apache or nginx. All source is freely available on github so no idea how we would be keeping it secret.

Didi you work out what trusty etc were on the PPA, and how they relate to Mint? It is Ubuntu version and Mint 17.3 is based on Trusty

Post your version of moo tools maybe Mint is installing a new version.

If you choose to change the default database user you will need to update it in zm.conf and database.php(For API only)

I think that is all your questions, you have bounced around quite a lot, but your issue is CGI config if everything works except for viewing stream, just need to find the right lever.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Mint 17.3 No video

Post by bbunge »

I just installed Mint 17.3 x64 on a Dell i5 with 6 GIG RAM. After doing updates I installed tasksel which I used to install LAMP. I then followed the Ubuntu 14.04 - ZM 1.29.0 install from the WIKI, added a local camera and a Foscam IP camera.

I have no problems viewing the cameras or recorded events!

bb
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: Mint 17.3 No video

Post by zamar17 »

@ SteveGilvarry

Thanks for the detail reply and willingness to troubleshoot:

Code: Select all

user@Mint17 ~ $ sudo ls /etc/apache2/sites-enabled
[sudo] password for user: 
000-default.conf

user@Mint17 ~ $ sudo ls /etc/apache2/sites-enabled -al
total 8
drwxr-xr-x 2 root root 4096 Apr 15 19:41 .
drwxr-xr-x 8 root root 4096 Apr  9 18:25 ..

user@Mint17 ~ $ apachectl -M | grep cgi
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
 cgi_module (shared)
 
user@Mint17 ~ $ apt-cache policy libjs-mootools
libjs-mootools:
  Installed: 1.4.5~debian1-2.1
  Candidate: 1.4.5~debian1-2.1
  Version table:
 *** 1.4.5~debian1-2.1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
        100 /var/lib/dpkg/status
In WebUI:

Code: Select all

PATH_ZMS 	Web path to zms streaming server (?) 	/cgi-bin/nph-zms
zoneminder.conf

Code: Select all

# Remember to enable cgi mod (i.e. "a2enmod cgi").
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>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
    AllowOverride All
</Directory>
appache2.conf

Code: Select all

# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#	/etc/apache2/
#	|-- apache2.conf
#	|	`--  ports.conf
#	|-- mods-enabled
#	|	|-- *.load
#	|	`-- *.conf
#	|-- conf-enabled
#	|	`-- *.conf
# 	`-- sites-enabled
#	 	`-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.


# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5


# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

<Directory /usr/share>
	AllowOverride None
	Require all granted
</Directory>

<Directory /var/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

#<Directory /srv/>
#	Options Indexes FollowSymLinks
#	AllowOverride None
#	Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
	Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Last edited by zamar17 on Sat Apr 16, 2016 5:14 pm, edited 1 time in total.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Mint 17.3 No video

Post by bbunge »

Your PATH_ZMS is wrong. You did not do the last step in the install procedure!

Open Zoneminder in a web browser (http://server-ip/zm).

Click on Options - Paths Change PATH_ZMS to /zm/cgi-bin/nph-zms
Locked