Zoneminder streaming options

Forum for questions and support relating to the 1.24.x releases only.
Locked
punk_ecas
Posts: 41
Joined: Wed Mar 04, 2009 4:16 pm

Zoneminder streaming options

Post by punk_ecas »

Hi,

I'm trying to develop a standalone mobile client to view Zoneminder monitors and events in a WM6 PDA.

After some research on scientific papers, I've found that the better way to stream video on limited bandwidth networks is over UDP with raw encoded with H264 codec.
Could be zoneminder easily configured to stream with these options?

Which configuration of ZM, do you think that have better performance combining the best quality/bandwidth ratio?

Thanks!
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

At the moment you can't configure ZM to stream over UDP, you would need to feed ZM streams into a third party encoder such as ffserver or Darwin Streaming Server etc.
Phil
punk_ecas
Posts: 41
Joined: Wed Mar 04, 2009 4:16 pm

Post by punk_ecas »

Any suggestion to use third party encoder?

Are you talking about get zms stream into ffserver, for example?
Or there is a better way, like ffserver source coming for shared memory?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I have never tried it so I don't have any particular suggestions. Your options are grabbing images to disk and pointing the streamer at those, if the streamer supports streamed images directly you could point it at a zms url. Or you could write a simple script (in perl) using the ZM perl libraries to continuous extract images from memory and pass them to the streamer. It's something i need to look at I think so I have a better idea of how those things work.
Phil
punk_ecas
Posts: 41
Joined: Wed Mar 04, 2009 4:16 pm

Post by punk_ecas »

Thanks for your opinion!

The problem of getting images directly from zms is the lag that could bring, zms will be like a bridge, so it is one more pass point.

Perhaps the perl script will be the best solution, but i'm not familiarized with this language...
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

punk_ecas wrote:Any suggestion to use third party encoder?

Are you talking about get zms stream into ffserver, for example?
Or there is a better way, like ffserver source coming for shared memory?
Try http://www.live555.com/
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I'd not heard of that. That looks pretty interesting and I will have a bit of a better look tomorrow if I can.
Phil
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

zoneminder wrote:I'd not heard of that. That looks pretty interesting and I will have a bit of a better look tomorrow if I can.
Hi Phil

OpenRTSP is part of live555. I have used openrtsp to decode the rtsp stream from various cameras succesfully, then pipe to ffmpeg. May be you can look deeper the features of OpenRTSP. OpenRTSP is easy to compile, there is not necesary to install, so we use under /usr/bin and so on. It is fast, and has various command lines switches to increase buffer size, etc.

Please, see this post http://www.zoneminder.com/forums/viewtopic.php?t=12583

and if you can, look the PMs at my inbox. You will see various tests we have run succesfully.

Regards
punk_ecas
Posts: 41
Joined: Wed Mar 04, 2009 4:16 pm

Post by punk_ecas »

Normando wrote:
punk_ecas wrote:Any suggestion to use third party encoder?

Are you talking about get zms stream into ffserver, for example?
Or there is a better way, like ffserver source coming for shared memory?
Try http://www.live555.com/
Thanks for the suggestion.

By now I'm working on the mobile app, trying to get stream directly from zms, if I can't get a good QoS with that, I will try this media server.
azir
Posts: 14
Joined: Tue Jan 22, 2008 7:30 am
Location: Surabaya, Indonesia

Post by azir »

zoneminder wrote:At the moment you can't configure ZM to stream over UDP, you would need to feed ZM streams into a third party encoder such as ffserver or Darwin Streaming Server etc.
I tried to make slight modification for zm_xxx_camera.cpp to capture then stream it as rtp/udp. the streamed rtp/udp then played by vlc and (then) can be restreamed as rtsp.
I know this chain udp_from_zmc -> rtsp_from_vlc -> end_player is a resource-chain-hog, but it is better than http_from_zms ->rtsp_from_vlc -> end_player .
I also looked at live555 and libvlc-vmem (is this possible to make zm_vlc_camera from libvlc vmem ?) for more efficient streaming chain, but they are still too hard for me to understand :roll:

Here is the patch for ZM to stream over RTP/UDP.

Code: Select all

 REMOVED due to slow down page load (i'm on gprs) and patch has been emailed to Phil
Apply the patch with:
cd ZoneMinder-1.24.1
patch -Np1 < /path/to/above-code.patch

update:
  • make sure sdp_filename is exists and httpd user (www-data/nobody/apache) has write access on it
    if streaming to multicast address make sure to add route to multicast on your network interface route add -net 224.0.0.0 netmask 240.0.0.0 dev ethx
Last edited by azir on Fri May 08, 2009 4:45 pm, edited 2 times in total.
punk_ecas
Posts: 41
Joined: Wed Mar 04, 2009 4:16 pm

Post by punk_ecas »

Great Work. I really need some like this.
Sooner I will test this patch e post back the results.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

This is a very cool piece of work. I will try and get it integrated into the main ZM trunk for the next release.
Phil
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think the BB has screwed with your patch a bit. For instance look at the line containing the av_set_parameters call. I think anything with a less than or greater than is open to being mangled. Check you disabled html in your post (you may have to repost) or even better maybe provide a linke tpo a patch file or mail it to me (and I will host it) or even put it on the Wiki.
Phil
50cc
Posts: 82
Joined: Sun Mar 23, 2008 12:01 pm
Location: The Netherlands

Post by 50cc »

Something like this would be excellent!

Would the work done with xlib_shm be of any help? This also grab images directly from Zoneminder (as far as I understand it).
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Azir has kindly mailed me the patch and I have put it up here if anyone would like to try it.

I will be testing it and looking at merging it (or something similar) into the main trunk shortly.
Phil
Locked