# HG changeset patch # User atmos4 # Date 1014245100 0 # Node ID fc2f769646067671611483672ab75491e89de7da # Parent 976bf6a9ded5aba1d23ef4070f10fd44d6a6af36 Patch: Improved raw encoding support in mencoder by Fredrik Kuivinen diff -r 976bf6a9ded5 -r fc2f76964606 etc/codecs.conf --- a/etc/codecs.conf Wed Feb 20 22:43:34 2002 +0000 +++ b/etc/codecs.conf Wed Feb 20 22:45:00 2002 +0000 @@ -861,6 +861,7 @@ driver raw format 0x0 format 0x20776172 + format 0x42475218 out BGR24 flip videocodec rawbgr15 @@ -869,6 +870,7 @@ driver raw format 0x0 format 0x20776172 + format 0x4247520F out BGR15 flip videocodec null diff -r 976bf6a9ded5 -r fc2f76964606 libmpdemux/video.c --- a/libmpdemux/video.c Wed Feb 20 22:43:34 2002 +0000 +++ b/libmpdemux/video.c Wed Feb 20 22:45:00 2002 +0000 @@ -19,6 +19,9 @@ #include "parse_es.h" #include "mpeg_hdr.h" +/* biCompression constant */ +#define BI_RGB 0L + static mp_mpeg_header_t picture; int video_read_properties(sh_video_t *sh_video){ @@ -28,8 +31,18 @@ switch(d_video->demuxer->file_format){ case DEMUXER_TYPE_AVI: case DEMUXER_TYPE_ASF: { - // display info: - sh_video->format=sh_video->bih->biCompression; + // display info: + + if(sh_video->bih->biCompression == BI_RGB && + (sh_video->video.fccHandler == mmioFOURCC('D', 'I', 'B', ' ') || + sh_video->video.fccHandler == mmioFOURCC('R', 'G', 'B', ' ') || + sh_video->video.fccHandler == mmioFOURCC('R', 'A', 'W', ' ') || + sh_video->video.fccHandler == 0)) { + sh_video->format = mmioFOURCC(0, 'R', 'G', 'B') | sh_video->bih->biBitCount; + } + else + sh_video->format=sh_video->bih->biCompression; + sh_video->disp_w=sh_video->bih->biWidth; sh_video->disp_h=abs(sh_video->bih->biHeight);