How to fix Zoneminder recorded videos always starting with grey content

Written by - 0 comments

Published on - Listed in Zoneminder Surveillance Multimedia Security

A while ago I adjusted my Zoneminder setup to use ffmpeg as source type. In older ZM versions the source type was often set to "remote" but this is nowadays considered deprecated.

The biggest advantage of using ffmpeg as source type is the recording of real mp4 videos, instead of creating many single jpeg files for each recorded event.

Videos start with grey content

However since that change I noticed that all recorded events now started with a grey "layer" before the actual video.

Zoneminder video starts with grey content

I considered this as annoying but still OK as I would only come across that grey content in the first 1-2 seconds of an event - as long as the real footage is still there.

However when sending e-mail alerts of a recorded event, the attached screenshot (using the %EI1% variable in the e-mail body) also showed the grey content:

That's not good. The screenshot should give a quick sight of the reason, why the motion detection was triggered.

ffmpeg encoding settings

After some research I came across a thread in the Zoneminder forums, mentioning similar issues with grey frames. Following the discussion, it turns out that the ffmpeg encoder settings need to be set and the defaults (or at least what looks like defaults) are not actually applied to ffmpeg while recording+encoding a video.

The ffmpeg encoder parameters can be found in  the settings of a camera (monitor) under the "Storage" settings:

The current parameters text field by default shows the following content:

# Lines beginning with # are a comment
# For changing quality, use the crf option
# 1 is best, 51 is worst quality

Somehow one would assume that crf=23 is set by default, but it's actually not. According to the discussion mentioned above, the comments also could cause some problems, so it's best to fully remove the content and only set the actual parameter crf=23:

Videos now start correctly

As soon as the next event was recorded on that camera/monitor, the resulting video now started correctly - without any grey frames at the beginning.

This also had a positive effect on the e-mail notification, which now shows a correctly attached screenshot:

Zoneminder e-mail alert notification now shows correct screenshot

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder   

Update cookies preferences