diff --git a/modules/highgui/src/cap_ffmpeg.cpp b/modules/highgui/src/cap_ffmpeg.cpp index 69614d9daf..2653bada99 100644 --- a/modules/highgui/src/cap_ffmpeg.cpp +++ b/modules/highgui/src/cap_ffmpeg.cpp @@ -1270,6 +1270,8 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc, bitrate_scale = 128; break; case CODEC_ID_RAWVIDEO: + codec_pix_fmt = input_pix_fmt; + break; default: // good for lossy formats, MPEG, etc. codec_pix_fmt = PIX_FMT_YUV420P;