fadden I hope you're listening.
So I've been trying to encode some preview frames from the camera, to eventually stream over rtmp as flv. However, when filling out the avcdecoderconfigurationrecord in the avc sequence header, I have to give the SPS and PPS bytes. BUT, the SPS given to me from the encoder is missing the VUI Params (the flag is set to 0), which dictate the frame rate, etc. So I am wondering, does the encoder ever give this information, or is there any other way to get my little paws on this info?
mEncoder = MediaCodec.createEncoderByType("video/avc");//MediaCodec.createByCodecName(info.getName());
MediaFormat mediaFormat = MediaFormat.createVideoFormat("video/avc", 1920, 1080);
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, FPS);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5);
mEncoder.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mEncoder.start();
I am able to get the dimensions in the SPS, but the frames per second always says infinity when I view it with my VLC player.