Search code examples
androidandroid-camerayuvimage-formats

Android YUV Image format


In our application, we need to transfer video, we are using Camera class to capture the buffer and send to destination,

I have set format is YV12 as a Camera parameter to receive the buffer,

for the 500X300 buffer, we receive buffer of 230400 bytes,

i want to know , is this expected buffer size ?
I believe the size would be

Y Plane = width * height = 500X300 = 150000

U Plane = width/2 * height/2 = = 37500

V Plane = width/2 * height/2 = = 37500

                               ========
                                 225000                                     
                               ======== 

Can anyone explain me, if i need to get stride values of each component, how can i get that

Is there any way to get it ?


Solution

  • I guess Android document is already explained it:

    http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12