If ffmpeg
stops encoding, then there's no more input to parse, or the stream has ended. This is a problem with the stream itself, or probably a bug in your ffmpeg
version.
The one you're using is an old and (known to be) broken version provided by the Ubuntu package sources. Consider updating to a recent ffmpeg
and trying again.
As for the muxing overhead:
Whenever you take video, audio or subtitle streams and put them into a container format (such as FLV in your case), the container needs some additional data to mux (multiplex) these streams.
It's basically metadata that is wrapped around the actual data, and you cannot get rid of this overhead. Every container will introduce a muxing overhead, but it'll usually be less than a few per cent of the actual data.
If you have very strict requirements on how much bandwidth you have available, you should therefore factor in the possible overhead when encoding the video and audio streams. For example, if you have 1500 kBit/s video and 128 kBit/s audio, the whole bandwidth needed is more than 1628 kBit/s (e.g. 1660 kBit/s).