[Ffmpeg-devel] [PATCH] add fps stats

Baptiste Coudurier baptiste.coudurier
Wed Mar 14 19:12:19 CET 2007


Hi

Limin Wang wrote:
> Hi,
> 
> 
> The patch try to add fps stats for ffmpeg, then I don't need to
> time ffmpeg and calculate the fps every time. Please review it.
> 
> 
> Thanks,
> Limin
> 
> 
> ------------------------------------------------------------------------
> 
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 8396)
> +++ ffmpeg.c	(working copy)
> @@ -205,6 +205,7 @@
>  int opt_name_count=0;
>  AVCodecContext *avctx_opts[CODEC_TYPE_NB];
>  AVFormatContext *avformat_opts;
> +static int64_t timer_start = 0;
>  
>  static AVBitStreamFilterContext *video_bitstream_filters=NULL;
>  static AVBitStreamFilterContext *audio_bitstream_filters=NULL;
> @@ -925,9 +926,14 @@
>                      enc->coded_frame->quality/(float)FF_QP2LAMBDA);
>          }
>          if (!vid && enc->codec_type == CODEC_TYPE_VIDEO) {
> +            float t;
> +            
> +            t = (av_gettime()-timer_start) / 1000000.0;
> +            

maybe float t = (av_gettime()-timer_start) / 1000000.0;

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list