diff --git a/ffmpeg.c b/ffmpeg.c
index dd0eeb885caa36abb63f38f0e089a503286e209a..0ce61a39bd3f8dab14f36f264756c3f43e7df142 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2214,7 +2214,7 @@ static int opt_default(const char *opt, const char *arg){
     opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
     opt_names[opt_name_count++]= o->name;
 
-    if(avctx_opts[0]->debug)
+    if(avctx_opts[0]->debug || avformat_opts->debug)
         av_log_set_level(AV_LOG_DEBUG);
     return 0;
 }