OpenCV:将视频保存为 IYUV
我正在尝试保存相机拍摄的视频。 当我尝试使用 DIVX fourcc 时它效果很好,但我想做的是使用 IYUV fourcc 保存,但它给出了糟糕的结果:颜色似乎被合并,openCV 看起来没有进行转换。
我已经尝试过从 RGB 到 YUV 的手动转换,但 cv::cvtColor (src, dst, CV_BGR2YCrCb) 和结果是一样的。
您知道如何将视频保存为 YUV 格式吗?
谢谢。
亚瑟.
I'm trying to save a video that have been captured by a camera.
It works well when I try with DIVX fourcc but what I'm trying to do is to save with IYUV fourcc but it gives awful results: colors seem to be merged, openCV seen to not do the conversion.
I've tried cv::cvtColor (src, dst, CV_BGR2YCrCb)
and cv::cvtColor (src, dst, CV_BGR2YUV)
ans manual conversion from RGB to YUV but the result is the same.
Have you any idea how to save a video in YUV format ?
Thanks.
Arthur.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 OpenCV bugtracker 上的此票证。这个问题看起来和你的很相似。
此外,手动调用
cv::cvtColor
没有任何意义,因为它无法转换为视频编解码器内部使用的yuv420p
。See this ticket on OpenCV bugtracker. That problem looks very similar to yours.
Also manual calling of
cv::cvtColor
makes no sense because it is not able to convert toyuv420p
used internally by video codec.