-
-
Save wobbals/7372f46bb7ebd4208a11 to your computer and use it in GitHub Desktop.
encoder config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mediaCodec = MediaCodec.createByCodecName(config.encoderName); | |
mediaFormat = MediaFormat.createVideoFormat("video/avc", | |
320, 240); | |
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 256000); | |
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 15); | |
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, | |
COLOR_FormatYUV420SemiPlanar); | |
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 2); | |
mediaCodec.configure(mediaFormat, null, null, | |
MediaCodec.CONFIGURE_FLAG_ENCODE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment