How to find out resolution and count of frames in YUV 4:2:0 file?
问题 How to find out resolution and count of frames in YUV 4:2:0 file if i know how many pixel(luma samples) in the image? 回答1: YUV 4:2:0 planar looks like this: ---------------------- | Y | Cb|Cr | ---------------------- where: Y = width x height pixels (bytes) Cb = Y / 4 pixels (bytes) Cr = Y / 4 pixels (bytes) Total num pixels (bytes) = width * height * 3 / 2 This is how pixels are placed in 4:2:0 sub-sampling: As you can see, each chroma value is shared between 4 luma-pixels. Basically, the