0

我正在尝试处理使用 vrl2 捕获的 .raw 图像文件,它是来自 Logitech c920 网络摄像头的具有 yuv422 色彩空间的 h264 编码图像,dcraw对我不起作用,但是从我之前的问题来看,这个命令在低性能下工作正常(a 32kb jpg 图像,但是使用 opencv 捕获我得到了相同 640x480 分辨率的 900kb 图像):

ffmpeg -f rawvideo -s 640x480 -pix_fmt yuyv422 -i frame-1.raw frame-1.jpg

我需要用 C 或 ffmpeg api/OpenCV 等编写的代码 .. 来执行与此命令相同的操作,我不想在 Qt 中使用 QProcess(我正在使用 Qt 的服务器上工作,我正在尝试发送从 Raspberry PI 到服务器的原始文件并对其进行处理),dcraw 输出是损坏的图像。

4

1 回答 1

2

http://ffmpeg.org/doxygen/trunk/examples.html

There should be some api samples in there that show how to get the image out with that specific encoding.

When interacting with a RAW file, I have also used IrfanView. If you know the headersize of the file and the width and the height and the bits per pixel per color, you can see what it looks like quickly that way.

EDIT: I tried using Irfanview with your RAW, and I got something close, but not quite. The coloring was always off. I don't think it can handle that particular encoding of a RAW file right now.

于 2013-03-11T20:28:15.593 回答