diff --git a/ffmpeg.c b/ffmpeg.c
index 1e764e552e8ee5dc999193f2f5b300f7a75a3afe..3c5e333ac478377c5341fa1af15d71221200c911 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1897,7 +1897,7 @@ static int av_encode(AVFormatContext **output_files,
         }
         if(codec->codec_type == CODEC_TYPE_VIDEO){
             int size= codec->width * codec->height;
-            bit_buffer_size= FFMAX(bit_buffer_size, 4*size + 200);
+            bit_buffer_size= FFMAX(bit_buffer_size, 6*size + 200);
         }
     }