Hi there, for anyone also having trouble with getting certain USB/built-in webcams to work because of this cropping issue, but they do work in Cheese/xawtv, you can instead route the camera through a ffmpeg stream. Like so (edited version of
http://ubuntuforums.org/showthread.php?t=665607):
Install zoneminder from deb/rpm/whatever is easy. There is a guide on the wiki that works fine.
Install ffmpeg
Back up old ffmpeg streamer config file
Code: Select all
sudo mv /etc/ffserver.conf /etc/ffserver.conf_backup
Make a new config file
Input the following
Code: Select all
Port 8090
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 10000
# Suppress that if you want to launch ffserver as a daemon.
# NoDaemon
<Feed>
File /tmp/feed1.ffm
FileMaxSize 5M
</Feed>
# FLV output - good for streaming
<Stream>
# the source feed
Feed feed1.ffm
# the output stream format - FLV = FLash Video
Format flv
VideoCodec flv
# this must match the ffmpeg -r argument
VideoFrameRate 15
# generally leave this is a large number
VideoBufferSize 80000
# another quality tweak
VideoBitRate 200
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 352x288
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
Noaudio
</Stream>
Save and exit. (ctrl-x, yes)
Start the ffmpeg streaming video server:
Start the video stream from the webcam. NOTE, I am assuming we're using /dev/video0 - replace that with your video capture device.
Code: Select all
ffmpeg -r 15 -s 352x288 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm
NOTE: You
must specify video4linux2 there, I've not yet made it work with v4l1. This is different to the instructions at the source.
If you get some buffer underflows, don't worry too much. Do worry a little bit, though. Too many can cause it not to work. If you are getting underflows and it doesn't seem to be working, then lower the frame rate (the -r option) or lower the resolution. If you aren't getting underruns, then feel free to mess with those options to improve quality.
Now, open the ZoneMinder console in the web browser, and make a new monitor. Make sure it is an ffmpeg stream, then set the location as follows:
The resolution should be the same as that which you set in the ffmpeg stream command before.
It now works.
This worked for me from a clean ZM install on Ubuntu 10.04 Netbook Remix (!!!), using a built-in webcam on a recently-released eeepc (1005ha) - so it will work for just any damn thing at all which works in Cheese.
This isn't an optimal solution, it would be much better to do the compile from source and fix the two bugs (the non-inclusion of a cstdio somewhere, and the above-mentioned fix). For me, however, I kept getting core dumps (!!!!!!) after trying to compile my own, so this is the next-best thing.
If anyone would find it helpful, I can write a complete empty-box-to-working-video tutorial.
Edit: If the stream doesn't seem to be working, i.e. the monitor source is in red text and no image shows, then see if you can get the stream showing in VLC. Install VLC and then point it at that same stream URL which we put
in the config file (not the file name we specify in the command):
http://localhost:8090/test.flv. If even that doesn't work, then stop the stream and mess with the frame rate/resolution before starting it again.