I am well aware that there are a few other topics regarding this exception, but none of them seems to be the source of my problem. I'm trying to record a live video from Google Glass, but only one of the encoders seems to work (mime video/avc). Whenever I try a different encoder, I keep getting IllegalStateExceptions. Relevant code:
MediaFormat format = MediaFormat.createVideoFormat("video/svc", 1280, 720);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_BIT_RATE, 10000000);
format.setInteger(MediaFormat.KEY_FRAME_RATE, 30);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5);
mEncoder = MediaCodec.createEncoderByType("video/svc");
mEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mEncoder.start();
As I said, the app crashes at mEncoder.configure, throwing an IllegalStateException at me:
E/ACodec﹕ [OMX.TI.DUCATI1.VIDEO.H264SVCE] configureCodec returning error -1010
E/MediaCodec﹕ Codec reported an error. (omx error 0x80001001, internalError -1010)
W/System.err﹕ java.lang.IllegalStateException
W/System.err﹕ at android.media.MediaCodec.native_configure(Native Method)
I hope someone can shed some light on what I have done wrong here.
Thanks in advance, Wolfram