Quiet ffmpeg log by default. No more ugly stream info in console.
authorMartin Poirier <theeth@yahoo.com>
Sun, 2 Nov 2008 16:28:34 +0000 (16:28 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sun, 2 Nov 2008 16:28:34 +0000 (16:28 +0000)
Starting Blender with -d turns info logging back on.

source/blender/blenkernel/BKE_writeffmpeg.h
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/imbuf/intern/util.c

index 02f7ba6..5005344 100644 (file)
@@ -59,6 +59,8 @@ extern void start_ffmpeg(struct RenderData *rd, int rectx, int recty);
 extern void end_ffmpeg(void);
 extern void append_ffmpeg(int frame, int *pixels, int rectx, int recty);
 
+void silence_log_ffmpeg(int quiet);
+
 #ifdef __cplusplus
 }
 #endif
index cef6f80..642b4fd 100644 (file)
@@ -34,6 +34,7 @@
 #include <ffmpeg/rational.h>
 #include <ffmpeg/swscale.h>
 #include <ffmpeg/opt.h>
+#include <ffmpeg/log.h>
 
 #if LIBAVFORMAT_VERSION_INT < (49 << 16)
 #define FFMPEG_OLD_FRAME_RATE 1
@@ -104,6 +105,18 @@ static RenderData *ffmpeg_renderdata = 0;
 
 #define FFMPEG_AUTOSPLIT_SIZE 2000000000
 
+void silence_log_ffmpeg(int quiet)
+{
+       if (quiet)
+       {
+               av_log_set_level(AV_LOG_QUIET);
+       }
+       else
+       {
+               av_log_set_level(AV_LOG_INFO);
+       }
+}
+
 /* Delete a picture buffer */
 
 static void delete_picture(AVFrame* f)
index cd58d9e..05d5940 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "DNA_userdef_types.h"
 #include "BKE_global.h"
+#include "BKE_writeffmpeg.h" /* for silence_log_ffmpeg */
 
 #include "imbuf.h"
 #include "imbuf_patch.h"
@@ -238,6 +239,11 @@ void do_init_ffmpeg()
                ffmpeg_init = 1;
                av_register_all();
                //avdevice_register_all();
+               
+               if ((G.f & G_DEBUG) == 0)
+               {
+                       silence_log_ffmpeg(1);
+               }
        }
 }