Hi all,
I've got a couple of old webcams I'd like to set up with ZoneMinder, but it seems that the cameras use data formats that aren't supported. One of them encodes the video in MJPEG format (which works fine with mplayer) and the other one uses PAC207, which is a proprietary compressed format.
I see in monitor.php there are entries for these formats, but they're commented out. I tried uncommenting them but it didn't help, I guess because they need to map to FFmpeg constants in zm_local_camera.cpp. (I would've thought MJPEG would've mapped though, given that mplayer uses FFmpeg's MJPEG decoder.)
At any rate, as I was hunting around I came across libv4l, which converts data from all cameras supported by Linux into a couple of standard formats. Given that this would allow both my webcams to work, I'm wondering whether there are any plans to use this library in ZoneMinder?
Or is there another way to get PAC207 cameras working?
Enabling extra camera data formats
-
- Posts: 3
- Joined: Sun Jun 14, 2009 8:27 am
- Location: Brisbane, Australia
actually if mplayer can play the mjpeg stream then it should work with ZM without issue. Just set the type to "FFMPEG" instead of remote, and plugin the url and it should work. There is a slight difference between mplayer and FFMPEG's mjpeg handling that has thrown some cameras, FFMPEG will always send auth auth header even if no user/pass is provided (it leaves the auth string blank) where mplayer only does it when a user/pass is provided. Long story short if FFMPEG doesn't work still try using http://a:a@camera so it provides a full auth string (even though invalid) to the webcam server and it may fix any lingering issues.
-
- Posts: 3
- Joined: Sun Jun 14, 2009 8:27 am
- Location: Brisbane, Australia
Try this suggestion from user azir in this threadAt any rate, as I was hunting around I came across libv4l, which converts data from all cameras supported by Linux into a couple of standard formats. Given that this would allow both my webcams to work, I'm wondering whether there are any plans to use this library in ZoneMinder?
http://www.zoneminder.com/forums/viewto ... 3462#53462
If this doesn't work I can put up a patch.gspca kernel module supports many usb web cams, but sometimes it need help of libv4l2, try preload libv4l within zmdc.pl script
it works for me with my usb webcams (genius and prolink)
Code:
$ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
# preload libv4l2
$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l2convert.so';
-
- Posts: 3
- Joined: Sun Jun 14, 2009 8:27 am
- Location: Brisbane, Australia
Oh that's great, preloading libv4lconvert got my PAC207 camera working fine with its proprietary compressed protocol! (I just set the capture palette to RGB24.)
The MJPEG camera still doesn't work though, so I'll try switching it back to FFmpeg and enabling debug output. Strangely enough when I run ffmpeg from the command line with -i /dev/video1 FFmpeg just sits there not doing anything, so maybe it's a problem with FFmpeg accessing v4l2 devices? I imagine mplayer accesses the device itself and just passes the data through FFmpeg, as that seems to work fine.
I might have to look into libv4l though, if it doesn't support MJPEG properly...
The MJPEG camera still doesn't work though, so I'll try switching it back to FFmpeg and enabling debug output. Strangely enough when I run ffmpeg from the command line with -i /dev/video1 FFmpeg just sits there not doing anything, so maybe it's a problem with FFmpeg accessing v4l2 devices? I imagine mplayer accesses the device itself and just passes the data through FFmpeg, as that seems to work fine.
I might have to look into libv4l though, if it doesn't support MJPEG properly...