Unfortunately this kind of use case is not supported by most Android phones. MediaCodec is just an abstraction of the OMX IL API used by codec vendors on the devices. The vendor codecs require a certain number of input and output buffers for a given configuration.
While theoretically, having one output buffer queued with the encoder should be enough, a lot of the times this is not supported by vendor codecs because it results in lower encoding performance; hence the codec stalls. This is even more prevalent with input buffers.
There is no application control on the number of input/output buffers that are allocated for a MediaCodec instance - Android tries to allocate the minimum number of buffers required, to save memory. Therefore, your only option is to copy the output buffers. While this is not ideal, the encoded buffers tend to be reasonably small.