All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Kaiser <linux-dvb@kaiser-linux.li>
To: Laurent Pinchart <laurent.pinchart@skynet.be>
Cc: video4linux-list@redhat.com
Subject: Re: V4L2_PIX_FMT_RAW
Date: Thu, 21 Feb 2008 23:28:52 +0100	[thread overview]
Message-ID: <47BDFB24.10503@kaiser-linux.li> (raw)
In-Reply-To: <200802212259.38624.laurent.pinchart@skynet.be>

Laurent Pinchart wrote:
> Hi Thomas and Harri,
> 
> On Thursday 21 February 2008, Thomas Kaiser wrote:
>> H. Willstrand wrote:
>>> On Thu, Feb 21, 2008 at 1:00 PM, Thomas Kaiser
>>>
>>> <linux-dvb@kaiser-linux.li> wrote:
>>>> H. Willstrand wrote:
>>>>  > On Thu, Feb 21, 2008 at 2:20 AM, Daniel Glöckner <daniel-gl@gmx.net> 
> wrote:
>>>>  >> On Thu, Feb 21, 2008 at 01:02:39AM +0100, H. Willstrand wrote:
>>>>  >>  > What's the problem with having a name of the formalized data in
>>>>  >>  > the video stream? ie raw do not mean undefined.
>>>>  >>
>>>>  >>  I thought you wanted to avoid having to define V4L2_PIX_FMT_x for
>>>>  >> an exploding number of proprietary formats that are quite similar
>>>>  >> but still incompatible. It makes sense for formats that are used by
>>>>  >> more than one driver.
>>>>  >
>>>>  > Correct, the number of unique pixel formats should be kept down.
>>>>  > Again, comparing with digital cameras there are >200 proprietary
>>>>  > formats and there is a "clean-up" on-going where the "market" is
>>>>  > aiming for a OpenRAW.
>>>>  >
>>>>  > However, by declaring a generic RAW format (which is then driver
>>>>  > specific) doesn't help the user mode app developers. Calling a
>>>>  > multitude of libraries to see if you get lucky might not be a good
>>>>  > idea.
>>>>  >
>>>>  > Still, I'm suspectious about the definition "raw" used here.
>>>>  > RAW should mean unprocessed image data:
>>>>  > * no white balance adjustment
>>>>  > * no color saturation adjustments
>>>>  > * no contrast adjustments
>>>>  > * no sharpness improvements
>>>>  > * no compression with loss
>>>>
>>>>  Yes, raw means "as it is" no stripping, decoding  or removing of SOF
>>>> headers are done in the driver. May be V4L2_PIX_FMT_AII (AII -> As It
>>>> Is) is the better name?
>>> I struggle with the probability to find several CCD's having similar
>>> formats. There aren't so many manifactors of CCD's but they truelly
>>> can generate divergeting formats. Worst case scenario means >200
>>> V4L2_PIX_FMT_RAW_...
>>>
>>> I think RAW is a OK name, the question is if the subcomponents of the
>>> RAW formats has similarities, if so they might be standardized.
>>> Looking into different Sony CCD's it's clearly possible, but after the
>>> CCD the data has to be buffered, packaged and transmitted which of
>>> course can be done in several ways...
>>>
>>> Cheers,
>>> Harri
>>>
>>>>  > So, by looking for similarities in the "raw" formats where available
>>>>  > there should be a potential to consolidate them.
>>>>  >
>>>>  >>  > I don't see how separate RAW ioctl's will add value to the V4l2
>>>>  >>  > API, it fits into the current API.
>>>>  >>
>>>>  >>  Yes, it does. Each driver having multiple raw formats just needs a
>>>>  >>  private control id to select one.
>>>>  >
>>>>  > I was more thinking about the VIDIOC_S_RAW stuff, a VIDIOC_S_FMT
>>>>  > should do the job.
>>>>  > I.e. I think there should be strong reasons to break V4L2 API
>>>>  > behavior.
>>>>  >
>>>>  > Harri
>> Actually, in a webcam you have the image sensor and a usb bridge. Usually,
>> the sensor capture a picture in Bayer pattern. This gets forwarded to the
>> usb bridge. The usb bridge may or may not transfer the picture to an other
>> format and/or compress it with a standard compression algo or a proprietary
>> compression algo. The resulting data stream will be transmitted over the
>> usb interface.
>>
>> I just would like to get this resulting stream to user space without
>> manipulation/conversion/decoding of the stream in the kernel module.
> 
> For most USB devices the resulting stream will be completely unusable. USB 
> provides packet boundary information that would be lost. Except when the data 
> transmitted over USB is stream-based (MPEG 2/4 for instance), the resulting 
> stream will have headers intermixed with data with no way to tell them apart.
> 
>> That means we don't know what the format is in this data which comes trough
>> the usb interface. That's way I call it raw.
> 
> That's not true. If you really don't know what format the data are in, there 
> is little point in getting the data.

