Spectra 8 and image combing

Support and queries relating to all previous versions of ZoneMinder
skydiver
Posts: 86
Joined: Wed Jun 16, 2004 7:15 pm

Spectra 8 and image combing

Post by skydiver »

OK, I know this is an old topic but I am looking for some help from others who are using a similar setup.

Ituner Spectra 8 card on FC3 (2.6.12-1.1381_FC3)
modprobe.conf line:
options bttv card=42,42,42,42 pll=1 radio=0 tuner=4 sloppy=1 chroma_agc=1 mmap=1 vbibufs=4 v4l2=1 gbuffers=16

I am running only four NTSC camers on the card at 5 fps per camera at 640x480 RGB24 (three black and white camera, one color).

I am getting combing even though I am running some very good cameras at a slow capture speed with only one camera per bttv chip. I have tried adjusting the ZM_CAPTURES_PER_FRAME setting with no real changes the quality. Since I am running one camera per chip, this would seem to be logical since there are not other images being interlaced on the chip.

Here are a few examples of the combing that I am getting:
Image
Image
Image
If anyone has some suggestions on how to tweak this to get better clarity, I would appreciate it.

Skydiver
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Essentially this is because the card, as with most, cannot capture 480 horizontal lines at once, so it does two captures and interlaces them. I'm not sure there is an entirely satisfactory method of removing the effect though.
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

I looked into if i could de-interlace the images with a windows tool and all i found was gime the dropped the odd or even lines. Do we know of a card that6 doesnt suffer from this, as id love for it to be possible even if rarely used
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
skydiver
Posts: 86
Joined: Wed Jun 16, 2004 7:15 pm

Post by skydiver »

What would be the optimal capture settings for this card then?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

well max uninterlaced pal is 288 so i assume ntsc is 240 so 320x240
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
skydiver
Posts: 86
Joined: Wed Jun 16, 2004 7:15 pm

Post by skydiver »

Ituner quotes the specs on the Spectra 8 as max resolution of 768x576.

My cameras (the B&W shown here) are KPC-EX190H Hi resolution cameras. These cameras have an actual resolution of 811x508 pixels with an Effective Resolution of 768x494 and 600 Lines of Horizontal Resolution.

Is there a discrepancy with the Ituner specs?

Skydiver
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

No there is no discrepancy with their specs, the card can go that high by interlacing the images :roll: The card has two make two captures (even then odd lines) to interlace the image for sizes over 320x240. The combing effect you see is the time difference between the two snapshots.
Any thing smaller than 320x240 does not need to be interlaced.

I know that ituner makes there own drivers for their card, have you tried those?

Regards,
Corey
skydiver
Posts: 86
Joined: Wed Jun 16, 2004 7:15 pm

Post by skydiver »

Ituners site refers to v4l2 to support the bttv chipset, no specific driver for linux from them.

If this is indeed the cause of the problem, should I be able to reproduce the effect of the combing by using xawtv ofr some app that I can set to 640x480 and duplicate the problem?

If you know of a way to be able to test it from another app to eliminate ZM as the problem let me know so I can test it.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

you can use tvtime but apps like this have their own de-interlace filters to minimise the effect. I too played with full res but as yet have not figured it out
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Actualy the method to capture the image from the device that tvtime or xawtv use is different than ZM. ZM has to take snapshots of each input that you have a camera enabled. The other apps don't have to do this as they are using only one input to begin with.
skydiver
Posts: 86
Joined: Wed Jun 16, 2004 7:15 pm

Post by skydiver »

So is there the possibility that this could be corrected or improved in the capture made by ZM? If this is so, I would be willing to post a bounty to cure the problem (I have made a couple donations already).

It sounds like the problem could be corrected in software. I would be willing to talk to Ituner to see if they have some suggestions but I wouldn't know how to explain how images are being grabbed.

I am sure there are more than a few other users using this card since it has a pretty strong value/price/performance ratio.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Not really, more of a driver issue I believe.
conor
Posts: 28
Joined: Fri Sep 26, 2003 8:59 pm

Post by conor »

Skydiver,

there should be no need to look for a special driver. Try passing combfilter=1 to the list of params at your bttv module startup. This is worth a try in fixing that problem but I'll outline what may be going on below.

I think the effect is from the driver capturing frames in even field of one frame and odd field of the next frame rather than odd and then even of the one frame as it should be. The ability to capture a whole frame consisting of odd and even frames is there already in the Fusion 878A chip so I think it is possible and I thought the bttv driver set up to do that if the number of lines was greater than half the field line count.

Also there are other settings on the chip relating to odd and even fields and something called decimation. This may affect the outcome of a frame. If you're into looking at the kernel code it is always handy to have a PDF copy of the Fusion 878A chip manual which is available at the Conexant website.

I need to do some experiments myself with the bttv driver as I want to see the back of this problem as well. I'll be using the latest version of the bttv driver from linuxtv.org so I don't know if it will be applicable to your older kernel. Let me know how you get on with the combfiler setting though.

Regards,

Conor Downey
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Coner I had high hopes for this comb filter but unfortunantly for me it had no effect. When you sayt old kernel im on 2.6.13 do i need to update that? How did your testing go. Im very interested in resolving this res issue so anything i can do to help?
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

conor wrote:I think the effect is from the driver capturing frames in even field of one frame and odd field of the next frame rather than odd and then even of the one frame as it should be.
I suspect the catch is whether the camera is supplying an interlaced image that it has constructed by:
  1. Capture a full-frame full resolution image on CCD and read it out into local memory
  2. Transmit first half-frame extracted from memory
  3. Transmit second half-frame extracted from memory
or taking the easy option instead:
  1. Capture a frame on CCD
  2. Read out and transmit a half-frame
  3. Capture a frame on CCD
  4. Read out and transmit the other half-frame
I can imagine that high-end cameras might do the former, but they'd need more memory on board to store the intermediate data rather than reading it straight from the CCD. Low-end CCD cameras seem to do the latter, so you always get combing. You can see the effect on freeze-frame if you've recorded onto VCR, provided your VCR doesn't pull a single half-frame freeze-frame trick.

Previous discussion here: http://www.zoneminder.com/forums/viewtopic.php?t=1546
Rick Hewett
Locked