Re: Camera resolution settings



This is my camerea info

biWidth: 240
biHeight: 320
biPlanes: 1
biBitCount: 12
biSizeImage: 115200 (240X320) X 12 / 8
biCompression: YV12

So if one of my samples is 115200 in bytes. How do I know where the Y,
U and V starts?






"Tim Roberts" wrote:

Kris <Kris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

"Alessandro Angeli" wrote:

scale the frames yourself. You can use the 320x240
resolution and easily halve it in both directions.

YV12 is just as easy as RGB:

http://msdn.microsoft.com/en-us/library/ms788178(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms867704.aspx

To halve YV12, skip every other scanline in each plane and
only copy every other sample (1 BYTE) of each scanline.

I am very unfamiliar with these formats and how they are layout and work. I
am not certain I understand what exactly you are saying. I had a look at the
code ... but still very confused

A YV12 image is basically made up of 3 smaller images, called "planes". For
a 320x240 image, you will get 320x240 bitmap with 8 bits per pixel for Y,
followed by a 160x120 bitmap with 8 bits per pixel for V, followed by a
160x120 bitmap with 8 bits per pixel for U.

So, to cut that 320x240 image in half, you have to do each plane
separately.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

.



Relevant Pages

  • Re: Camera resolution settings
    ... resolution and easily halve it in both directions. ... YV12 is just as easy as RGB: ... a 320x240 image, you will get 320x240 bitmap with 8 bits per pixel for Y, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Camera resolution settings
    ... Thanks I did ended up figuring it out... ... stride was. ... Read somewhere that for YV12 it's the width. ... starts 19,200 bytes after the V plane, and also occupies 19,200 bytes. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Camera resolution settings
    ... Thanks I did ended up figuring it out... ... stride was. ... Read somewhere that for YV12 it's the width. ... For the Y plane, yes. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: YV12 and I420
    ... >If a mediaSample has a format of I420 or YV12, how the memory is organized? ... Y --> Buffer start address ... First you have the Y plane, ... And for YV12: ...
    (microsoft.public.win32.programmer.directx.video)