drainEncoder

open fun drainEncoder(endOfStream: Boolean)

Extracts all pending data from the encoder and forwards it to the muxer.

If endOfStream is not set, this returns when there is no more data to drain. If it is set, we send EOS to the encoder, and then iterate until we see EOS on the output. Calling this with endOfStream set should be done once, right before stopping the muxer.

We're just using the muxer to get a .mp4 file (instead of a raw H.264 stream). We're not recording audio.