Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Sharpcap capture modes


DBushell

Recommended Posts

It doesn't make a whole lot of odds which you chose. All it affects is the format that the output file is written in, not the format of the data coming over the wire from the camera. To the best of my knowledge none of the codecs offered are lossy so as long as the programs you want to read the data can handle the codec it just doesn't matter. I use either of YUY2 or I420 I think. I can't recall what the third might be. YUYV, perhaps?

James

Link to comment
Share on other sites

YUY2 is the same as YUYV.

I would argue that these are indeed lossy codecs as the colour data is subsampled and you can never get it back. However, YUY2 (16 bpp) is a better choice than I420 (12 bpp) as I420 does more colour subsampling.

Cheers,

Chris

Link to comment
Share on other sites

YUY2 is the same as YUYV.

I would argue that these are indeed lossy codecs as the colour data is subsampled and you can never get it back. However, YUY2 (16 bpp) is a better choice than I420 (12 bpp) as I420 does more colour subsampling.

Ah, fair enough. I must be misremembering. Perhaps it's that the camera sensor output is only 8bpp and it doesn't matter which you use. I went through all this ages ago, but I no longer have all the notes I made :(

James

Link to comment
Share on other sites

Ah, fair enough. I must be misremembering. Perhaps it's that the camera sensor output is only 8bpp and it doesn't matter which you use. I went through all this ages ago, but I no longer have all the notes I made :(

James

Indeed, if the camera has already thrown away lots of colour data then there is little point in saving it in a better format. I thought (not sure why) that these cameras used YUY2 coding to get the data to the PC, in which case I420 would be throwing yet more data.

Chris

Link to comment
Share on other sites

Indeed, if the camera has already thrown away lots of colour data then there is little point in saving it in a better format. I thought (not sure why) that these cameras used YUY2 coding to get the data to the PC, in which case I420 would be throwing yet more data.

I don't think the wire format is any recognised video format. The original Linux driver was written by someone who had to sign an NDA with Philips to get access to their specs for the compression used in the 640x480 modes which surely wouldn't have been the case if it were just a standard video format. At some point toys were thrown out of the pram and someone else reverse-engineered the compression algorithm. The Linux driver unpicks the compression and provides it to the user as YUV420 by completely regenerating the frame from scratch rather than just passing on the uncompressed frame. That would also seem quite an odd thing to do if the data were already in a recognised format.

James

Link to comment
Share on other sites

Yes, the video over the wire will (almost certainly) be luminance plus subsampled chrominance with some lossy compression applied on top of that for frames rates greater than 5 fps. The issue I see is just how subsampled the chrominance actually is. If each chrominance value comes from 2 pixels then it is equivalent to YUY2 and using an I420 codec will mean throwing away more data. However, if each chrominance value comes from 4 pixels then it is equivalent to I420 and no data will be lost by using this codec.

Chris

Link to comment
Share on other sites

I'd be inclined to believe that as the Linux driver pushes out YUV420 there's no more data than that in the datastream from the camera. I'm reasonably sure that any decent Linux driver-coder would take the view that it isn't the driver's place to throw away data. If more data were available they'd use a less compressed

Correct me if I'm wrong Chris, but I think YUV420 is 8-bit luminance and then 8-bits for each of the chrominance values sampled from four pixels, so you'd end up with four pixels of 24 bits each (8 bits of Y, U and V) being written in the output stream as six 8-bit values which works out as 12bpp. Isn't that the same as I420?

James

Link to comment
Share on other sites

Correct me if I'm wrong Chris, but I think YUV420 is 8-bit luminance and then 8-bits for each of the chrominance values sampled from four pixels, so you'd end up with four pixels of 24 bits each (8 bits of Y, U and V) being written in the output stream as six 8-bit values which works out as 12bpp. Isn't that the same as I420?

James

Yes, that is pretty much it. There is a slight difference in that YUV420 interleaves the Y, U and V data while I420 keeps them in individual blocks, but it will basically be the same data.

Link to comment
Share on other sites

I'm not sure that Chris and I are getting anywhere nearer to a definitive answer even if we are increasing the sum total of knowledge about the way the SPC900 works, at least amongst those who have stuck with us this far :)

However, as another random datapoint, these images were taken using my SPC900 of Europa's transit of Jupiter a few nights ago. They're quite possibly the best images of Jupiter I've ever managed, and they were recorded using the I420 codec. Next time it's possible to see the sky for more than thirty seconds at a time perhaps I'll do some shots using all three possible encodings and we can play "spot the best" :)

europa.png

James

Link to comment
Share on other sites

I think the conclusion is that the SPC900 has already sub-sampled the colour information so you might as well use the I420 codec and get the smallest file size possible. YUY2 will also be fine but avoid using any codec with lossy compression.

Cheers,

Chris

Link to comment
Share on other sites

James, I would be very interested to see the comparison if you do manage to get one done.

Just finished modding my first webcam this week, fingers crossed I can give it a go with sharpcap tonight!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.