mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Fixed a problem with CODEC_ID_RAWVIDEO in FFMPEG (ticket #1400)
This commit is contained in:
parent
aea24ffcd5
commit
e00f1e3911
@ -1262,8 +1262,10 @@ 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 ||
|
||||||
break;
|
input_pix_fmt == PIX_FMT_GRAY16LE ||
|
||||||
|
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// good for lossy formats, MPEG, etc.
|
// good for lossy formats, MPEG, etc.
|
||||||
codec_pix_fmt = PIX_FMT_YUV420P;
|
codec_pix_fmt = PIX_FMT_YUV420P;
|
||||||
|
@ -1372,8 +1372,10 @@ 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 ||
|
||||||
break;
|
input_pix_fmt == PIX_FMT_GRAY16LE ||
|
||||||
|
input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// good for lossy formats, MPEG, etc.
|
// good for lossy formats, MPEG, etc.
|
||||||
codec_pix_fmt = PIX_FMT_YUV420P;
|
codec_pix_fmt = PIX_FMT_YUV420P;
|
||||||
|
Loading…
Reference in New Issue
Block a user