天天看點

v4l2-ctl --all擷取攝像頭資訊中Width/Height與Bytes per Line不相符

最近自己做了一個攝像頭驅動,通過v4l2 --all檢視攝像頭的所有屬性發現:

Video input : 0 (Camera 0: no power)

Format Video Capture:

    Width/Height      : 8000/6000

    Pixel Format      : 'RG10'

    Field             : None

    Bytes per Line    : 16128

    Size Image        : 96768000

    Colorspace        : sRGB

    Transfer Function : Default (maps to sRGB)

    YCbCr/HSV Encoding: Default (maps to ITU-R 601)

    Quantization      : Default (maps to Full Range)

    Flags             :

Width 是 8000,但是Bytes per Line  确是 16128。

按道理一個像素占兩個位元組,應該是16000,但是多出來128是什麼情況?

這是由于将對齊方式從64更改為256,您可以将其改回即可,隻需修改TEGRA_STRIDE_ALIGNMENT或将傳感器寬度* 2對齊為256。

位于…/ drivers / media / platform / tegra / camera / core.h中。

繼續閱讀