OBS里面video format视频格式问题


1. linux下视频设备有个 V4L2
Video for Linux two(Video4Linux2)简称V4L2,是V4L的改进版。V4L2是linux操作系统下一套用于采集图片、视频和音频数据的通用API接口,配合适当的视频采集设备和相应的驱动程序,可以实现图片、视频、音频等的采集。V4L2像一个优秀的快递员,将视频采集设备的图像数据安全、高效的传递给不同需求的用户。

VIDEO FORMAT ,视频存储的格式,Y UV: 亮度信息(Y)与色彩信息(UV)分离,没有UV信息一样可以显示完整的图像,只不过是黑白的.
Y ranges from 0 to 1 (or 0 to 255 in digital formats),
while U and V range from -0.5 to 0.5 (or -128 to 127 in signed digital form, or 0 to 255 in unsigned form).

YUV格式有两大类:planar和packed。
对于planar的YUV格式,先连续存储所有像素点的Y,紧接着存储所有像素点的U,随后是所有像素点的V。
对于packed的YUV格式,每个像素点的Y,U,V是连续交叉存储的。


Y:  明亮度(Luminance或Luma),也就是灰度值.
U: blue minus luma (B-Y)
V:  red minus luma (-Y)
U and V provide color information and are "color difference" signals of blue minus luma (B-Y) and red minus luma (R-Y).
而“U”和“V” 表示的则是色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素的颜色。

YUV is actually the name of the color space that is common to all "YUV" pixel formats. Contrary to RGB formats (Red-Green-Blue), YUV colors are represented with one "luminance" component called Y (equivalent to grey scale) and two "chrominance" components, called U (blue projection) and V (red projection) respectively, hence the name
YUV实际上是所有“YUV”像素格式通用的颜色空间的名称。与RGB格式(红-绿-蓝)相反,YUV颜色由一个称为Y(相当于灰度)的“亮度”分量和两个分别称为U(蓝色投影)和V(红色投影)的“色度”分量表示,因此得名


R = Y + 1.4075 * (V - 128)
G = Y - 0.3455 * (U - 128) - (0.7169 * (V - 128))
B = Y + 1.7790 * (U - 128)

Y = R *  .299000 + G *  .587000 + B *  .114000
U = R * -.168736 + G * -.331264 + B *  .500000 + 128
V = R *  .500000 + G * -.418688 + B * -.081312 + 128

看到上面的YUV变成RGB颜色,让我忽然想到,三原色红色绿色蓝色可以组合成所有颜色,相当于是   f(r,g,b) = x, 那么 f(r,b,x) = g.  也就是这个四个变量得到三个就能求第四个。
YUV, 就是三个变量。从另外一个角度分解了颜色: Y亮度+U蓝色色差+V红色色差。
他们的极限值转换,也可以看出一个现象:
 U和V都是-0.5的时候,Y为0,那么这个色点就是暗Green色。
 U和V都是0.5的时候,Y为0,那么这个色点就是暗粉紫色。

这个直观的展现了YUV组合产生的色彩图。
https://softpixel.com/~cwright/programming/colorspace/yuv/


https://zhuanlan.zhihu.com/p/443727970
阅读量: 315
发布于:
修改于: