h.264 and Axis m3011

Post here to indicate any hardware you have used and which is known to work with ZoneMinder. Not for questions.
Post Reply
pashdown
Posts: 11
Joined: Tue Oct 04, 2011 1:31 pm

h.264 and Axis m3011

Post by pashdown »

I'm trying to get Zoneminder working with h.264 and the Axis m3011 camera. I'm using ZM 1.25.0 with mmap & ffmpeg support and the latest gits of ffmpeg and x264. The picture quality is terrible and usually smeared in a vertical fashion.

Even though ZM is configured and working with mmap. I've increased the shmmax to 2GB to no avail. The h264 stream works just fine in VLC, although I must say the quality is disappointing. It doesn't look as good as when I'm using mjpeg. I haven't tried messing with the camera's h264 parameters.

I've attached a 1/2x example of what I'm seeing.
Attachments
An h264 example.
An h264 example.
zmh264.png (156.48 KiB) Viewed 3399 times
stonith
Posts: 9
Joined: Thu Mar 29, 2012 9:43 pm

Re: h.264 and Axis m3011

Post by stonith »

This isn't Axis' problem. And I had the exact same problem. This is more of FFMPEG and the protocol that is being used. UDP. Use TCP method. rtsp://[your axis camera]/axis-media/media.amp?tcp

That worked for me. I was able to do 2 RTSP streams. Not taking credit, someone else brought up the TCP method.
cambot
Posts: 14
Joined: Mon Apr 23, 2012 5:15 pm

Re: h.264 and Axis m3011

Post by cambot »

I don't have this Axis camera (I have an m1011 and several M3114s) and I didn't notice that adding the tcp flag to the URL did anything differently. All of the traffic seems to endup going over tcp anyway and I still would get the streaming errors like that periodically.

For me what ended up working was replacing the "libav" version of ffmpeg with "original" ffmpeg. I outlined that in a post on the Zoneminder 1.25.0 forum, but basically I used the PPA from Jon Severinsson to get the proper version of ffmpeg. I re-installed my ubuntu server from scratch, and installed the PPA and ffmpeg first so that the default version that ubuntu installs won't get installed.

Turns out the ffmpeg in the original version is able to understand the protocol much more "completely"; it never has any errors at all, but the libav version works for maybe 10-30 seconds before it starts seeing errors. If you let it run all day long eventually it will have tons of errors but it seems to work about 99% of the time for the first minute or so, with just occasional glitches.

Anyway, pretty sure that's the main cause. I have two servers running ubuntu and zoneminder 1.25.0, against the same set of cameras and they are identical except one is using the "original" ffmpeg and the other is using libav.

Best of luck and let us know how it turns out!
Post Reply