Re: V4L2 - Capturing uncompressed data

2009-05-18 Thread Guillaume

  It depends on the camera.
 
 ...and the driver. I don't know much about various _web_cameras and their 
 drivers, but I could well imagine, that you're asking for an unsupported 
 YUV variation, whereas some other format would be supported. Why don't you 
 use VIDIOC_ENUM_FMT to list all supported formats? Or even look in the 
 driver source - it's open
 


Hi,
Thanks for your answer. I didn't try ENUM_FMT but I tried to set every available
format of V4L2 (that we can found in the videodev2.h), but the only one
possible is the compressed JPEG Format.

You said to look in the driver source, but where exactly do I have to look for ?

Thank you for your time,

Regards,
Guillaume.



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-18 Thread Guillaume
Guillaume Kowaio at gmail.com writes:


I just tried the ENUM_FMT, and there is only 1 format, 
the JPEG one.

But I don't understand one thing. The webcam displays 
compressed Jpeg data. OK.
But before that compression, the data aren't in 
uncompressed data ? 
It's the driver or something which is doing that 
compression directly during the capture, but there 
really are no chance to get that uncompressed 
data before compression in JPEG ?

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-18 Thread Laurent Pinchart
Hi Guillaume,

On Monday 18 May 2009 09:32:53 Guillaume wrote:
 Guillaume Kowaio at gmail.com writes:


 I just tried the ENUM_FMT, and there is only 1 format, the JPEG one.

 But I don't understand one thing. The webcam displays compressed Jpeg data.
 OK.
 But before that compression, the data aren't in uncompressed data ?
 It's the driver or something which is doing that compression directly during
 the capture, but there really are no chance to get that uncompressed data
 before compression in JPEG ?

The video stream is compressed directly by the webcam and sent to the host in 
compressed form.

Best regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-18 Thread Guillaume
Laurent Pinchart laurent.pinchart at skynet.be writes:


 The video stream is compressed directly by the webcam and sent to the host in 
 compressed form.
 
 Best regards,
 
 Laurent Pinchart

I spoke with my supervisor. He'll try to get a camera 
which allow uncompressed format.
In the meantime, and in order to do stop-motion 
in the application, I need to get the best quality possible 
of the webcam in one 'shot' (not video, just picture).
Is there any way to get the value of compression of the jpeg
by the V4L2 in order to do a software extrapolation after.

For instance, with some webcams (1.3 millions pixels), 
you can capture a 640*480 resolution in video mode
but some allow pictures in 800*600 by extrapolation.

So in order to do that extrapolation, I need the value
of compression of the JPEG use by V4L2. Is it always the same,
or it depends on the camera ? And can v4l2 get and modify this value ?


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


V4L2 - Capturing uncompressed data

2009-05-15 Thread Guillaume
Hello,

I'm a French student and I'm doing an intern ship in a 
French image processing software company, 
and I've got some questions about V4L2 and more precisely, 
the video formats.

In the application, I just need to capture frames 
of webcams and display the result. 
After research, I found the capture example on the
http://v4l2spec.bytesex.org/ website. 
So now, I capture correctly the frames.

During the initialisation of the device,
 I'm doing a VIDIOC_G_FMT in order to
get the format description of the webcam. 
Then, I tried to change the pixelformat.
Indeed, I wanted the YUYV FORMAT because I need to get the raw data
in order to get the best quality possible.

My problem is, after the VIDIOC_S_FMT, the pixelformat field 
is set back to JPEG FORMAT (and the colorspace too) and so,
I don't get raw data, but compressed jpeg data.

I know that the VIDIOC_S_FMT try to change these fields 
but if the driver don't authorise them, 
it will put the originals back. 

But, I really need to get the
uncompressed data of the captured picture,
so is there by any chance, another solution to 'force' 
and capture the images in an Uncompressed format ? 
Or is it really set by the driver and so, 
no chance to have the raw ?

So, in my InitDevice I'm doing that :

 //Get FMT
Clear( mFmt, sizeof( mFmt ) );
mFmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;

if ( -1 == Xioctl ( mFd, VIDIOC_G_FMT, mFmt ) )
return false;

//Set FMT A LA RESOLUTION CHOISIE
:Clear( mFmt, sizeof( mFmt ) );
mFmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
mFmt.fmt.pix.width = iInfo.Width;
mFmt.fmt.pix.height = iInfo.Height;

//I want to capture raw data
in YUYV, no JPEG compressed stuff
mFmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;  

mFmt.fmt.pix.field = V4L2_FIELD_INTERLACED;

if ( -1 == Xioctl ( mFd, VIDIOC_S_FMT, mFmt ) )
return false;

   //JPEG - set yuyv failed
printf(%d\n,mFmt.fmt.pix.pixelformat);

 //JPEG - always jpeg, but i don't
