diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-14 15:34:38 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-14 15:34:38 +0200 |
commit | 63c03ea98d90210886b818e503a39bb7e79e2be0 (patch) | |
tree | 107ba9bd27a35083047743027b76bec1685fae1c | |
parent | 9468e9e5a2cdd80aa2a0290743ae60b72299d80a (diff) | |
download | ffmpeg-63c03ea98d90210886b818e503a39bb7e79e2be0.tar.gz |
Fix writing RGB 5:5:5 rawvideo into avi.
WMP expects bits per pixel to be set to 16 for RGB 5:5:5 rawvideo.
-rw-r--r-- | libavformat/avienc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 5acc7c2b14..7d5aee0059 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -308,6 +308,12 @@ static int avi_write_header(AVFormatContext *s) if (stream->codec_id != AV_CODEC_ID_XSUB) break; case AVMEDIA_TYPE_VIDEO: + /* WMP expects RGB 5:5:5 rawvideo in avi to have bpp set to 16. */ + if ( !stream->codec_tag + && stream->codec_id == AV_CODEC_ID_RAWVIDEO + && stream->pix_fmt == AV_PIX_FMT_RGB555LE + && stream->bits_per_coded_sample == 15) + stream->bits_per_coded_sample = 16; ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0, 0); pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, stream->bits_per_coded_sample); |