4

I would like to be able to work on frames from an .mxf video file. The image format of the video is JPEG 2000, using a YUV color space with 4:2:2 subsampling and lossless compression.

My intentions are to extract frames from this video using ffmpeg. Extracted frames would then be processed in Matlab (at the moment I'm interested in performing colorization).

I want to extract the frames with as minimal data loss as possible and I would like to work in the YUV color space. I understand PNG involves a lossless process, but only involves the RGB color space - so not an option.

I think I can extract jpeg2000 frames in the YUV color space, but I'm not sure if I'm losing data from the compression process. I attempted the following code in ffmpeg:

ffmpeg -i video.mxf -r 1/5 out%03d.jp2

... however, the extracted jp2 files are unreadable in various software, including HiView which is a specialised JPEG 2000 software.

Quesiton 1: Is this jpeg 2000 extraction method lossless? What am I doing wrong?

I also considered extracting the images in the tiff format where I can achieve the YUV and lossless requirements. I attempted the following code in ffmpeg:

ffmpeg -i video.mxf -vcodec tiff f%10d.tif

... however, the extracted tiff files are unreadable in software such as paint, paint.net and windows photo viewer.

Question 2: Is this tiff extraction method correct? What am I doing wrong?

Question 3: What is an ideal image format that covers my YUV and lossless requirements?

4

1 回答 1

1

您需要使用可以导入 YUV 图像的图像编辑器,更重要的是,在 YUV 颜色空间中工作。如果后一个功能不存在,假设编辑器可以保存在 YUV 空间中,那么当您保存编辑后的图像时,将会出现 YUV -> RGB -> YUV 往返,并且会丢失一些数据。

您的 TIFF 提取似乎没有任何问题。这些是 YUV 空间 TIFF,因此您的图像编辑器不理解它们。

ffplay f0000000001.tif

确认 TIFF 确实有效。

如果您找不到 YUV 编辑器,我建议您尝试免费的Fusion VFX 应用程序或任何类似的视频合成应用程序。最坏的情况,您可以像这样输出 RGB TIFF,

ffmpeg -i video.mxf -pix_fmt rgb48le f%10d.tif

Photoshop 可以打开这些,就像当前的 GIMP开发 版本一样。

于 2016-02-15T04:57:50.020 回答