diff mencoder.c @ 3702:e16996f5497d

supporting -ofps by lavc, using avcodec_find_encoder_by_name (latest libavcodec cvs)
author alex
date Mon, 24 Dec 2001 10:54:11 +0000
parents 470d75f1e087
children d846a89e609a
line wrap: on
line diff
--- a/mencoder.c	Mon Dec 24 10:39:28 2001 +0000
+++ b/mencoder.c	Mon Dec 24 10:54:11 2001 +0000
@@ -807,7 +807,7 @@
 	avcodec_inited=1;
     }
     
-#if 1
+#if 0
     {
 	extern AVCodec *first_avcodec;
 	AVCodec *p = first_avcodec;
@@ -836,13 +836,14 @@
     
 //    lavc_venc_context.width = mux_v->bih->biWidth;
 //    lavc_venc_context.height = mux_v->bih->biHeight;
+    /* scaling only for YV12 (and lavc supports only YV12 ;) */
     lavc_venc_context.width = vo_w;
     lavc_venc_context.height = vo_h;
     if (lavc_param_vbitrate >= 0) /* != -1 */
 	lavc_venc_context.bit_rate = lavc_param_vbitrate;
     else
 	lavc_venc_context.bit_rate = 800000; /* default */
-    lavc_venc_context.frame_rate = sh_video->fps * FRAME_RATE_BASE;    
+    lavc_venc_context.frame_rate = (float)(force_ofps?force_ofps:sh_video->fps) * FRAME_RATE_BASE;
     /* keyframe interval */
     if (lavc_param_keyint >= 0) /* != -1 */
 	lavc_venc_context.gop_size = lavc_param_keyint;