Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to instantiate decoder OMX.qcom.video.decoder.avc on Android KitKat #1286

Closed
Ltty opened this issue Feb 19, 2016 · 8 comments
Closed

Comments

@Ltty
Copy link

Ltty commented Feb 19, 2016

ExoPlayer crashes when trying to start playback for an HLS Stream on KitKat. Used the demo from your repository without modifications. Test device was a Motorola Droid X with Android 4.4.4.

Here's the full stack trace:

02-19 06:04:23.573 17306-17306/com.pocketlifestyle.streamingdemo E/dalvikvm: Could not find class 'android.media.PlaybackParams', referenced from method com.google.android.exoplayer.MediaCodecAudioTrackRenderer.handleMessage
02-19 06:04:24.351 17306-17377/com.pocketlifestyle.streamingdemo E/OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
02-19 06:04:24.391 17306-17419/com.pocketlifestyle.streamingdemo E/ACodec: [OMX.qcom.video.decoder.avc] storeMetaDataInBuffers failed w/ err -2147483648
02-19 06:04:24.397 17306-17419/com.pocketlifestyle.streamingdemo E/ACodec: [OMX.qcom.video.decoder.avc] configureCodec returning error -1010
02-19 06:04:24.398 17306-17418/com.pocketlifestyle.streamingdemo E/MediaCodec: Codec reported an error. (omx error 0x80001001, internalError -1010)
02-19 06:04:24.399 17306-17377/com.pocketlifestyle.streamingdemo E/dalvikvm: Could not find class 'android.media.MediaCodec$CodecException', referenced from method com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException.getDiagnosticInfoV21
02-19 06:04:24.416 17306-17377/com.pocketlifestyle.streamingdemo E/ExoPlayerImplInternal: Internal track renderer error.
          com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(null, video/avc, -1, -1, 1500, 1500, -1, 1.0, -1, -1, null, -1, false, -1, -1)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.notifyAndThrowDecoderInitError(MediaCodecTrackRenderer.java:388)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:374)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729)
              at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479)
              at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129)
              at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431)
              at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213)
              at android.os.Handler.dispatchMessage(Handler.java:98)
              at android.os.Looper.loop(Looper.java:136)
              at android.os.HandlerThread.run(HandlerThread.java:61)
              at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
           Caused by: com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(null, video/avc, -1, -1, 1500, 1500, -1, 1.0, -1, -1, null, -1, false, -1, -1)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:374) 
              at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729) 
              at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334) 
              at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496) 
              at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479) 
              at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129) 
              at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431) 
              at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213) 
              at android.os.Handler.dispatchMessage(Handler.java:98) 
              at android.os.Looper.loop(Looper.java:136) 
              at android.os.HandlerThread.run(HandlerThread.java:61) 
              at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
           Caused by: java.lang.IllegalStateException
              at android.media.MediaCodec.native_configure(Native Method)
              at android.media.MediaCodec.configure(MediaCodec.java:262)
              at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.configureCodec(MediaCodecVideoTrackRenderer.java:328)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:363)
              at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729) 
              at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334) 
              at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496) 
              at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479) 
              at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129) 
              at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431) 
              at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213) 
              at android.os.Handler.dispatchMessage(Handler.java:98) 
              at android.os.Looper.loop(Looper.java:136) 
              at android.os.HandlerThread.run(HandlerThread.java:61) 
              at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
02-19 06:04:24.417 17306-17306/com.pocketlifestyle.streamingdemo E/EventLogger: internalError [1.70, decoderInitializationError]
com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(null, video/avc, -1, -1, 1500, 1500, -1, 1.0, -1, -1, null, -1, false, -1, -1)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:374)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729)
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479)
    at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129)
    at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431)
    at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:136)
    at android.os.HandlerThread.run(HandlerThread.java:61)
    at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
 Caused by: java.lang.IllegalStateException
    at android.media.MediaCodec.native_configure(Native Method)
    at android.media.MediaCodec.configure(MediaCodec.java:262)
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.configureCodec(MediaCodecVideoTrackRenderer.java:328)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:363)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729) 
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479) 
    at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213) 
    at android.os.Handler.dispatchMessage(Handler.java:98) 
    at android.os.Looper.loop(Looper.java:136) 
    at android.os.HandlerThread.run(HandlerThread.java:61) 
    at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
