public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Daniel Glöckner" <daniel-gl@gmx.net>
To: Michael Schimek <mschimek@gmx.at>
Cc: video4linux-list@redhat.com
Subject: Re: Need VIDIOC_CROPCAP clarification
Date: Sun, 8 Jun 2008 18:55:45 +0200	[thread overview]
Message-ID: <20080608165544.GB314@daniel.bse> (raw)
In-Reply-To: <1212928036.17465.1043.camel@localhost>

On Sun, Jun 08, 2008 at 02:27:16PM +0200, Michael Schimek wrote:
> I'd hope v4l2_cropcap tells me what the hardware is actually capable of,
> i.e. the maximum physical resolution, not interpolated pixels.

How many cards do support upscaling?
Defining crop units that way would make it impossible to make use of the
higher resolution in cropping after upscaling.

And it conflicts with the idea of using tv frame lines for vertical
units if the device can only capture one field.

> You think defrect should return the size and position of the active
> picture area in hardware units, not what the closest area is the
> hardware can actually capture?

Not necessarily in hardware units, but yes. Using hardware units would
suggest that the hardware is capable of cropping to that size.

> Well that's a possibility, but for once many drivers do not support
> VIDIOC_G/S_CROP, implying defrect is what they capture.

You mean drivers that support VIDIOC_CROPCAP without VIDIOC_G/S_CROP?
I see two possibilities:
1. add VIDIOC_G/S_CROP dummies
2. add to spec that drivers without VIDIOC_G/S_CROP capture bounds

> Well the idea was that all drivers support at least 1:1 scaling, defrect
> is what apps usually want to capture and what the hardware can actually
> capture, so defrect.width and .height is a valid image size and
> presumably the highest resolution image apps can get of the active
> picture area.

That makes me think about my old FAST MovieMachine Pro.
It does not have enough on board ram to capture both fields at full
resolution. It can downscale horizontally and vertically by dropping
pixels/lines in a Bresenham way. So it's either 448x576 or 704x372 maximum.
Using 13.5 MHz sample rate pixels horizontally and tv lines vertically as
crop units will make defrect too big to be a valid image size.
What do you suggest?

> That's right but I didn't pick the numbers. By default bttv always
> captured 480 lines and quite a few apps may depend on that. I guess most
> drivers capture 480 lines in NTSC-M mode, and most apps request 480
> scaled lines.

Ah those beautiful numbers divisibly by 16 needed for MPEG...
A workaround could be to decouple the startup crop region from defrect.
Then applications that don't know about cropping get 480 lines on open
while those that do can work with 486 lines. 

This is a problem for horizontal cropping as well, when the active
region is 702 pixels wide and scaling is impossible.

> The bt8x8 in particular
> cannot begin scaling on an even frame line and end on an odd frame line,
> of the opposite field, as an odd cropping height would suggest.

On bt8x8 you set the scaling factor and tell the hardware where to save
each line. You can't prevent the chip from using one more line for
scaling but you can set a scaling factor that maps 517 lines to 512
and then capture 512 lines.

> With known cropping units one can select an absolute position. Without
> that knowledge one can still move and resize the crop window relative to
> the default and pick scale factors.

So with unknown units one can still select the absolute position if defrect
is standardized.


The ability to capture without scaling could be implemented by other
means. One could for example pass v4l2_pix_format.width=0 to get the
unscaled width for the current crop region. Width and height should then
be tried independently to make it work with my old capture card.

  Daniel

P.S.: GMX hat -all im SPF TXT RR. Du solltest deren Mailserver benutzen.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

  reply	other threads:[~2008-06-08 16:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 21:26 Need VIDIOC_CROPCAP clarification Hans Verkuil
2008-05-27  1:16 ` Andy Walls
2008-05-27  6:53   ` Hans Verkuil
2008-05-27  7:00     ` Hans Verkuil
2008-05-27 23:14       ` Andy Walls
2008-06-06 22:29       ` Michael Schimek
2008-06-07  1:33         ` Daniel Glöckner
2008-06-08 12:27           ` Michael Schimek
2008-06-08 16:55             ` Daniel Glöckner [this message]
2008-06-07  2:28         ` Andy Walls
2008-06-08 12:27           ` Michael Schimek
2008-06-11 18:49         ` Hans Verkuil
2008-06-11 20:15           ` Daniel Glöckner
2008-05-27 23:24     ` Andy Walls
2008-05-28  2:19       ` Daniel Glöckner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080608165544.GB314@daniel.bse \
    --to=daniel-gl@gmx.net \
    --cc=mschimek@gmx.at \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox