with the availability of libvlc capture method on 1.27.0 I decided to have a short look at the different capture methods available for an IP camera. The test used a trivisopn NC-336PW network Camera - FullHD Resulution @ 18fps and lots of available formats for capturing images:
RTSP H.264 stream: rtsp://192.168.1.8/live/0/h264.sdp
RTSP MPEG4 stream: rtsp://192.168.1.8/live/0/mpeg4.sdp
RTSP MJPEG stream: rtsp://192.168.1.8/live/0/mjpeg.sdp
HTTP MJPEG stream: http://192.168.1.8/live/0/mjpeg.jpg
HTTP snapshot image: http://192.168.1.8/live/0/jpeg.jpg
I tried all formats using remote/ffmpeg/libvlc. for ffmpeg rtsp I forced tcp with ?tcp url parameter - udp resulted in smeared images. System was Ubuntu 12.04 LTS w/ Zoneminder 1.27.0 branch compiled from source.
- * I ended up using mjpeg with remote/http. This setting provided best combination of reliability and CPU usage.
* ffmpeg rtsp failed because it doesn't recover nicely from network failures
* no idea why ffmpeg http mjpeg stream didn't work; successfully using it with several other cams on this server
* libvlc is extremely CPU hungry compared to other options
* libvlc does not reduce CPU usage when limiting fps on the zoneminder side
Code: Select all
Encoding method protocol status CPU usage FPS Cam 15 15 5 FPS ZM unlimited 5 unlimited jpeg remote http OK 10,0% 6,0% n/a *1 jpeg ffmpeg http n/a jpeg libvlc http n/a mjpeg remote http OK 17,6% 5,5% 6,0% mjpeg ffmpeg http error mjpeg libvlc http OK 32,2% 31,5% 27,0% mjpeg remote rtsp error mjpeg ffmpeg rtsp error mjpeg libvlc rtsp OK 34,0% 34,0% 28,0% h.264 remote rtsp unusable *2 h.264 ffmpeg rtsp OK 12,7% 5,3% 5,6% *5 h.264 libvlc rtsp OK 26,0% 25,5% 25,6% mpeg4 remote rtsp not stable 5,1% 3,3% 3,2% *3,*4 mpeg4 ffmpeg rtsp OK 5,1% 3,2% 3,1% *3,*5 mpeg4 libvlc rtsp error *1 frame rate maxes out at about 8 fps *2 most frames smeared, frequent zmc restarts *3 Cam maxes out at about 9,5 fpsd *4 connection to camera not stable, loss of image after some minutes *5 Stream does not recover after network disconnect