Zoneminder vs Hardware Recorders (They DO do full PAL/NTSC)

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
50cc
Posts: 82
Joined: Sun Mar 23, 2008 12:01 pm
Location: The Netherlands

Zoneminder vs Hardware Recorders (They DO do full PAL/NTSC)

Post by 50cc »

Some thoughts:

We were pretty pleased with our ZoneMinder setup (will still are) but after seeing a Samsung DVR system in full operation we have some doubts...

As we see it ZoneMinder can do anything as long as you have the correct hardware, no recorder system can beat that. But whatever you do the screen resolution is limited to 384x288 max, unless you settle for interlacing. Ok, if you use digital cameras the problem goes away, but the cost of just one IP cam can go up to 5 to 6 times the cost of an analog camera.

I *thought* that every system would have this problem when using analog cameras. This weekend I went over to a friends company who have a 16 camera system up and running. We started with the live view on the LCD attached to the DVR itself, this was full PAL and very high framerate. Ok, fair enough we can do that to with splitters and a multiplexer, the DVR probably has one built-in.

The second part was watching the live data on a PC on the LAN, this was around 4 - 6 FPS, but still full PAL and not interlacing! There was a delay of 2-3 seconds so there clearly is some processing going on to deal with the interlacing (very likely to be dedicated hardware for all 16 channels).

Also watching back events over the LAN is very cool, still full PAL and 4-6 FPS and events dating back 2.5 months on a 320GB disk, events only, but still a lot of events!

It somewhat annoyed us that this all is capable on a off the shelf system. We also want to do this with a ZoneMinder system, so we figured we need to do the following, which is what the Samsung DVR does:

1. De-Interlacing
We came up with a concept which needs testing; using the tool http://allonlinux.free.fr/Projets/AVLD/. Using this we can read the video from a camera (/dev/video*) using mplayer which de-interlaces the image at full FPS. Then feed it through AVLD to a new /dev/video* device so ZoneMinder can read it. We need to test this, but the greatest concern is CPU usage.

2. MPEG4 Data streaming and storing
In order to stream larger full PAL over a network and to store this type of data MPEG4 would be excellent. We did get this working for streaming, but the delay is very long (7+ seconds).

To prevent re-inventing the wheel to much some questions for those who may have tried similar.

1. Anyone every tried AVLD?

2. Anyone tried something similar to AVLD?

3. Anyone used hardware to de-interlace video real-time?

4. MPEG4 experiences?

Thanks!

(We still very much ZoneMinder!!! We just think it can get even cooler with full PAL/NTSC support)
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

First, PAL is an interlaced format by definition. There is just no way around that. What they are displaying is not PAL.

So, what you get from analog cameras is between 240 and 288 lines, and that just will never change. Yes you can do processing magic to make it look better, but you can also do that with the raw frames.

But you actually propose storing less data with mpeg4. Yes it makes better use of space, but at a quality cost, and you are already not happy with quality.

So, if you want better, not just looking better, you will need to spend money. A bigger hard drive is a small expense to preserve the quality you have. You can also capture at 640x240 and adjust it for viewing to maximise the quality you get. You can also post process those frames to get something almost like 640x480...

I am thinking of making this my sig...
CSI ain't real.
beerygaz
Posts: 28
Joined: Wed Jul 08, 2009 9:43 am
Location: Johannesburg, South Africa

Post by beerygaz »

Lee, I understand that PAL or NTSC are interlaced images by default. I know that to avoid combing the only way to capture is at 320x240. But surely there is some way of getting better quality images without the need to jump to megapixel IP cameras?

If I record at 640x240, is there a way to zoom my image vertically to get a decent aspect ratio?

I just find that at 320x240 I get such low quality that it's tough to identify a face or a license plate - is the only solution to make the jump to digital?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

be very careful deinterlacing before storing images. That is a modification to the image and technically could make the footage inadmissable.

You can buy cams that dont interlace and do not suffer from the interlacing issue.

I would suggest the samsung is using 2cif or halfD1 ie 768/720/704 x 288

you can do this without interlacing on a zm box and the windows playback client will rescale the images.

You can also run at high fps assumign your card is caperble of it.

the whole debate of jpeg vs mpg / h264 wages on.
Im a jpeg fan and think that while a conditional refresh system is great for transmission its not best for storage. There is also an ongoing debate if mpeg is an acceptable in court.
That is why high end pro machines (the samsung is a budget machine) do jpeg recording or multimode recording (events in jpeg)

