Events Capturing frames but no Video

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
epicfatigue
Posts: 14
Joined: Sun Jan 15, 2017 1:15 am

Events Capturing frames but no Video

Post by epicfatigue » Wed Jan 02, 2019 4:57 am

Hey Guys,

Love the new Update for Zoneminder.

The Issues i am having is everything is working perfectly except when viewing the event i am getting the typical
"The video could not be loaded either becahse of the server or network failed or because the format is not supported"

The event is storing the Frames as expect and i am able to view these via event just not the video.
The video appears to be there however it is only a few kb.
Error log doesnt appear to contain anything suspicious.

When clicking download button however i am getting this.
2019-01-02 15:42:13 web_php 44689 ERR No events found for download using SELECT E.Id,E.DiskSpace FROM Events as E WHERE 1 and ( ( E.StartTime >= '2019-01-02 03:45:49' and E.StartTime <= '2019-01-01 08:38:22' ) and E.MonitorId in ('1') ) skins/classic/views/download.php 38

I have checked log times look good and is set in PHP conf not sure where to go from here.

I am running on the following
OS: FreeNAS-11.2-RELEASE-U1
Processor:Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz (8 cores)
Memory:32 GiB

bbunge
Posts: 2333
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Events Capturing frames but no Video

Post by bbunge » Thu Jan 03, 2019 12:55 am

I do not have experience with BSD but, time permitting, will download and install a copy on my test machine. Can I assume your Zoneminder version is 1.30.4?

epicfatigue
Posts: 14
Joined: Sun Jan 15, 2017 1:15 am

Re: Events Capturing frames but no Video

Post by epicfatigue » Thu Jan 03, 2019 2:28 am

Sorry about that i must have deleted that out of the comments.
If you are installing the plugin they have forgotten to add the following it has been added to the repo for FREENAS
Once making the below changes you will have the identical install to me.


vi /usr/local/etc/nginx/conf.d/zoneminder.conf

location /cache {
alias /var/cache/zoneminder;
}

sudo service nginx restart

mkdir /var/db/zoneminder/events
mkdir /var/db/zoneminder/images

chown www:www /var/db/zoneminder/events
chown www:www /var/db/zoneminder/images/

bbunge
Posts: 2333
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Events Capturing frames but no Video

Post by bbunge » Thu Jan 03, 2019 3:12 am

There is another "patch" for NGINX. Used to be in the WIKI for Ubuntu 16.04. Will have to look for it tomorrow.

Found it

Note: 29JUL18 Thanks to Tiver for this suggestion that seems to work with the fcgiwrap issue.

If it does not exist create

nano /etc/default/fcgiwrap

and insert (with the number of children -c equal to the number of cameras)

DAEMON_OPTS=-c 10

then restart the fcgiwrap service.

systemctl restart fcgiwrap

epicfatigue
Posts: 14
Joined: Sun Jan 15, 2017 1:15 am

Re: Events Capturing frames but no Video

Post by epicfatigue » Thu Jan 03, 2019 3:52 am

the version of freenas i have appears to have the fcgiwrap running.
However it is located at "/usr/local/etc/rc.d/fcgiwrap"

root@zoneminder:/usr/local/etc/rc.d # ps aux | grep fcgiwrap
www 77054 0.0 0.0 6388 2104 - IsJ 14:39 0:00.00 daemon: /usr/local/sbin/fcgiwrap[77055] (daemon)
www 77055 0.0 0.0 6356 2072 - IJ 14:39 0:00.00 /usr/local/sbin/fcgiwrap -s unix:/var/run/fcgiwrap/fcgiwrap.sock -c 4
www 77057 0.0 0.0 6356 2144 - IJ 14:39 0:00.03 /usr/local/sbin/fcgiwrap -s unix:/var/run/fcgiwrap/fcgiwrap.sock -c 4
www 77058 0.0 0.0 6356 2080 - IJ 14:39 0:00.00 /usr/local/sbin/fcgiwrap -s unix:/var/run/fcgiwrap/fcgiwrap.sock -c 4
www 77059 0.0 0.0 6356 2080 - IJ 14:39 0:00.00 /usr/local/sbin/fcgiwrap -s unix:/var/run/fcgiwrap/fcgiwrap.sock -c 4
www 77060 0.0 0.0 6356 2080 - IJ 14:39 0:00.00 /usr/local/sbin/fcgiwrap -s unix:/var/run/fcgiwrap/fcgiwrap.sock -c 4


