![如何获取、生成或转换 YUV 图像文件?](https://linux22.com/image/1394008/%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E3%80%81%E7%94%9F%E6%88%90%E6%88%96%E8%BD%AC%E6%8D%A2%20YUV%20%E5%9B%BE%E5%83%8F%E6%96%87%E4%BB%B6%EF%BC%9F.png)
答案1
ffmpeg支持大量 YUV 像素格式(运行ffmpeg -pix_fmts
查看全部)。您可以使用以下方法将任何输入文件转换为 YUV 文件:
ffmpeg -i input.jpg -f rawvideo -pix_fmt yuv420p output.yuv
这同样适用于视频。
YUV 像素格式的完整列表:
Name Components Bits/Pixel
==============================================
yuv420p 3 12
yuv422p 3 16
yuv444p 3 24
yuv410p 3 9
yuv411p 3 12
yuvj420p 3 12
yuvj422p 3 16
yuvj444p 3 24
yuv440p 3 16
yuvj440p 3 16
yuva420p 4 20
yuv420p16le 3 24
yuv420p16be 3 24
yuv422p16le 3 32
yuv422p16be 3 32
yuv444p16le 3 48
yuv444p16be 3 48
yuv420p9be 3 13
yuv420p9le 3 13
yuv420p10be 3 15
yuv420p10le 3 15
yuv422p10be 3 20
yuv422p10le 3 20
yuv444p9be 3 27
yuv444p9le 3 27
yuv444p10be 3 30
yuv444p10le 3 30
yuv422p9be 3 18
yuv422p9le 3 18
yuva420p9be 4 22
yuva420p9le 4 22
yuva422p9be 4 27
yuva422p9le 4 27
yuva444p9be 4 36
yuva444p9le 4 36
yuva420p10be 4 25
yuva420p10le 4 25
yuva422p10be 4 30
yuva422p10le 4 30
yuva444p10be 4 40
yuva444p10le 4 40
yuva420p16be 4 40
yuva420p16le 4 40
yuva422p16be 4 48
yuva422p16le 4 48
yuva444p16be 4 64
yuva444p16le 4 64
yuva444p 4 32
yuva422p 4 24
yuv420p12be 3 18
yuv420p12le 3 18
yuv420p14be 3 21
yuv420p14le 3 21
yuv422p12be 3 24
yuv422p12le 3 24
yuv422p14be 3 28
yuv422p14le 3 28
yuv444p12be 3 36
yuv444p12le 3 36
yuv444p14be 3 42
yuv444p14le 3 42
yuvj411p 3 12