A zm box will wipe the floor with most pro dvr's if its got the righ gear in it. Few pro boxes can handle the formats zm does, not multimegapixel cams. ALso you say ip cams are expensive. Just as with analogue good ones are yes but you can buy ip cams that will work with zm for 35ish quid. Proper ones are dearer but on a par with proper analogue cameras.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

Hi.

Any one done experiments with AVLD?
I am thinking about doing simple stream server like an IPcam from older PC with no recording, only capture, deinterlace and stream.

Any suggestions? Anyone want to do it together?
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Post by mastertheknife »

Hi,

De-interlacing with AVLD sounds interesting, can you post more about how to do it?
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

At this point I exactly dont know how to do it.

A think about reading the bttv card from video0 with mencoder with the deinterlace filter and writing it to a AVLD (fake) video1. Zoneminder should then read from video1 a deinterlaced picture.
50cc
Posts: 82
Joined: Sun Mar 23, 2008 12:01 pm
Location: The Netherlands

Post by 50cc »

pki wrote:At this point I exactly dont know how to do it.

A think about reading the bttv card from video0 with mencoder with the deinterlace filter and writing it to a AVLD (fake) video1. Zoneminder should then read from video1 a deinterlaced picture.
This works.

I did this last year but did not document it. I also never implemented into a running Zoneminder system because of a lack of extra time...

The drawback is extra CPU usage, but that should still be within reason. Other drawback is a small delay.

I did not the colour coding right on my test system.

All-in-all its pretty cool! :)
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

Oh great. May be you have some files from this testing you used? Some scripts? Anything? The extra CPU usage at the time of quad and more core cpu's should not be the problem. The small extra delay is i thing no problem too, but the deinterlace would be a great feature. Would you like to help me try this again?
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

Hmm, what do you think:
mencoder mf://*.jpg -mf w=640:h=480:fps=5:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -vf lavcdeint -oac copy -o out2.avi

Image
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

I have done some experiments.

I installed the vloopback device from http://www.lavrsen.dk/twiki/bin/view/Mo ... backDevice

I can capture the interlaced video, deinterlace and encode to avi:

Code: Select all

mencoder tv:// -tv driver=v4l2:width=768:height=576:outfmt=rgb16:device=/dev/video0:noaudio:norm=PAL -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -vf lavcdeint -oac copy -o out2.avi
I can send the video to the loopback device, i think deinterlacing could be done here too:

Code: Select all

mencoder tv:// -tv driver=v4l2:width=768:height=576:outfmt=rgb16:device=/dev/video0:noaudio:norm=PAL -ovc raw -of rawvideo -o /dev/video8
But i dont know how to get the video from the loopback device to zoneminder.

/dev/video9 is the output of the loopback device.

Code: Select all

$ sudo zmu -d /dev/video9 -q -v
Error, failed to open video device /dev/video9: Invalid argument
Any ideas how to feed this back to zoneminder? Maybe use an other input, not local video source? Help.
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

Hi agn.

I have done it some way around, mencoder makes an deinterlaced jpeg:

Code: Select all

mplayer -loop 0 tv:// -tv driver=v4l2:width=768:height=576:outfmt=yv12:device=/dev/video0:noaudio:norm=PAL:fps=25 -vf yadif,scale -frames 1 -vo jpeg
This jpeg is included as source in ZM, instead of the video device.

This is not the solution, it should be done an other way but this is a try.

Maybe someone can help to make a MJPEG stream out of mencoder, this could be used to include this like an remote IPcam.


An other idea. Maybe the capture daemon zmc could be modified to include a custom image postprocessor and there we can put in an deinterlace and denoise filter?!
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

[RANT]
Honestly if you need to deinterlace get a good player that does it vlc I know for sure can take the jpeg stream and deinterlace live.

Also The whole point in using jpegs is to get the best quality and no loses from mpeg artifacts etc.

Although there is one thing thats easy to do for now simply add ffmpeg option to the zm settings.

http://www.ffmpeg.org/ffmpeg-doc.html
The switch is just -deinterlace

Go pick yourself up a a pelco anolog camera thats progressive scan then problems gone.
[/RANT]
pki
Posts: 29
Joined: Sat Mar 06, 2010 8:59 am

Post by pki »

Yes of course, we can change all the cameras, we can throw away all the zm hardware and get some other stuff, this is not the solution i think. With ffmpeg we can do a deinterlaced export of the video, this is ok. But i am going to have a deinterlaced image as source for zoneminder, deinterlaced before the image bein analysed.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

info for others that find this thread
http://www.axis.com/products/video/came ... e_scan.htm
Post Reply