Re: Hauppauge capture

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



Note: This is a repost of a reply I made a while back, so you should find
it in the FAQ, original subject " bttv: Scaling and Cropping".  I
mention using clip bitmaps (undocumented bttv feature); another posting of
mine ought to be in the FAQ for that also.

Peter K

--------------------------------------------------

You can fix any black "borders" generated by bttv by blocking them with
clip
rects.  Assume (worst case) the card generates the following borders: left
= 7,
top = 4, right = 4, bottom = 0.  This is the case for NTSC; it may be
different
e.g. for PAL.  Take your original desired  rectangle of video and make it
larger
by that amount on each of the 4 edges.  Then make the left edge be on a
4-pixel
boundary, and make the width be a multiple of 4.  Also make the height a
multiple
of 4.  Now set that rectangle / size as the video size, along with 4
clipping
rectangles that block the areas expanded, outside the original desired
rectangle.

Assume the original desired rect is (oleft, otop, oright, obottom) - 4
integer
"non-inclusive" values, e.g. the width of the rect = oright - oleft.  To
generate
the rect (left, top, right, bottom) to be set into v4l:

int w = oright - oleft;
int h = obottom - otop;
top = otop - 4;
bottom = (otop + h + 3) & ~3;
left = (oleft - 7) & ~3;
right = (w + oleft) & ~3;

Set the rect (left, top, right, bottom) into v4l (width = right - left,
height =
bottom - top), blocking the difference between that rect and the "o" values
with
4 clip rectangles - or paint those in a bitmap, e.g. using X draw commands
and
XGetImage and set the bitmap.

I think the above is about right; it's derived from larger code I wrote
that does
work correctly.  In generalized code you also need to worry about clipping
to the
edge of the screen and not exceeding the min and max size (32x32, 640x480
for
NTSC) for the rect set into v4l.

Peter Kaczowka
Ucentric Systems LLC


rrubio wrote:

> We are currently using a Hauppauge ImpactVCB card for display & capture
> in our next generation Pencil Tester. Using the 6.4 bttv drivers for
> Linux, I'm seeing 4-5 black pixels at either end of the scanline on both
> a displayed and captured image. The desire is to display and capture a
> 640x480 image. It appears that image scaling is off since we do get 640
> pixels horizontally, yet it looks as if it encompasses some of the
> blanking interval. I tried the card in an NT box with the Hauppauge
> supplied drivers for NT and there are no extra black pixels on capture.
> I emphasize the "capture" portion as I don't believe this to be a
> graphics card issue which I know has caused  some headaches for others.
>  The question then is, has this been observed before? Is there a fix?
> Are there any utilities available that would allow us to poke at the
> registers on the Conexant chip? The guys at Hauppauge haven't played
> with Linux enough to help out. Any offerings would be greatly
> appreciated.
>
> Rick Rubio
> Dreamworks SKG
>
> _______________________________________________
> Video4linux-list mailing list
> Video4linux-list@xxxxxxxxxx
> https://listman.redhat.com/mailman/listinfo/video4linux-list





[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