02-19 06:04:24.451 17306-17306/com.pocketlifestyle.streamingdemo E/EventLogger: playerFailed [1.73]
com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(null, video/avc, -1, -1, 1500, 1500, -1, 1.0, -1, -1, null, -1, false, -1, -1)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.notifyAndThrowDecoderInitError(MediaCodecTrackRenderer.java:388)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:374)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729)
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479)
    at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129)
    at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431)
    at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:136)
    at android.os.HandlerThread.run(HandlerThread.java:61)
    at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
 Caused by: com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(null, video/avc, -1, -1, 1500, 1500, -1, 1.0, -1, -1, null, -1, false, -1, -1)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:374) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729) 
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479) 
    at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213) 
    at android.os.Handler.dispatchMessage(Handler.java:98) 
    at android.os.Looper.loop(Looper.java:136) 
    at android.os.HandlerThread.run(HandlerThread.java:61) 
    at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
 Caused by: java.lang.IllegalStateException
    at android.media.MediaCodec.native_configure(Native Method)
    at android.media.MediaCodec.configure(MediaCodec.java:262)
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.configureCodec(MediaCodecVideoTrackRenderer.java:328)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:363)
    at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:729) 
    at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onInputFormatChanged(MediaCodecVideoTrackRenderer.java:334) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:496) 
    at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:479) 
    at com.google.android.exoplayer.SampleSourceTrackRenderer.doSomeWork(SampleSourceTrackRenderer.java:129) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:431) 
    at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:213) 
    at android.os.Handler.dispatchMessage(Handler.java:98) 
    at android.os.Looper.loop(Looper.java:136) 
    at android.os.HandlerThread.run(HandlerThread.java:61) 
    at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
@Gary111
Copy link

Gary111 commented Feb 20, 2016

Has the same issue with this video on last EMVideoView release:

com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.MediaCodecTrackRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, MediaFormat(1, video/avc, -1, 89373, 1080, 1080, 0, 1.0, -1, -1, null, 2000000, false, -1, -1

Default VideoView also produces an error:

MediaPlayer-JNI(5703): QCMediaPlayer mediaplayer NOT present`
MediaPlayer(5703): error (1, -2147479551)

But when I create my own default MediaPlayer instance with SurfaceView it works fine.

My device is Asus Zenfone 2 Laser ZE500KG with Android 5.0.2 on board

@Gary111
Copy link

Gary111 commented Feb 26, 2016

Hi @ojw28. I investigated this issue in details ExoPlayer play fine the previous video I wrote about here.
As well as default VideoView. The point is that I tried to start one video before I stopped other. On Nexus 5 with Android 6.0 on board it gone fine. But other devices with Android 5.0 on board has this issue. So, now before playing video (encoded with H.264) you should be sure that you stoped (not paused) a previous one.

@andrewlewis
Copy link
Collaborator

It sounds like this device does not allow more than one player to be instantiated at a time. In general Android devices don't have to support playing more than one video at a time, and whether it works can also depend on the input videos' formats. So it is important to release a player before creating a new one.

Based on your latest reply I will close this for now, but let us know if there is still an issue that needs to be fixed.

@andrewlewis
Copy link
Collaborator

@Ltty Your issue may be different. Please supply a link to the stream you are trying to play (emailed to dev.exoplayer@gmail.com or in a reply here). Based on the logs, it looks like the video resolution (1500 * 1500) may be too big for the device -- do smaller videos play correctly?

@andrewlewis andrewlewis reopened this Feb 29, 2016
@CAMOBAP
Copy link

CAMOBAP commented Mar 24, 2016

In general Android devices don't have to support playing more than one video at a time

@andrewlewis, could you please support your words by link to any documentation or this is just your observation?

@andrewlewis
Copy link
Collaborator

@CAMOBAP795 The Android M CDD (and older versions) do not require compatible devices to support playing more than one video at a time, and I don't think there are any CTS tests that fail if using two video decoders at a time doesn't work.

So it is not safe for apps that need to work on all Android compatible devices to rely on this feature. However, I will try to make some suggestions about using hardware codecs anyway:

  • As I mentioned above, whether you can play two videos at once can depend on the videos' formats. The actual limitation may apply to the total macroblock rate of all decoded videos, for example.
  • In practice you will find you can play multiple videos at once on many devices, especially 'higher end' ones (even going back to Android K generation devices). At the moment, it appears the majority of devices running builds >= L support at least two 720p playbacks concurrently, though I'm afraid I don't have any documentation to prove this.
  • On Android versions before L, I have seen bad device-specific failure modes when trying to create two video MediaCodecs at the same time on devices that don't support it. For example, the device may have to be rebooted to make video work again after trying to create two video decoders, even if the app released resources correctly, or the mediaserver process may crash due to an assertion failure.
  • Android M added CodecCapabilities.getMaxSupportedInstances() which you can use as a hint, but, as documented, the number of concurrent instances may be lower depending on what resources are in use. To understand exactly what max supported instances value means, look at the CTS test for the method. (Note that this is not testing that creating > 1 decoder works -- only that the max supported instances value is accurate.) See also MediaCodec.CodecException's new constants in Android M. These API changes should make it possible to detect the capability before trying to play multiple videos and fail gracefully if it doesn't work (note that the CTS test fails on devices which fail in any way other than ERROR_INSUFFICIENT_RESOURCE).
  • See also Using multiple exo-players simultaneously #273 which mentions using software codecs as an alternative.

@CAMOBAP
Copy link

CAMOBAP commented Mar 24, 2016

awesome @andrewlewis thanks for details

@andrewlewis
Copy link
Collaborator

Closing due to lack of required information on the original issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants