Well, I figured out a way to get it working.
There's a great Android app called IP Cam Viewer. In case you haven't heard of it, it can stream many different cameras, including ZoneMinder.
Anyway, I decompiled that app and reverse engineered the protocol (to the best of my ability) used to get the camera stream. Using that information, I wrote a small app that allows Zoneminder to see the feeds.
It works by authenticating to the DVR's mobile port, and forwarding the receiving h264 stream to a FIFO pipe, which Zoneminder reads from. I spoke with the author of that app, Robert Chou, and he gave his ok, so I'm posting it here.
I was originally writing this as a test app to see if I could get it to even work, then add support directly into zoneminder. However I was so impressed with the results, I'm just using it as is. This is also why it's a C app, as opposed to a perl script.
How to use:
Download the C file (unzip file first, forum limitation) and compile with: gcc zmodopipe.c -o zmodopipe
It accepts many command-line options, which are documented by running: ./zmodopipe -h
As an example, to watch the first two cameras run this:
./zmodopipe -s 192.168.1.100 -p 18600 -c 1 -c 2 -u mobileuser -a mobilepass &
For more info on the options, check the help.
In Zoneminder do this:
1) Add a new monitor
2) Source type: ffmpeg
3) Source path: /tmp/zmodoX (or whatever the pipe name you used is, and where X is channel number - 1).
4) Capture size: 320x240 (704x480 for Media port)
Save, then wait for 10-30 seconds for ZM to start pulling the stream... and poof!
Now, this is a work in progress. So there are some issues.
1) Sometimes some streams cut out, even in Media mode. The stream occasionally has a bad frame ([h264 @ 0xaf5d60] no frame!), and when ZM decodes it, zmc keels over because there's no frame data:
11/12/11 08:03:16.245611 zmc_m4[-1].FAT-zm_ffmpeg_camera.cpp/173 [Unable to decode frame at frame 3270]
2) On the mobile port, occasionally the image will go grey, it'll fix itself in a few seconds after the next keyframe (don't know why). You'll have to take that into account for motion detection.
3) To change the directory the pipe is created in, change the source. I needed something quick that would work with all users, so I used /tmp. Pipes take no space, so there's no issue of filling up the disk. If there's enough demand, I'll add an option to specify the path.
4) Main process doesn't fork to the backgound (but children do). To close the app, press Ctrl-C or send a SIGTERM (if running in background with '&'). It will properly shut down and delete all children and their pipes.
Now, I only have the Zmodo DVR-H9104 unit. They are essentially the same as the equivalent Q-See/Swann units, so they should work, but I can't test anything else.
Let me know what you guys think.
PS. If you want to thank me, go buy his app if you use the free version. He's been a good sport (by allowing me to decompile his code).
I also hope by posting this code, someone else (who knows the internals of zoneminder better) will be able to add support in for these cameras natively.
For reference, here's the cameras it MIGHT work with:
Defender SN300 DVR
KGuard KG-SHA108 V2
Night Owl Poseidon
Night Owl Zeus
Q-See QS408 (ones based on this should work best)
CnM Classic 4 Cam DVR (Thanks Ian)
Zmodo DVR-8104UV compatible (also DVR-8114HV) - Please test!
Visionari 4/8 channel DVR (thanks jasonblack)
Swann hardware version DM-70D, device type DVR04B and compatible (thanks, Phil)
- Note, if this doesn't work it's been reported that you can access the stream using rtsp://ip/ch# (ie: rtsp://192.168.0.1:554/1
If anyone has this units, please test and let me know!
If you want to keep up with my progress (which is sometimes SLOW), check out my G+ page: https://plus.google.com/107530140244685710056
EDIT: I've updated this post for the newer version, which now supports the media port (some models only)!
EDIT 15 Nov 2011: There's a bug in the newest version, I reversed the user name and password fields. If you're getting login problems, try reversing them on the command line (-u for password, -a for username). I've already fixed it for when I release the next version.
EDIT 26 Jan 2012: I've uploaded a new version that supports the CnM Classic 4 Camera DVR system. There's also untested support for the DVR-8104UV models (also 8114HV). Please test those if you have one of those models.
I've also added a timer and signal support. Since the stream sometimes goes out, you can set a timer inerrupt to reset the connection on an interval (-t option). You can also send a SIGUSR1/2 manually to the errant process.
EDIT: 21 Apr 2013: New version, this includes the Visionari patch by forum user jasonblack. Also included is support for certain Swann models with hardware version DM-70D, device type DVR04B (I don't have the marketing model number). Command-line options -m7 and -m8, respectively.
I also improved reliability by making sure the children automatically restart streaming if they die for some reason. The grey images might still appear, but the process should always restart as long as the parent is running.
EDIT 27 Apr 2013: Actually uploaded the file this time. It looks like the forum only supports a max of 3 files. Sorry about that.
EDIT 5 May 2013: Fix help not displaying. Search and replace oops.