[vlc-devel] Re: changes in frame_rate(_base)

Sigmund Augdal sigmunau at stud.ntnu.no
Tue May 3 15:36:48 CEST 2005


On Tue, May 03, 2005 at 06:29:18AM -0700, C.Y.M wrote:
> After updating to the latest ffmpeg lib, I am getting the following type errors:
> 
> video.c: In function `ffmpeg_NewPictBuf':
> video.c:189: error: structure has no member named `frame_rate'
> video.c:189: error: structure has no member named `frame_rate_base'
> video.c:191: error: structure has no member named `frame_rate'
> video.c:192: error: structure has no member named `frame_rate_base'
> video.c: In function `DecodeVideo__ffmpeg':
> video.c:657: error: structure has no member named `frame_rate'
> video.c:661: error: structure has no member named `frame_rate_base'
> video.c:663: error: structure has no member named `frame_rate'
> make[5]: *** [libffmpeg_a-video.o] Error 1
> 
> Attached is a patch which seems to fix the problem.  Please let me know if this
> looks ok.
Did you actually test this? Don't you get strange playback, with some very
quick areas and lots of dropped frames? I think these ffmpeg-changes require more
thourough changes to vlc. Basically they changed how the pts value is
defined. 

> 
> Best Regards,
> C.Y.M.

> --- vlc-trunk/modules/codec/ffmpeg/video.c.orig	2005-05-01 06:09:20.000000000 -0700
> +++ vlc-trunk/modules/codec/ffmpeg/video.c	2005-05-01 06:01:07.000000000 -0700
> @@ -186,11 +187,19 @@
>          }
>      }
>  
> +#if (LIBAVCODEC_BUILD >= 4754)
> +    if( p_context->time_base.den > 0 && p_context->time_base.num > 0 )
> +    {
> +        p_dec->fmt_out.video.i_frame_rate = p_context->time_base.den;
> +        p_dec->fmt_out.video.i_frame_rate_base = p_context->time_base.num;
> +    }
> +#else
>      if( p_context->frame_rate > 0 && p_context->frame_rate_base > 0 )
>      {
>          p_dec->fmt_out.video.i_frame_rate = p_context->frame_rate;
>          p_dec->fmt_out.video.i_frame_rate_base = p_context->frame_rate_base;
>      }
> +#endif
>  
>      p_pic = p_dec->pf_vout_buffer_new( p_dec );
>  
> @@ -654,6 +663,16 @@
>              p_pic->date = p_sys->i_pts;
>  
>              /* interpolate the next PTS */
> +#if (LIBAVCODEC_BUILD >= 4754)
> +            if( p_sys->p_context->time_base.den > 0 )
> +            {
> +                p_sys->i_pts += I64C(1000000) *
> +                    (2 + p_sys->p_ff_pic->repeat_pict) *
> +                    p_sys->p_context->time_base.num *
> +                    p_block->i_rate / INPUT_RATE_DEFAULT /
> +                    (2 * p_sys->p_context->time_base.den);
> +            }
> +#else
>              if( p_sys->p_context->frame_rate > 0 )
>              {
>                  p_sys->i_pts += I64C(1000000) *
> @@ -662,6 +681,7 @@
>                      p_block->i_rate / INPUT_RATE_DEFAULT /
>                      (2 * p_sys->p_context->frame_rate);
>              }
> +#endif
>  
>              if( p_sys->b_first_frame )
>              {
> --- vlc-trunk/modules/codec/ffmpeg/encoder.c.orig	2005-05-01 07:19:26.000000000 -0700
> +++ vlc-trunk/modules/codec/ffmpeg/encoder.c	2005-05-01 07:22:49.000000000 -0700
> @@ -328,8 +328,13 @@
>          p_context->width = p_enc->fmt_in.video.i_width;
>          p_context->height = p_enc->fmt_in.video.i_height;
>  
> +#if (LIBAVCODEC_BUILD >= 4754)
> +        p_context->time_base.den = p_enc->fmt_in.video.i_frame_rate;
> +        p_context->time_base.num = p_enc->fmt_in.video.i_frame_rate_base;
> +#else
>          p_context->frame_rate = p_enc->fmt_in.video.i_frame_rate;
>          p_context->frame_rate_base= p_enc->fmt_in.video.i_frame_rate_base;
> +#endif
>  
>          /* Defaults from ffmpeg.c */
>          p_context->qblur = 0.5;
> --- vlc-trunk/modules/stream_out/switcher.c.orig	2005-05-01 07:36:05.000000000 -0700
> +++ vlc-trunk/modules/stream_out/switcher.c	2005-05-01 07:39:19.000000000 -0700
> @@ -740,8 +740,13 @@
>                     i_aspect_num * (int64_t)id->ff_enc_c->height,
>                     i_aspect_den * (int64_t)id->ff_enc_c->width, 1 << 30 );
>  
> +#if (LIBAVCODEC_BUILD >= 4754)
> +        id->ff_enc_c->time_base.den    = 25; /* FIXME */
> +        id->ff_enc_c->time_base.num    = 1;
> +#else
>          id->ff_enc_c->frame_rate    = 25; /* FIXME */
>          id->ff_enc_c->frame_rate_base = 1;
> +#endif
>  
>          id->ff_enc_c->gop_size = 200;
>          id->ff_enc_c->max_b_frames = 0;


-- 
Sigmund Augdal
Edgar B. Schieldropsv 29-14
N-7033 Trondheim
Norway
tlf: 91809129

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list