libstreaming icon indicating copy to clipboard operation
libstreaming copied to clipboard

MediaCodec: MediaFormat KEY_I_FRAME_INTERVAL not working for H264codec

Open Midhun9638 opened this issue 6 years ago • 1 comments

I'm setting MediaFormat.KEY_I_FRAME_INTERVAL value as 1 (below given code) but it's not generating Key frame every second but it is generating every 66 second. I'm using Libstreaming library. can anyone please help why is not working ?

mMediaCodec = MediaCodec.createByCodecName(debugger.getEncoderName()); MediaFormat mediaFormat =MediaFormat.createVideoFormat("video/avc", 640,480); mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 1000000); mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 15); mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, debugger.getEncoderColorFormat()); mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1); //here mMediaCodec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); mMediaCodec.start();

Midhun9638 avatar Jul 18 '19 18:07 Midhun9638

@fyhertz can you please help?

Midhun9638 avatar Jul 19 '19 10:07 Midhun9638