The config file seems pretty extensive

Code: Select all

#!/bin/sh

# $FreeBSD$
#
# fcgiwrap startup script
#
# PROVIDE: fcgiwrap
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# fcgiwrap_enable="YES"
#
# You can fine tune others variables too:
# fcgiwrap_socket="unix:/var/run/fcgiwrap.sock"
# this could also be:
# - tcp:[ipv4_addr]:port (for ipv4)
# - tcp6:[ipv6_addr]:port (for ipv6)
# fcgiwrap_flags=
# Use fcgiwrap_user to run fcgiwrap as user
# Use fcgiwrap_group to run fcgiwrap as group
# Use fcgiwrap_socket_mode to change the mode of the socket
# Use fcgiwrap_socket_owner to change the owner of the socket
# Use fcgiwrap_socket_group to change the group of the socket

# fcgiwrap rc.d script supports multiple profiles (a-la rc.d/nginx)
# When profiles are specified, the non-profile specific parameters become defaults.
# You need to make sure that no two profiles have the same socket parameter.
#
# Example:
#
# fcgiwrap_enable="YES"
# fcgiwrap_profiles="myserver myotherserver"
# fcgiwrap_flags="-c 4"
# fcgiwrap_socket_owner="www"
# fcgiwrap_myserver_socket="unix:/var/run/fcgiwrap.myserver.socket"
# fcgiwrap_myserver_user="myuser"
# fcgiwrap_myserver_group="mygroup"
# fcgiwrap_myotherserver_socket="unix:/var/run/fcgiwrap.myotherserver.socket"
# fcgiwrap_myotherserver_user="myotheruser"
# fcgiwrap_myotherserver_grup="myothergroup"
# fcgiwrap_myserver_socket_mode="0775"
# fcgiwrap_myotherserver_flags=""  # No flags for this profile.

. /etc/rc.subr

name="fcgiwrap"
rcvar=fcgiwrap_enable

fcgiwrap_setfib() {
        if command -v check_namevarlist > /dev/null 2>&1; then
                check_namevarlist fib && return 0
        fi

        ${SYSCTL} net.fibs >/dev/null 2>&1 || return 0

        fcgiwrap_fib=${fcgiwrap_fib:-"NONE"}
        case "$fcgiwrap_fib" in
        [Nn][Oo][Nn][Ee])
                ;;
        *)
                command="setfib -F ${fcgiwrap_fib} ${command}"
                ;;
        esac
}

fcgiwrap_precmd() {
        fcgiwrap_setfib
        install -d -o root -g wheel -m 1777 /var/run/fcgiwrap
}

