[MPlayer-dev-eng] Patch: Improved raw encoding support in mencoder

Fredrik Kuivinen freku045 at student.liu.se
Thu Jan 31 14:37:10 CET 2002


On Thu, Jan 31, 2002 at 10:48:12AM +0100, Alex Beregszaszi wrote:
> On Wed, Jan 30, 2002 at 11:53:40PM +0100, Fredrik Kuivinen wrote:
> > Hi
> > 
> > This patch is better. It don't touch -ovc raw at all. It adds a new video encoder
> > called rawrgb instead which produces avi files with raw rgb data which virtualdub
> > and xanim can play (but not mplayer). 
> 
> I think it can play, you need to specify the codec name:
> -vc rawrgb32 ..
>

Hm yeah you are right... This patch removes the need for -vc when playing such
files. 

/ Fredrik Kuivinen

-------------- next part --------------
Index: etc/codecs.conf
===================================================================
RCS file: /cvsroot/mplayer/main/etc/codecs.conf,v
retrieving revision 1.127
diff -u -3 -p -r1.127 codecs.conf
--- etc/codecs.conf	26 Jan 2002 20:29:00 -0000	1.127
+++ etc/codecs.conf	31 Jan 2002 13:40:05 -0000
@@ -815,6 +815,7 @@ videocodec rawbgr24
   driver raw
   format 0x0
   format 0x20776172
+  format 0x42475218
   out BGR24 flip
 
 videocodec rawbgr15
@@ -823,6 +824,7 @@ videocodec rawbgr15
   driver raw
   format 0x0
   format 0x20776172
+  format 0x4247520F
   out BGR15 flip
 
 videocodec null
Index: libmpdemux/video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.9
diff -u -3 -p -r1.9 video.c
--- libmpdemux/video.c	24 Jan 2002 15:21:22 -0000	1.9
+++ libmpdemux/video.c	31 Jan 2002 13:40:06 -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 @@ demux_stream_t *d_video=sh_video->ds;
 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);


More information about the MPlayer-dev-eng mailing list