I want to change the encoding bitrate including H264 and AAC by Android MediaCodec
dynamically , according to the current network.
How to update the encoding bitrate in Android MediaCodec
dynamically ?
PS: I found PARAMETER_KEY_VIDEO_BITRATE
and setParameters
is available on API 19
Change a video encoder's target bitrate on the fly. The value is an Integer object containing the new bitrate in bps.
Constant Value: "video-bitrate"
Communicate additional parameter changes to the component instance.
Throws IllegalStateException if in the Uninitialized state.
Is there any way to do it under API 19 ?
Stopping the Codec, setting the parameters and restarting it worked for me.