[MPlayer-dev-eng] [PATCH] Destination size option for -ovc frameno

Hajba Szilard szilu at symbion.hu
Fri Mar 29 14:03:33 CET 2002


Hi!

This patch is very simple, but it's useful for me when I encode TV series.
If I want three episodes to fit on a 700MB CD I run the first pass of the
3pass encoding like this:

szilu at arwen:[/mnt/film/st_enterprise]$ mencoder -ovc frameno -destsize 230
	-oac mp3lame -lameopts br=128:cbr -o frameno.avi
	star\ trek\ enterprise\ -\ 1x12\ -\ silent\ enemy.mpeg

I think this feature would be useful for others too.

-- 
Szilard Hajba                   Symbion Bt.
Tel.:   (+36)20/920-66-36       H-9028 Gyor, Uj u. 38.
E-Mail: szilu at symbion.hu
-------------- next part --------------
Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.32
diff -u -p -r1.32 cfg-mencoder.h
--- cfg-mencoder.h	29 Mar 2002 07:20:44 -0000	1.32
+++ cfg-mencoder.h	29 Mar 2002 11:26:45 -0000
@@ -126,6 +126,7 @@ static config_t mencoder_opts[]={
 //	{"ovc", &out_video_codec, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"oac", oac_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
 	{"ovc", ovc_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+	{"destsize", &destsize, CONF_TYPE_INT, CONF_RANGE, 1, 10000, NULL},
 
 	{"ffourcc", &force_fourcc, CONF_TYPE_STRING, 0, 4, 4, NULL},
 
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.106
diff -u -p -r1.106 mencoder.c
--- mencoder.c	29 Mar 2002 07:20:44 -0000	1.106
+++ mencoder.c	29 Mar 2002 11:26:47 -0000
@@ -181,6 +181,8 @@ char* out_filename="test.avi";
 char* mp3_filename=NULL;
 char* ac3_filename=NULL;
 
+int destsize=0;
+
 char *force_fourcc=NULL;
 
 static int pass=0;
@@ -1844,9 +1846,13 @@ aviwrite_write_header(muxer,muxer_f); //
 fclose(muxer_f);
 
 if(out_video_codec==VCODEC_FRAMENO && mux_v->timer>100){
-    printf("Recommended video bitrate for 650MB CD: %d\n",(int)((650*1024*1024-muxer_f_size)/mux_v->timer/125));
-    printf("Recommended video bitrate for 700MB CD: %d\n",(int)((700*1024*1024-muxer_f_size)/mux_v->timer/125));
-    printf("Recommended video bitrate for 800MB CD: %d\n",(int)((800*1024*1024-muxer_f_size)/mux_v->timer/125));
+    if (destsize) {
+	printf("Recommended video bitrate for %dMB size: %d\n",destsize,(int)((destsize*1024*1024-muxer_f_size)/mux_v->timer/125));
+    } else {
+	printf("Recommended video bitrate for 650MB CD: %d\n",(int)((650*1024*1024-muxer_f_size)/mux_v->timer/125));
+	printf("Recommended video bitrate for 700MB CD: %d\n",(int)((700*1024*1024-muxer_f_size)/mux_v->timer/125));
+	printf("Recommended video bitrate for 800MB CD: %d\n",(int)((800*1024*1024-muxer_f_size)/mux_v->timer/125));
+    }
 }
 
 printf("\nVideo stream: %8.3f kbit/s  (%d bps)  size: %d bytes  %5.3f secs  %d frames\n",


More information about the MPlayer-dev-eng mailing list