Commit e00f1e39 authored by Alexander Reshetnikov's avatar Alexander Reshetnikov

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

parent aea24ffc
...@@ -1262,7 +1262,9 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc, ...@@ -1262,7 +1262,9 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
bitrate_scale = 128; bitrate_scale = 128;
break; break;
case CODEC_ID_RAWVIDEO: case CODEC_ID_RAWVIDEO:
codec_pix_fmt = input_pix_fmt; 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; break;
default: default:
// good for lossy formats, MPEG, etc. // good for lossy formats, MPEG, etc.
......
...@@ -1372,7 +1372,9 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc, ...@@ -1372,7 +1372,9 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
bitrate_scale = 128; bitrate_scale = 128;
break; break;
case CODEC_ID_RAWVIDEO: case CODEC_ID_RAWVIDEO:
codec_pix_fmt = input_pix_fmt; 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; break;
default: default:
// good for lossy formats, MPEG, etc. // good for lossy formats, MPEG, etc.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment