提交 e00f1e39 编写于 作者: A Alexander Reshetnikov

Fixed a problem with CODEC_ID_RAWVIDEO in FFMPEG (ticket #1400)

上级 aea24ffc
......@@ -1262,8 +1262,10 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
bitrate_scale = 128;
break;
case CODEC_ID_RAWVIDEO:
codec_pix_fmt = input_pix_fmt;
break;
codec_pix_fmt = input_pix_fmt == PIX_FMT_GRAY8 ||
input_pix_fmt == PIX_FMT_GRAY16LE ||
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
break;
default:
// good for lossy formats, MPEG, etc.
codec_pix_fmt = PIX_FMT_YUV420P;
......
......@@ -1372,8 +1372,10 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
bitrate_scale = 128;
break;
case CODEC_ID_RAWVIDEO:
codec_pix_fmt = input_pix_fmt;
break;
codec_pix_fmt = input_pix_fmt == PIX_FMT_GRAY8 ||
input_pix_fmt == PIX_FMT_GRAY16LE ||
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
break;
default:
// good for lossy formats, MPEG, etc.
codec_pix_fmt = PIX_FMT_YUV420P;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册