H264 Videostorage

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

H264 Videostorage

Post by zamar17 »

I'm new to ZM, so try to figure out its full potential for my tasks.

I found ZM H264 Video Storage Branch on Github. The description says, the branch supports direct recording of h264 cameras into MP4 format uisng the h264 Passthrough option, but only with FFMPEG Monitors currently. Is this option included in ZM 1.29.x release? If not, in what release it will be included?

I also can't fully understand the pass-through concept behind it. Will it include audio passthrough from source, since FFMpeg allows to record both source video and audio into MP4 without transcoding? Also, how Timestamp overlay fits into this? It must be shown on any surveillance video, so can it be overlayed onto passthrough stream with minimal encoding & CPU load? Its especially important for video clips of motion detected events.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: H264 Videostorage

Post by SteveGilvarry »

No. Possibly 1.30 if we can get it to work, but keep getting caught in here answering questions. :shock:
Passthrough so it takes the video and audio packets and writes them to disk in an mp4 container, of course the video and audio have to be compatible with html5 browser support for it to play back. Still decodes at the moment for streaming view.
Timestamp overlay would not work, pretty sure even the cheapest chinese cameras have timestamps on the camera.
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: H264 Videostorage

Post by zamar17 »

Steve,

I really appreciate your help on the forum. Keep in mind though, its all parties beneficial process, since ZM users gladly pinpoint bugs and headaches they face at configuring ZM and making it work, thus inspiring devs more problems to fix making ZM a better overall package. :D

Speaking of H264 videos, is this feature viewed as storing a series of small consecutive videos covering each a small part of motion detection event, which can be sent with email notifications? If not, stored video files of events may be quite large. How in this case email notifications will be possible with attachments? Still images are seldom informative, and attaching large videos to emails is impractical.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: H264 Videostorage

Post by SteveGilvarry »

Always happy to help people out. Just setting the expectation that I may not always respond as I might be working on that making it better stuff, and the one thing we are not short on is ideas to make better, just need time and resources.
No. Yes. Email of events probably no longer viable, especially as cameras get higher and higher resolution. I guess a low res transcode could be sent. I use zmninja, longer term streaming events on demand to devices I think will be the better option.
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: H264 Videostorage

Post by zamar17 »

For ZM home users, webmail, ftp, cloud servers are viewed as safer storage options than keeping video footage at home, as burglars can easily destroy them if quickly accessible on a PC hard drive. Email notifications are good and timely pieces of evidence, but without some video or animated gif attached they are useless however, since a burglar would immediately try to destroy visible cams upon entering premises, as well as shutdown power and internet & cable to block further notifications. Hence, mobile streaming on demand is mostly good for a babysitter watch case, when nothing hot happens. :) Chances are, unless you have hidden cams, only first few moments of "bad" events will ever be recorded and sent away in an ordinary home, and only if having a spare internet connection.

Sometimes we concentrate on tech so much, and forget very basic stuff - surveillance task is to safely collect and preserve the evidence of undesirable events. Its not merely about playing nice with iPhone. At zmninja Github site I found a dedicated thread too, asking to add email to its UI and animated GIF playback. Of course, a low resolution or better timelapse MP4 video can be emailed instead at motion detection.

"Motion" package allows to record timelapse videos (dropping many middle frames) of detected events. Here's timelapse example of ZM use. So with H264 videostorage, pls keep this important feature in mind. ZM would transcode a video of an event once saved, to a timelapse H264 video and send it my email. Another approach is to use image frames (because they still be used by motion detection algorithms) to record a timelapse video of each event or an animated GIF with ffmpeg.
Last edited by zamar17 on Tue Apr 19, 2016 3:51 am, edited 6 times in total.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: H264 Videostorage

Post by zamar17 »

Another alternative suggested by Motion devs is to capture, once motion is detected, main stream for high quality recordings, and second low resolution video:audio stream for email notification movies, since many moderns cams offer 2 different H264 streams, like 720P and SIF(525) 352 x 240, both H264 source. I can be a tester for above features. In fact, it may be more rational to use namely secondary stream with motion detection algorithms for lower CPU overhead, while record the main stream for storage.

But current approach of recording a stream to disk for local display needs to change, since its highly damaging for SSDs and Flash, hence unsuitable for single board PCs like RPI very popular for home surveillance. In fact, QuickTime plugin allows to play RTSP stream in Firefox, so why such recording to disk is needed to begin with? Also, VLC plays RTSP stream without any disk writes and low RAM footprint, so it should be possible in ZM too.

