[FFmpeg-devel] [PATCH] use av_log_level for x264 log

Limin Wang lance.lmwang
Thu Jul 12 11:21:27 CEST 2007


Hi,

* Benoit Fouet <benoit.fouet at purplelabs.com> [2007-07-12 10:46:41 +0200]:

> Limin Wang wrote:
> > Hi,
> >
> >   
> >>>> Loren already pointed out that removing the mapping table is not the 
> >>>> correct solution; I just wanted to add that we now have an 
> >>>> AV_LOG_WARNING error level, so the table can be updated accordingly.
> >>>>     
> >>>>         
> >>> Yes, didn't notice that. Please add it.
> >>>
> >>>   
> >>>       
> >> done
> >>     
> >
> > Thanks, so how about to use av_log_level also so that the log can be runtime
> > control?
> >
> > -    x4->params.i_log_level = X264_LOG_DEBUG;
> > +    x4->params.i_log_level = av_log_level; 
> >
> >   
> 
> isn't it already a runtime control ?
> and doing what you propose is wrong, as already mentionned, because you
> have no idea of what level you're asking to x264 doing it this way...

OK, I know what's you talk about now. How about in below way: 

Index: libavcodec/libx264.c
===================================================================
--- libavcodec/libx264.c        (revision 9607)
+++ libavcodec/libx264.c        (working copy)
@@ -256,6 +256,12 @@
     x4->params.analyse.b_psnr = (avctx->flags & CODEC_FLAG_PSNR);
     x4->params.i_log_level = X264_LOG_DEBUG;

+    if( av_log_level == AV_LOG_ERROR )
+        x4->params.i_log_level = X264_LOG_ERROR;
+    else if( av_log_level == AV_LOG_INFO )
+        x4->params.i_log_level = X264_LOG_INFO;
+    else if( av_log_level == AV_LOG_WARNING )
+        x4->params.i_log_level = X264_LOG_WARNING;


Thanks,
Limin




More information about the ffmpeg-devel mailing list