I'm using MediaCodec
to encode video from the camera:
MediaFormat format = MediaFormat.createVideoFormat("video/avc", width, height);
format.setInteger(MediaFormat.KEY_BIT_RATE, 250000);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
format.setInteger(MediaFormat.KEY_FRAME_RATE, 15);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
_mediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
What I've found is that depending on the resolution I give it there is some minimum valid bit rate to set. If I set a bit rate under that amount, it's entirely ignored. If I set a bit rate above this invisible threshold it works as intended. What I would like to do is query what the minimum bit rate I can set for KEY_BIT_RATE
is for any given resolution. No errors are thrown or anything when I set a bit rate that doesn't have any effect.