[MPlayer-dev-eng] [BUG] [PATCH] encoding with lavc and b-frames is partially broken

Nico Sabbi nsabbi at email.it
Sun Apr 23 10:57:38 CEST 2006


Nico Sabbi wrote:

> Hi,
> since rvision 1.137
> http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/libmpcodecs/ve_lavc.c.diff?r1=1.136&r2=1.137 
>
>
> for as many as INITIAL vmax_b_frames
> {
>    (out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, 
> mux_v->buffer_size, pic)) == -1
>    [mpeg2video @ 0xb7e0d548]Error, Invalid timestamp=0, last=0
>    muxer_write_chunk(mux_v, -1);
> }
>
> consequently the reported bitrate (and avi header) tends to MAXINT
>
> The attached patch fixes it;  it's just a workaround, but maybe  it's 
> acceptable considering that atm
> no filter passes through the pts
>
>
>
>------------------------------------------------------------------------
>
>Index: ve_lavc.c
>===================================================================
>RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
>retrieving revision 1.138
>diff -u -r1.138 ve_lavc.c
>--- ve_lavc.c	31 Mar 2006 00:15:47 -0000	1.138
>+++ ve_lavc.c	23 Apr 2006 08:30:51 -0000
>@@ -862,8 +862,10 @@
>         pic->opaque= malloc(sizeof(pts));
>         memcpy(pic->opaque, &pts, sizeof(pts));
> #else
>-        if(pts != MP_NOPTS_VALUE)
>+        if(pts != 0.0 && pts != MP_NOPTS_VALUE)
>+	{
>             pic->pts= floor(pts / av_q2d(lavc_venc_context->time_base) + 0.5);
>+	}
>         else
>             pic->pts= MP_NOPTS_VALUE;
> #endif
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>MPlayer-dev-eng mailing list
>MPlayer-dev-eng at mplayerhq.hu
>http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>  
>

sorry, braceless patch attached
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lavc2.diff
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060423/c46346c6/attachment.bin>


More information about the MPlayer-dev-eng mailing list