[MPlayer-dev-eng] mencoder.c (1.94) bug: "-lavcopts vbitrate=XXX"

Juan J. Sierralta P. juanjo at atmlab.utfsm.cl
Thu Feb 28 19:53:39 CET 2002


On Thu, 2002-02-28 at 01:33, Krister Lagerstrom wrote:

> It should be easy to copy-paste the divx4 solution. Also, shouldn't the 
> if-statement on line 1085 be similar to the one on line 996? I assume 
> that the parameter will be set to zero (not -1) by the parameter 
> decoding process.

	Attached comes a patch that fix this problem. Also changes the fourcc
for ffmpeg4 from MP4S to divx, before this the files were unplayable on
Windows since no codec knows MP4S.
	Remember that ffmpeg MPEG4 is sintactically the same as DivX4 or
ISO-MPEG4, or OpenDivX.

-- 
Juanjo sin .sig :(
-------------- next part --------------
--- /home/juanjo/devel/mplayer/main/mencoder.c	Mon Feb 25 14:52:44 2002
+++ mencoder.c	Thu Feb 28 15:45:45 2002
@@ -865,7 +865,7 @@
         }
         else if (!strcasecmp(vcodec, "mpeg4"))
         {
-	    mux_v->bih->biCompression = mmioFOURCC('M', 'P', '4', 'S');
+	    mux_v->bih->biCompression = mmioFOURCC('d', 'i', 'v', 'x');
         }
         else if (!strcasecmp(vcodec, "msmpeg4"))
         {
@@ -1050,24 +1050,7 @@
 	avcodec_inited=1;
     }
     
-#if 0
-    {
-	extern AVCodec *first_avcodec;
-	AVCodec *p = first_avcodec;
-	
-	lavc_venc_codec = NULL;
-	while (p)
-	{
-	    if (p->encode != NULL && strcmp(lavc_param_vcodec, p->name) == 0)
-		break;
-	    p = p->next;
-	}
-	lavc_venc_codec = p;
-    }
-#else
-    /* XXX: implement this in avcodec (i will send a patch to ffmpeglist) -- alex */
     lavc_venc_codec = (AVCodec *)avcodec_find_encoder_by_name(lavc_param_vcodec);
-#endif
 
     if (!lavc_venc_codec)
     {
@@ -1082,10 +1065,10 @@
     /* 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
+    if (!lavc_param_vbitrate) /* != -1 */
 	lavc_venc_context.bit_rate = 800000; /* default */
+    else if (lavc_param_vbitrate < 16000)
+    	 lavc_venc_context.bit_rate = lavc_param_vbitrate * 1000;
     lavc_venc_context.frame_rate = (float)(force_ofps?force_ofps:sh_video->fps) * FRAME_RATE_BASE;
     /* keyframe interval */
     if (lavc_param_keyint >= 0) /* != -1 */


More information about the MPlayer-dev-eng mailing list