如何在 Ubuntu 上从 JPEG 或其他图像创建 YUV422 帧

2024-01-22

我想在 Ubuntu 上从任何图像创建一个示例 YUV422 帧,这样我就可以为了学习而编写 YUV422 到 RGB888 函数。我真的很希望能够使用值得信赖的工具来创建示例并转换回 jpeg。

我尝试过 ImageMagick 但显然做错了什么:

convert -size 640x480 -depth 24 test.jpg -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv
convert -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv -size 640x480 -depth 24 -colorspace RGB test2.jpg

我还在 Ubuntu 上安装了 mpegtools 软件包,以便使用 jpeg2yuv:

>> jpeg2yuv -f 1 test.jpg
   INFO: [jpeg2yuv] Reading jpeg filenames from stdin.
   INFO: [jpeg2yuv] Parsing & checking input files.

**ERROR: [jpeg2yuv] System error while opening: "": No such file or directory

显然,还有其他问题。有人可以阐明我如何实现这一目标吗?谢谢 -


这样做与ffmpeg:

ffmpeg -i a.jpg -s 640x480 -pix_fmt yuv422p a.yuv
ffmpeg -pix_fmt yuv422p -s 640x480 -i a.yuv b.jpg
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 Ubuntu 上从 JPEG 或其他图像创建 YUV422 帧 的相关文章

随机推荐