diff --git a/modules/highgui/src/cap_ffmpeg_impl.hpp b/modules/highgui/src/cap_ffmpeg_impl.hpp index 8ef2880a2..d1e41f1a4 100644 --- a/modules/highgui/src/cap_ffmpeg_impl.hpp +++ b/modules/highgui/src/cap_ffmpeg_impl.hpp @@ -1246,7 +1246,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int #else img_convert_ctx = sws_getContext(width, height, - PIX_FMT_BGR24, + (PixelFormat)input_pix_fmt, c->width, c->height, c->pix_fmt,