5

I'm trying to use mediaCodec for creating mp4 video from openGl ES surface. I have an eglSurface, and the source surface of that eglSurface is MediaCodec input surface.

I can have different sizes for eglSurface, and when one size (width or height) too big: for example width = 5000 and height = 512, MediaCodec crashed.

this is a crash log

android.media.MediaCodec$CodecException: Error 0xfffffc0e 
at android.media.MediaCodec.native_configure(Native Method) 
at android.media.MediaCodec.configure(MediaCodec.java:588)

....

On some devices (Galaxy s7 edge) it doesn't crashes but after generation videoView doesn't play the video.

For small sizes(for example with screen size) it work correct on all devices

Levon Vardanyan
  • 400
  • 4
  • 16

2 Answers2

6

The width of your texture is too big. AFAIK, the maximum texture size is 4096x4096. And it can be lower than that depending on devices.

Check this answer: https://stackoverflow.com/a/4528043/1353758

Community
  • 1
  • 1
nexus5x
  • 457
  • 4
  • 13
2

It seems like odd width or height isn't supported. To avoid Error 0xfffffc0e on Xiaomi Redme 7 device I have been forced to do this:

DisplayMetrics metrics = getResources().getDisplayMetrics();
int width = (metrics.widthPixels / 2) * 2;   
int height = (metrics.heightPixels / 2) * 2;
isabsent
  • 3,683
  • 3
  • 25
  • 46