diff --git a/ffmpeg.c b/ffmpeg.c
index dcba31f17a22f82ca7a40eca760b3dd472bc0408..509be6e5d2edc481c4ab6a24936635f09023d252 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1930,6 +1930,8 @@ static int av_encode(AVFormatContext **output_files,
     if (!bit_buffer)
         bit_buffer = av_malloc(bit_buffer_size);
     if (!bit_buffer) {
+        fprintf(stderr, "Cannot allocate %d bytes output buffer\n",
+                bit_buffer_size);
         ret = AVERROR(ENOMEM);
         goto fail;
     }