fcgiwrap_postcmd() {
        # This is only for unix sockets
        case "${fcgiwrap_socket}" in
                unix:*)
                        ;;
                *)
                        return
                        ;;
        esac
        if [ -n "${fcgiwrap_socket_mode}" ]; then
                chmod ${fcgiwrap_socket_mode} ${fcgiwrap_socket#unix:}
        fi
        if [ "${fcgiwrap_socket_owner}" != "${fcgiwrap_user}" ]; then
                chown ${fcgiwrap_socket_owner} ${fcgiwrap_socket#unix:}
        fi
        if [ "${fcgiwrap_socket_group}" != "${fcgiwrap_group}" ]; then
                chgrp ${fcgiwrap_socket_group} ${fcgiwrap_socket#unix:}
        fi
}

fcgiwrap_stop() {
        if [ -s ${pidfile} ]; then
                fcgiwrap_pgrp=$(/bin/ps -o ppid= $(cat ${pidfile}))
        fi
        if [ -z "$fcgiwrap_pgrp" -o "${fcgiwrap_pgrp:-0}" -le 1 ] || ! kill -0 $fcgiwrap_pgrp; then
                [ -n "$rc_fast" ] && return 0
                _run_rc_notrunning
                return 1
        fi
        fcgiwrap_pgrp_pids=$(/bin/pgrep -d ' ' -g ${fcgiwrap_pgrp})
        echo "Stopping ${name}."
        kill -TERM -- -${fcgiwrap_pgrp}
        wait_for_pids ${fcgiwrap_pgrp_pids}

        # Workaround the fact that fcgiwrap doesn't cleanup his socket at stopping
        case ${fcgiwrap_socket} in
                unix*)
                test -S ${fcgiwrap_socket#unix:} && rm -f ${fcgiwrap_socket#unix:}
                ;;
        esac
        rm -f $pidfile
}

pidprefix="/var/run/fcgiwrap/fcgiwrap"
pidfile="${pidprefix}.pid"  # May be a different path if profiles are in use

procname="/usr/local/sbin/${name}"
command="/usr/sbin/daemon"
start_precmd="fcgiwrap_precmd"
start_postcmd="fcgiwrap_postcmd"
stop_cmd="fcgiwrap_stop"

load_rc_config $name

# These are just the defaults, they might get overriden for a specific profile.
fcgiwrap_enable=${fcgiwrap_enable:-"NO"}
fcgiwrap_user=${fcgiwrap_user:-"nobody"}
fcgiwrap_group=${fcgiwrap_group:-"nogroup"}
fcgiwrap_socket=${fcgiwrap_socket:-"unix:/var/run/fcgiwrap/fcgiwrap.sock"}
fcgiwrap_socket_mode=${fcgiwrap_socket_mode:-"0775"}
fcgiwrap_socket_owner=${fcgiwrap_socket_owner:-"nobody"}
fcgiwrap_socket_group=${fcgiwrap_socket_group:-"nogroup"}

fcgiwrap_stop() {
        if [ -s ${pidfile} ]; then
                fcgiwrap_pgrp=$(/bin/ps -o ppid= $(cat ${pidfile}))
        fi
        if [ -z "$fcgiwrap_pgrp" -o "${fcgiwrap_pgrp:-0}" -le 1 ] || ! kill -0 $fcgiwrap_pgrp; then
                [ -n "$rc_fast" ] && return 0
                _run_rc_notrunning
                return 1
        fi
        fcgiwrap_pgrp_pids=$(/bin/pgrep -d ' ' -g ${fcgiwrap_pgrp})
        echo "Stopping ${name}."
        kill -TERM -- -${fcgiwrap_pgrp}
        wait_for_pids ${fcgiwrap_pgrp_pids}

        # Workaround the fact that fcgiwrap doesn't cleanup his socket at stopping
        case ${fcgiwrap_socket} in
                unix*)
                test -S ${fcgiwrap_socket#unix:} && rm -f ${fcgiwrap_socket#unix:}
                ;;
        esac
        rm -f $pidfile
}

pidprefix="/var/run/fcgiwrap/fcgiwrap"
pidfile="${pidprefix}.pid"  # May be a different path if profiles are in use

procname="/usr/local/sbin/${name}"
command="/usr/sbin/daemon"
start_precmd="fcgiwrap_precmd"
start_postcmd="fcgiwrap_postcmd"
stop_cmd="fcgiwrap_stop"

load_rc_config $name

# These are just the defaults, they might get overriden for a specific profile.
fcgiwrap_enable=${fcgiwrap_enable:-"NO"}
fcgiwrap_user=${fcgiwrap_user:-"nobody"}
fcgiwrap_group=${fcgiwrap_group:-"nogroup"}
fcgiwrap_socket=${fcgiwrap_socket:-"unix:/var/run/fcgiwrap/fcgiwrap.sock"}
fcgiwrap_socket_mode=${fcgiwrap_socket_mode:-"0775"}
fcgiwrap_socket_owner=${fcgiwrap_socket_owner:-"nobody"}
fcgiwrap_socket_group=${fcgiwrap_socket_group:-"nogroup"}

# This handles profile specific vars.
if [ -n "$2" ]; then
        profile="$2"
        if [ -n "${fcgiwrap_profiles}" ]; then
                pidfile="${pidprefix}.${profile}.pid"
                eval fcgiwrap_enable="\${fcgiwrap_${profile}_enable:-${fcgiwrap_enable}}"
                eval fcgiwrap_fib="\${fcgiwrap_${profile}_fib:-${fcgiwrap_fib}}"
                eval fcgiwrap_user="\${fcgiwrap_${profile}_user:-${fcgiwrap_user}}"
                eval fcgiwrap_group="\${fcgiwrap_${profile}_group:-${fcgiwrap_group}}"
                eval fcgiwrap_socket="\${fcgiwrap_${profile}_socket:?}"
                eval fcgiwrap_socket_mode="\${fcgiwrap_${profile}_socket_mode:-${fcgiwrap_socket_mode}}"
                eval fcgiwrap_socket_owner="\${fcgiwrap_${profile}_socket_owner:-${fcgiwrap_socket_owner}}"
                eval fcgiwrap_socket_group="\${fcgiwrap_${profile}_socket_group:-${fcgiwrap_socket_group}}"
                eval fcgiwrap_flags="\${fcgiwrap_${profile}_flags:-${fcgiwrap_flags}}"
        else
                echo "$0: extra argument ignored"
        fi
else
        if [ -n "${fcgiwrap_profiles}" -a -n "$1" ]; then
                for profile in ${fcgiwrap_profiles}; do
                        echo "===> fcgiwrap profile: ${profile}"
                        /usr/local/etc/rc.d/fcgiwrap $1 ${profile}
                        retcode="$?"
                        if [ "0${retcode}" -ne 0 ]; then
                                failed="${profile} (${retcode}) ${failed:-}"
                        else
                                success="${profile} ${success:-}"
                        fi
                done
                # It exits so that non-profile rc.d is not started when there are profiles.
                exit 0
        fi
fi

# run_rc_command would send ${name}_flags as parameters to $command (daemon)
# This ensures they are actually passed to fcgiwrap instead.
actual_fcgiwrap_flags="${fcgiwrap_flags}"
fcgiwrap_flags=""
command_args="-f -p ${pidfile} ${procname} -s ${fcgiwrap_socket} ${actual_fcgiwrap_flags}"
fcgiwrap_saved_umask=$(umask)

run_rc_command "$1"


keithg
Posts: 4
Joined: Sun Jan 06, 2019 11:26 pm

Re: Events Capturing frames but no Video

Post by keithg » Mon Jan 07, 2019 5:56 pm

I have the same problem, but with the port (and plugin) which uses 1.32.3. In FreeNAS, the pkg installed is 1.30, but the port and plugin are 1.32.3. The MP4 container is created, but no video is put in the container, or so it appears. It seems that a helper program is not configured correctly or maybe not installed or a missing library? I've been dinging around with this for a couple weeks, now and have no solution, yet.

epicfatigue
Posts: 14
Joined: Sun Jan 15, 2017 1:15 am

Re: Events Capturing frames but no Video

Post by epicfatigue » Sun Apr 07, 2019 12:19 am

For everyone that is having issues with this in Freenas set your camera to the following.

Under the camera from the GUI click it
go to storage tab
select videoWriter as h264 camera Passthrough

Also note there is a new version of Zoneminder as a port for Freenas i recommend that it has a few little things fixed that you do not have to change
Attachments
Untitled.png
Untitled.png (34.11 KiB) Viewed 515 times

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests