FFmpeg encoder : be sure to use the minimum required buffer size