want this
printf(%d\n,mFmt.fmt.pix.colorspace);  


To be clear, I want the uncompressed pixels of the capture. 
I already succeeded in converting from JPEG to BGR, 
but the data are compressed.

So now, I don't want to do that conversion. 
Actually, I want to save the
uncompressed data for quality directly!

But I don't know if that is possible because 
the driver of the webcam (VF0420 Live! Cam Vista IM - ov519)
 specified only JPEG format when I'm doing a 'V4l-info'.

I really looked for answers everywhere on the web,
so I'm losing hope and that's why I'm asking you that today. 
I'm sorry if my comment is misplaced or if the
answer has already been posted.

Thank you all,
Regards.
Guillaume. 

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-15 Thread Laurent Pinchart
Hi Guillaume,

On Friday 15 May 2009 15:03:11 Guillaume wrote:
 Hello,

 I'm a French student and I'm doing an intern ship in a French image
 processing software company, and I've got some questions about V4L2 and more
 precisely, the video formats.

 In the application, I just need to capture frames of webcams and display the
 result. After research, I found the capture example on the 
http://v4l2spec.bytesex.org/ website. So now, I capture correctly the frames.

 During the initialisation of the device, I'm doing a VIDIOC_G_FMT in order
 to get the format description of the webcam. Then, I tried to change the
 pixelformat. Indeed, I wanted the YUYV FORMAT because I need to get the raw
 data in order to get the best quality possible.

 My problem is, after the VIDIOC_S_FMT, the pixelformat field is set back to
 JPEG FORMAT (and the colorspace too) and so, I don't get raw data, but
 compressed jpeg data.

 I know that the VIDIOC_S_FMT try to change these fields but if the driver
 don't authorise them, it will put the originals back.

 But, I really need to get the uncompressed data of the captured picture,
 so is there by any chance, another solution to 'force' and capture the
 images in an Uncompressed format ? Or is it really set by the driver and so,
 no chance to have the raw ?

It depends on the camera. If the camera can deliver uncompressed data, you 
should be able to get that out of the driver. Otherwise you're stuck.

[snip]

 To be clear, I want the uncompressed pixels of the capture. I already
 succeeded in converting from JPEG to BGR, but the data are compressed.

 So now, I don't want to do that conversion. Actually, I want to save the
 uncompressed data for quality directly!

 But I don't know if that is possible because the driver of the webcam
 (VF0420 Live! Cam Vista IM - ov519) specified only JPEG format when I'm
 doing a 'V4l-info'.

That probably means that the camera can't deliver uncompressed data, although 
you should ask the driver's author to make sure. If the camera indeed supports 
(M)JPEG only, you will probably have to get another camera.

 I really looked for answers everywhere on the web, so I'm losing hope and
 that's why I'm asking you that today.I'm sorry if my comment is misplaced or
 if the answer has already been posted.

This is the right place for such questions, don't worry.

Best regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-15 Thread Guillaume
Laurent Pinchart laurent.pinchart at skynet.be writes:


 It depends on the camera. If the camera can deliver uncompressed data, you 
 should be able to get that out of the driver. Otherwise you're stuck.
 
 [snip]
 

Ok, it's what I was afraid of. 


 That probably means that the camera can't deliver uncompressed data, although 
 you should ask the driver's author to make sure. If the camera indeed 
 supports 
 (M)JPEG only, you will probably have to get another camera.
 

I'll tell that to my internship supervisor and I'll be back at you if I have
more questions.


 This is the right place for such questions, don't worry.
 
 Best regards,
 
 Laurent Pinchart
 

Thank you for the cordial welcome, I didn't know how mailing lists worked.

Have a good day !

Guillaume.


 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majordomo at vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
 




--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: V4L2 - Capturing uncompressed data

2009-05-15 Thread Guennadi Liakhovetski
On Fri, 15 May 2009, Laurent Pinchart wrote:

 Hi Guillaume,
 
 On Friday 15 May 2009 15:03:11 Guillaume wrote:

[snip]

  My problem is, after the VIDIOC_S_FMT, the pixelformat field is set back to
  JPEG FORMAT (and the colorspace too) and so, I don't get raw data, but
  compressed jpeg data.
 
  I know that the VIDIOC_S_FMT try to change these fields but if the driver
  don't authorise them, it will put the originals back.
 
  But, I really need to get the uncompressed data of the captured picture,
  so is there by any chance, another solution to 'force' and capture the
  images in an Uncompressed format ? Or is it really set by the driver and so,
  no chance to have the raw ?
 
 It depends on the camera.

...and the driver. I don't know much about various _web_cameras and their 
drivers, but I could well imagine, that you're asking for an unsupported 
YUV variation, whereas some other format would be supported. Why don't you 
use VIDIOC_ENUM_FMT to list all supported formats? Or even look in the 
driver source - it's open:-)

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html