IMHO these ZM functions can not be prioritized as low and high. Its equally important to keep high quality non-transcoded video of events AND small videos or anim gifs for email notifications. ZM users need both at the same time. :roll:
Last edited by zamar17 on Tue Apr 19, 2016 4:53 pm, edited 4 times in total.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: H264 Videostorage

Post by zamar17 »

A separate question: is it possible to use motion detection processing by the cam chip instead of decoding and processing it by ZM motion detection algorithms? If the cam allows to stream at low framerate most of the time, and at high framerate when motion is detected, or using a similar differentiator, then ZM can use it to start and stop recording too, when motion occurs. In this case there will be no need to decode and analyze cam frames by ZM, and send them picture by picture to local display, thus greatly decreasing CPU and disk load. Is it currently possible in ZM?
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: H264 Videostorage

Post by asker »

Aren't you the same person who asked for the GIF feature in zmNinja?
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: H264 Videostorage

Post by zamar17 »

Are you zmNinja developer? :wink:

Btw, I read the discussion you're referring to, and while several ways exist to accomplish similar goal, I think H264 Videostorage feature should fully use capabilities of modern H264 cams, and most such cams output at least 2 streams at different resolution. Hence, instead of re-encoding the footage for various purposes, it makes sense to use high reso footage for permanent storage recordings triggered by detected motion, and low reso footage for motion detection and email notifications.

Further, I believe ZoneMinder should fully use modern H264 cams capability to detect motion by their hardware rather than decode and analyze each source frame by PC software. For these cams ZM server would simply start recording HD to local disk, emailing short SD videos, uploading (saving HD videos to Dropbox folder or another Cloud Storage), and re-streaming 2 source audio:video streams without transcoding (high reso for storage, low reso for notifications), once the cam hardware detected motion. It can be done with very low PC hardware overhead. This approach makes ZM future proof.

I have a message for those developers who have doubts what the prime purpose of ZoneMinder is. Yes, its also about nanny on-demand monitoring while looking at nice iPhone screen - of course its cool, and sells well. But the prime purpose is timely notification and preserving evidence of violent crime. I know it doesn't sound cool, and may sound very remote for some folks, but unfortunately that's what surveillance is mostly about. Once a person is exposed to such circumstances, he would much better understand value of notifications and evidence timely preserved by ZM in a remote location.

Btw, we can setup a voting thread, asking what ZM features users consider mandatory, what they intend or now use ZM for, what prompted them to use it in the first place. You may be surprised, how many claimed "nanny" cases are really about family, property, and personal safety. And... the "nanny" use case doesn't require ZoneMinder, since modern IP Cams can do everything by themselves. ZoneMInder, in contrast, is needed to use multi-camera setup in an organized homogeneous manner, which doesn't fit into "nanny's case" at all. :shock:
Last edited by zamar17 on Thu Apr 21, 2016 5:13 am, edited 2 times in total.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: H264 Videostorage

Post by asker »

zamar17 wrote:Are you zmNinja developer? :wink:
Yes.

Also, it might help to clarify - there are no shortage of good ideas. There is a shortage of people who are willing to contribute code to implement them.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: H264 Videostorage

Post by zamar17 »

I haven't seen real ZM Roadmap - does it exist? Therefore, I doubt there's no shortage of good ideas, unless you can show how they are weighted and added to ZM Development Roadmap. In fact, there is ALWAYS shortage of bright ideas capable to look at familiar things from a totally different prospective. Namely addressing this shortage, people drive technology progress. :D

Contributing good ideas is always welcome in my book, and independent on whether the idea authors are able or available to implement them, once the ideas are weighted objectively. I see a significant gap now between consumer trends to use single board computers like Raspberry for home surveillance, and capabilities of Linux based surveillance programs like Motion and ZM, which now use old technologies and abuse HDD, while IP cameras design and feature scope move forward fast.
zamar17
Posts: 24
Joined: Wed Apr 13, 2016 1:21 am

Re: H264 Videostorage

Post by zamar17 »

Just found wiki and the thread linked below showing its possible in ZM 1.29 to setup 2 streams at different reso from one cam as described above.

Will test if only low resolution videos can be sent with email notifications. Hope this functionality will be preserved in H264 Videostorage.

I wonder if someone already tried using IP Cam motion detection capabilities with ZM too in any fashion, including the cam itself setup in ZM and recording its footage to ZM database instead of ZoneMinder capturing and recording the cam footage? This thread says, ZM now can't read extra alarms sent by the cam at detecting motion, but such request was put. May be switching off ZM motion detection for the cam would do?
Locked