I mean in known video formats. Some webcames do not send known video formats.

> 
> Video frames can be in a standard format (MJPEG, RGB, ...) or in a proprietary 
> format (mostly device-specific compression formats). That format is 
> identified at the V4L2 level by a four character code (fourcc). A quick look 
> at videodev2.h shows that several vendor-specific formats are defined 
> (SN9C10x compression, pwc compression, ...). New formats should be added as 
> new devices hit the market.
> 
>> At the moment with V4L2, I have to forward a stream to user space which is
>> in a format v4l2 knows. That means I have sometimes to do heavy data
>> processing in the kernel module to decode/convert the data from the usb
>> stream to a known v4l2 video format.
> 
> Nothing in V4L2 prevents you from using a private fourcc, although it would be 
> easier to submit new fourcc's for inclusion in V4L2. As long as the userspace 
> application supports the format and recognises its fourcc your kernel driver 
> will only have to handle the USB headers (which are part of the protocol, not 
> the format) and won't have to touch the video frame data at all.

Looks like I have to do my homework!

> 
>> That's way I want a official way to forward the untouched usb stream to
>> user space!
> 
> Just define a new fourcc and use it to identify your data format.

OK, Homework, again ;-)

> 
>> How the user space application has to react on this stream is an other
>> story, I think. But there will be some way to tell the usespace application
>> what to do with this "unknown" stream, I am sure.
> 
> With a defined fourcc the stream won't be "unknown".

Homework?

> 
> Best regards,
> 
> Laurent Pinchart

Thanks for the information.

Best Regards,

Thomas


-- 
http://www.kaiser-linux.li

--
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-02-21 22:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 19:25 V4L2_PIX_FMT_RAW Thomas Kaiser
     [not found] ` <175f5a0f0802201208u4bca35afqc0291136fe2482b@mail.gmail.com>
     [not found]   ` <47BC8BFC.2000602@kaiser-linux.li>
     [not found]     ` <175f5a0f0802201232y6a1bfc53u4fe92fede3abcb34@mail.gmail.com>
     [not found]       ` <47BC90CA.1000707@kaiser-linux.li>
     [not found]         ` <175f5a0f0802201254q7dc96190k35caafe9ba7d3274@mail.gmail.com>
2008-02-20 21:11           ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-20 21:41             ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-20 22:02               ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-20 21:58             ` V4L2_PIX_FMT_RAW Daniel Glöckner
2008-02-20 22:12               ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-20 22:41                 ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-20 23:20                   ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-21  0:02                     ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21  1:20                       ` V4L2_PIX_FMT_RAW Daniel Glöckner
2008-02-21  9:10                         ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 12:00                           ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-21 12:43                             ` V4L2_PIX_FMT_RAW Daniel Glöckner
2008-02-21 12:48                               ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 12:43                             ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 18:55                               ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-21 20:12                                 ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 20:40                                   ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-21 21:06                                     ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 21:29                                       ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-21 21:40                                         ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-21 22:03                                     ` V4L2_PIX_FMT_RAW Laurent Pinchart
2008-02-21 22:22                                       ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-22  9:38                                         ` V4L2_PIX_FMT_RAW Thierry Merle
2008-02-22 12:22                                           ` V4L2_PIX_FMT_RAW Thomas Kaiser
2008-02-23  0:15                                           ` V4L2_PIX_FMT_RAW H. Willstrand
2008-02-23 19:51                                             ` V4L2_PIX_FMT_RAW Thierry Merle
2008-02-24 21:46                                               ` V4L2_PIX_FMT_RAW Laurent Pinchart
2008-02-21 21:59                                 ` V4L2_PIX_FMT_RAW Laurent Pinchart
2008-02-21 22:28                                   ` Thomas Kaiser [this message]

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=47BDFB24.10503@kaiser-linux.li \
    --to=linux-dvb@kaiser-linux.li \
    --cc=laurent.pinchart@skynet.be \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.