Re: ghost effect and black borders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Ronald Bultje wrote:
On Sat, 2003-07-19 at 12:13, Pascal Bleser wrote:
The black border is 1 to 2 pixels high on top and bottom (in the middle of the image it gets from 1 pixel to 2 pixel high).
You're having black borders in the middle?!? Can you upload a screenshot
somewhere?

No, in fact the borders are around the picture, not in the middle ;)
I've uploaded a capture here:

http://guru.unixtech.be/v4l/image.gif

This one is made in 768x576 with 8bit depth, PAL, in VIDEO_PALETTE_GREY mode (bt878 chipset). I then convert it into 8bit grayscale GIF with ImageMagick, but it isn't an issue with that (webcam has the same problem).

As said, I get the same result using the webcam cmdline tool:

http://guru.unixtech.be/v4l/webcam.jpg

(RGB24, PAL, same size)

And with other width and height settings as well.

BTW, it's a 2.4.19 kernel, but I get the same with 2.4.21.
The source is a grayscale camera (Panasonic CCTV).

I wrote the capture routine myself, using the kernel syscalls.

---->8-[snip]------------------------------
struct video_capability capability_;
struct video_channel channel_[5];
struct video_picture picture_;
struct video_mbuf vm_;
struct video_mmap vmm_;
int fd_;
unsigned char* vmap_; //map
int i;

fd_ = open(DEVICE, O_RDWR);
ioctl(fd_, VIDIOCGCAP, &capability_);
for (i=0; (i < capability_.channels) && (i < 5); i++) {
  channel_[i].channel = i;
  ioctl(fd_, VIDIOCGCHAN, &(channel_[i]));
  channel_[i].norm = VIDEO_TUNER_PAL;
}
ioctl(fd_, VIDIOCSCHAN, &(channel_[1]));

picture_.brightness = 32767;
picture_.hue = 32767;
picture_.colour = 32767;
picture_.contrast = 32767;
picture_.whiteness = 32767;
picture_.depth = 8;
picture_.palette = VIDEO_PALETTE_GREY;
ioctl(fd_, VIDIOCSPICT, &(picture_));
ioctl(fd_, VIDIOCGMBUF, &(vm_));
vmap_ = (unsigned char*) mmap(0, vm_.size,
             PROT_READ, MAP_SHARED, fd_, 0);

vmm_.format = VIDEO_PALETTE_GREY;
vmm_.frame = 0;
vmm_.width = WIDTH;
vmm_.height = HEIGHT;
vmm_.format = PALETTE;

ioctl(fd_, VIDIOCMCAPTURE, &(vmm_));

i = 0;
ioctl(fd_, VIDIOCSYNC, &i);
memcpy(buffer, vmap_ + vm_.offsets[0], bufsize);
---->8-[snip]------------------------------

This is just an excerpt, I'm checking the return codes properly in the real code.

As you can see, the picture has several issues:
- the black border on left and right
- the border on top and bottom
- a "ghost" effect on the left and right edges
(the black spots on the picture are just some dust on the camera's objective ;))

Could this come from
- a wrong tuner setting ? (I tried some, makes no difference)
- a need to make the capture using another palette mode ? (altough webcam uses RGB24 or RGB32 and gets the same result)
- ... ?

It's an embedded board and I don't have the exact chipset, but autoprobing works and detects bt878/bt848 (lspci says it's a BT878):

00:0b.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 64 (4000ns min, 10000ns max)
        Interrupt: pin A routed to IRQ 10
        Region 0: Memory at dfcfe000 (32-bit, prefetchable) [size=4K]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

I also tried to force the chipset with the card=... parameter for the module. It didn't help either, I hade the same issues on the pictures.
I use the pll=1 setting to use PAL properly.
No idea what tuner to use or if it has any incidence on that at all.
It worked without specifying a tuner but I tried 2 or 3 different settings in the modules, it didn't change anything.

The board is quite slow (it's a "Vortex86", equivalent to a Pentium I, altough it has MMX) but as I don't do any video streaming (just one-shot, user-triggered captures), I don't think it could have any incidence.

Thanks for any help

--
  -o) Pascal Bleser        http://guru.unixtech.be
  /\\ <pascal.bleser@xxxxxxxxx> <guru@xxxxxxxxxxx>
 _\_v The more things change, the more they stay insane.




[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux