Interlaced at 384x288

Forum for questions and support relating to the 1.25.x releases only.
Locked
primiano
Posts: 4
Joined: Tue Sep 06, 2011 5:24 pm

Interlaced at 384x288

Post by primiano »

Hello,
I have made a DVR system using a KDC-8800 clone (it has 8 bt878 chips and anoher bigger chip which I guess is a PCI-bridge) with some (cheap) CCTV cameras of different brands.

I originally set-up all the (PAL) cameras to capture at 720x576 pixels @ 10 fps, BGR24. However, it soon revealed a bad choice since I was getting highly interlaced pictures.
The strange fact was I was getting very "ghosty" artifacts: the resulting images seemed to be an interlace of distant frames in time, not consecutive ones, as I expected them to be. I tried to play with V4L_MULTI_BUFFER and CAPTURES_PER_FRAME options with no success. Even trying to rise or lower the capture frame rate did not bring to any success.

Anyway, I decided to switch (all the cameras) to 384x288 resolution (still to 10 fps) to get rid of interlacing.
But, surprisingly, I am still getting interlaced images (on all the cameras). Now the interlace seems more "sequential", but yes it is absolutely perceptible and annoying (see the attached image).
Initerlaced frame 384x288
Initerlaced frame 384x288
interlaced.jpg (20.55 KiB) Viewed 3346 times
Any hints?

I attach you some details of my sw/hw configuration:

--- bttv-option ---
options i2c-algo-bit bit_test=1
options bttv gbuffers=32 card=77,77,77,77,77,77,77,77 tuner=-1,-1,-1,-1,-1,-1,-1,-1 radio=0 coring=1 full_luma_range=1 chroma_agc=1 pll=1 combfilter=1 autoload=0 triton1=0
(I have tried also with card=102.... with no success)


-- lspci ---

Code: Select all

00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
03:00.0 PCI bridge: Hint Corp HiNT HB4 PCI-PCI Bridge (PCI6150) (rev 04)
04:08.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:08.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:09.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:09.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0a.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0a.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0b.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0c.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0c.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0d.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0d.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0e.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0e.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
04:0f.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
04:0f.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

--- cat /proc/interrupts ---

Code: Select all

           CPU0       CPU1       CPU2       CPU3
  0:  624998263      19015      18869      19004    IO-APIC-edge  timer
  1:          0          0          2          2    IO-APIC-edge  i8042
  3:    6566626   22095440    5300174    1107347    IO-APIC-edge  serial
  8:          1          1          0          1    IO-APIC-edge  rtc
  9:          0          0          0          0   IO-APIC-level  acpi
 50:    2846889    5973116   54555941   17397424   IO-APIC-level  bttv0, bttv4
169:      19018      41474   78733775   20161040   IO-APIC-level  uhci_hcd:usb5, HDA Intel, bttv3, bttv7
209:     176745     260550   77344457   22497212   IO-APIC-level  uhci_hcd:usb4, bttv2, bttv6
217:          0          1          0          2   IO-APIC-level  ehci_hcd:usb1, uhci_hcd:usb2
225:      10228      10167   70829516   23168986   IO-APIC-level  uhci_hcd:usb3, ata_piix, bttv1, bttv5
233:         33          0          0   13979142         PCI-MSI  eth0
NMI:          0          0          0          0
LOC:  625054912  625054913  625054891  625054910
ERR:          0
MIS:          0
Regards,
Primiano
linuxsense
Posts: 374
Joined: Wed Nov 07, 2007 1:59 am
Location: Huntington Beach, California
Contact:

Re: Interlaced at 384x288

Post by linuxsense »

Try setting V4L2_CAPTURE_FIELDS (Options > Config) to 1 or 2. If I remember correctly 1 worked best for me at 320x240 and 2 is currently working well at 640x480.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Interlaced at 384x288

Post by mastertheknife »

PAL is 768x576 and NTSC is 640x480. If you want non-interlaced image, for PAL you will have to capture at no higher than 384x288 (768x288 will also do) and for NSTC no higher than 320x240 (640x240 will also do) and then you can use the V4L2_CAPTURE_FIELDS option to control the behavior. I personally use 384x288 (this is correct, unlike 352x288 which is for old analog CCTV monitors, which are not 4:3) with value of 2 for my 2 PAL cameras.

For your card, see this:
http://www.zoneminder.com/wiki/index.php/Kodicom_8800

mastertheknife
Last edited by mastertheknife on Wed Sep 14, 2011 12:57 am, edited 3 times in total.
Kfir Itzhak.
linuxsense
Posts: 374
Joined: Wed Nov 07, 2007 1:59 am
Location: Huntington Beach, California
Contact:

Re: Interlaced at 384x288

Post by linuxsense »

Regardless of how things are supposed to work with 1.25 and VFL2 even at 320x240 my images were interlaced and looked horrible, with the tweaking of V4L2_CAPTURE_FIELDS not only are 320x240 images (live and captured) non-interlaced but I can capture at 640x480 and use '2' to just pull the top field so the images and live stream do not suffer from the same appearance as an interlaced 640x480 image/video.
primiano
Posts: 4
Joined: Tue Sep 06, 2011 5:24 pm

Re: Interlaced at 384x288

Post by primiano »

I made a try with V4L2_CAPTURE_FIELDS.
The only problem is that monitors and events looks stretched (as if they were a 720*288 rectangle).
How can fix it? I tried to check the "preserve 4:3 aspect ratio" but it is not preserved.
I think there is a bug behind it, since when i check the "apsect ratio box" in a camera settings and click save, the option is not really saved.
I took a look in the database and it seems that the column related to the aspect ratio is missing.

I have removed old zoneminder and reinstalled v1.25.0 from scratch (even the DB).

So any clue to get a non-stretched image?

Thanks
------

OK, I seems it solved. It does not stretch images capturing at 384x288.
Perhaps I could have a try switching back to 768x576 to see what happens.
Locked