Black Rectangle of Doom
Black Rectangle of Doom
Last night I had ZM 1.18.1 running on my gentoo 2.6.4-rc1 kernel with my BT848A quad input capture card quite nicely. I'd got a single monitor happily generating streams and stills and even doing the odd bit of recording. Flushed with enthusiasm, I hooked up another two cameras to the capture card, added monitors for them, fiddled with the resolutions a few times until it all fitted into the shared memory segment, and fired up the montage window expecting great things.
What I got was two broken images for two of the cameras, and a badly distorted version of the third. Firing up xawtv at this point revealed it madly cycling between cameras, as you'd expect.
I deleted the additional monitors and went back to my single monitor, single camera setup.
Now what I have is ZM happily capturing black rectangles, timestamps and all. xawtv shows the expected input from the camera.
I've tried deleting and reinstating the monitor, reinstalling zoneminder, rebooting...the works. There's nothing untoward in any of the logs, I can watch the circular buffer write ptr cycling happily, but my streams and stills show the black rectangle, whilst xawtv shows the camera image.
Any pointers?
What I got was two broken images for two of the cameras, and a badly distorted version of the third. Firing up xawtv at this point revealed it madly cycling between cameras, as you'd expect.
I deleted the additional monitors and went back to my single monitor, single camera setup.
Now what I have is ZM happily capturing black rectangles, timestamps and all. xawtv shows the expected input from the camera.
I've tried deleting and reinstating the monitor, reinstalling zoneminder, rebooting...the works. There's nothing untoward in any of the logs, I can watch the circular buffer write ptr cycling happily, but my streams and stills show the black rectangle, whilst xawtv shows the camera image.
Any pointers?
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Re: Black Rectangle of Doom
Hi Ant,
I'm a bit confused about what you have got set up. With a four port card, if it has four bttv chips then each input would be a separate /dev/video? device. Is this what you have or is it a single chip card with each input as a separate 'channel'?
Phil,
I'm a bit confused about what you have got set up. With a four port card, if it has four bttv chips then each input would be a separate /dev/video? device. Is this what you have or is it a single chip card with each input as a separate 'channel'?
Phil,
Re: Black Rectangle of Doom
Wotchamate Phil,
Sorry - it's a single device, with four MUX'd inputs, so one /dev/video device, four channels.
cheers
ant
Sorry - it's a single device, with four MUX'd inputs, so one /dev/video device, four channels.
cheers
ant
-
- Posts: 10
- Joined: Fri Mar 12, 2004 9:17 pm
Re: Black Rectangle of Doom
I'm sooo happy to not be the first person to run across this. I am using a WinTV card and had everything working just fine for a day or so. Tweeked some things that appeared to be irrelevent and rebooted. Now all I get is the same black output. xawtv shows the camera and /dev/video0 are still working and zmc is happily capturing away at 30fps.
Any Idea what to check? Or have you figured it out Ant?
Thanks,
-Jay
Any Idea what to check? Or have you figured it out Ant?
Thanks,
-Jay
Re: Black Rectangle of Doom
Nope, I'm still a bit flummoxed! It doesn't make a lot of sense - ZM is doing its thing quite happily (hence timestamped black rectangles), and so is the bttv/V4L stuff (coz I can see it in xawtv). In fact, with multiple channels, I can see ZM switching channels in xawtv! Somewhere between the two, however, the plot has been lost.
If Phil doesn't have any inspirational advice, reckon I'll be chasing it with the debugger :(
ant
If Phil doesn't have any inspirational advice, reckon I'll be chasing it with the debugger :(
ant
-
- Posts: 10
- Joined: Fri Mar 12, 2004 9:17 pm
Re: Black Rectangle of Doom
I figured it out on my system! I had unchecked the "Invert BGR colours to RGB" option on the video tab while tweeking. Rechecked, restarted and all is well. I guess I was expecting garbage and not a black box with that option. Hope it works for you too Ant.
-Jay
-Jay
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Re: Black Rectangle of Doom
Hi Ant & Jay,
Congratulations you have found a bug!
There was a problem where if you were using RGB24 and had unchecked the 'invert' option then a blank buffer was used instead of the captured image. Just a '}' in the wrong place really. It's fixed in 1.19.0 and the workaround is to make sure that 'invert' is checked (thanks Jay for spotting that) or use a YUV palette.
Cheers,
Phil,
Congratulations you have found a bug!
There was a problem where if you were using RGB24 and had unchecked the 'invert' option then a blank buffer was used instead of the captured image. Just a '}' in the wrong place really. It's fixed in 1.19.0 and the workaround is to make sure that 'invert' is checked (thanks Jay for spotting that) or use a YUV palette.
Cheers,
Phil,
Re: Black Rectangle of Doom
Jay - you're a star! I don't even remember messing with that option ;) That's sorted it nicely for me. I can even get three cameras running off the one bt848 device (with some reservations, but I'll put that in a different post).
ant
ant
Re: Black Rectangle of Doom
Would this explain why I'm not getting any image at all? And why in my apache logs it says no such file?
-
- Posts: 10
- Joined: Fri Mar 12, 2004 9:17 pm
Re: Black Rectangle of Doom
No, sorry. First of all this is fixed, I think, in the 1.19.x versions. And second the problem was not a missing image, but an image that was completely black. If your apache log is throwing a 404 you probably didn't get your CGI-BIN path right with you were setting things up.
Good luck,
-Jay
Good luck,
-Jay
Re: Black Rectangle of Doom
Ant,
I was wondering whether you have an updated copy of your zm start script at all? Or have you written your own for this? The standard script is suited to a Redhat/Suse environment but gentoo doesn't use the 'functions' script but has a functions.sh sitting in /etc/init.d not /etc/rc.d/init.d area.
At the moment I'm just starting it directly or at least attempting to using the /usr/local/zoneminder/bin/zmpkg.pl start command
Davin
I was wondering whether you have an updated copy of your zm start script at all? Or have you written your own for this? The standard script is suited to a Redhat/Suse environment but gentoo doesn't use the 'functions' script but has a functions.sh sitting in /etc/init.d not /etc/rc.d/init.d area.
At the moment I'm just starting it directly or at least attempting to using the /usr/local/zoneminder/bin/zmpkg.pl start command
Davin
-
- Posts: 10
- Joined: Fri Mar 12, 2004 9:17 pm
Re: Black Rectangle of Doom
Try this on for size.
My contents of zm:
------------------------ Start ------------------------
#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 99 99
# Source function library.
prog=ZoneMinder
ZM_PATH_BIN="/usr/local/bin"
command="$ZM_PATH_BIN/zmpkg.pl"
start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo -n "Success"
[ $RETVAL != 0 ] && echo -n "Failure"
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/zm
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo -n "Success"
[ $RETVAL != 0 ] && echo -n "Failure"
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
------------------------ End ------------------------
My contents of zm:
------------------------ Start ------------------------
#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 99 99
# Source function library.
prog=ZoneMinder
ZM_PATH_BIN="/usr/local/bin"
command="$ZM_PATH_BIN/zmpkg.pl"
start() {
echo -n "Starting $prog: "
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo -n "Success"
[ $RETVAL != 0 ] && echo -n "Failure"
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/zm
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo -n "Success"
[ $RETVAL != 0 ] && echo -n "Failure"
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/zm
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo "ZoneMinder is running"
RETVAL=0
else
echo "ZoneMinder is stopped"
RETVAL=1
fi
}
case "$1" in
'start')
start
;;
'stop')
stop
;;
'restart')
stop
start
;;
'status')
status
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
------------------------ End ------------------------
Re: Black Rectangle of Doom
Hi Jay,
Thanks for that, really appreciate it. Okay, getting further now that before, its returning a 'failure' message now which is more than before. Now just to work out why. DOH! Updating my perl libraries just in case thats part of the problem. Shouldn't be but you never know
Davin
Thanks for that, really appreciate it. Okay, getting further now that before, its returning a 'failure' message now which is more than before. Now just to work out why. DOH! Updating my perl libraries just in case thats part of the problem. Shouldn't be but you never know
Davin