question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@ankitbatra11 library not working in exoplayer after upload to the server

See original GitHub issue

@ankitbatra11 even though I use your library to compress video to server but still can’t play in exoplayer.

/ExoPlayerImplInternal: Disable failed. java.lang.IllegalStateException at android.media.MediaCodec.native_flush(Native Method) at android.media.MediaCodec.flush(MediaCodec.java:2297) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:142) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:887) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:880) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:741) at com.google.android.exoplayer2.audio.MediaCodecAudioRenderer.onDisabled(MediaCodecAudioRenderer.java:530) at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:175) at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1608) at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1350) at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1314) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:571) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:260) at android.os.HandlerThread.run(HandlerThread.java:67) MediaCodec: Codec reported err 0xe, actionCode 0, while in state 6 ExoPlayerImplInternal: Playback error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(2, null, null, audio/mp4a-latm, mp4a.40.0, -1, en, [-1, -1, -1.0], [1, 48000]), format_supported=YES at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:555) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:260) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecDecoderException: Decoder failed: c2.android.aac.decoder at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.createDecoderException(MediaCodecRenderer.java:955) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:839) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:948) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478) at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:260)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3451) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:82) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1779) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:824) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:948)  at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:478)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:260)  at android.os.HandlerThread.run(HandlerThread.java:67) 

implementation 'com.github.ankitbatra11:VideoCompressor:1.0.3'

exoplayer version :

implementation 'com.google.android.exoplayer:exoplayer:2.13.3' //2.16.1 implementation 'com.google.android.exoplayer:exoplayer-core:2.13.3' implementation 'com.google.android.exoplayer:exoplayer-dash:2.13.3' implementation 'com.google.android.exoplayer:exoplayer-ui:2.13.3'

Do you know how to solve it?

This sample my code using courotine

`val compressVideoRequest = CompressVideoRequest.Builder() .setSourceVideo(AbsoluteFilePathSourceVideo(source)) .setCompressedVideoAbsoluteFilePath(dest) .setCompressQuality(CompressQuality.LOW) .setCompressListener(object:CompressListener.DoNothingCompressListener(){ override fun onProgress(percent: Float) { super.onProgress(percent) } }) .build()

    val resultCompress = VideoController.getInstance().convertVideo(compressVideoRequest)

    if(resultCompress){
        var compressUri:Uri? = null
        var name:String? = null
        var length:Long? = null

        val videoFile: File = File(dest)
        compressUri = FileProvider.getUriForFile(mContext, "test.com", videoFile)
        name = videoFile.name
        length = videoFile.length().div(1024) // Size in KB

        var albumFile = AlbumFile()

        albumFile.setUri(compressUri)
        albumFile.bucketName = name ?: ""
        albumFile.mediaType = AlbumFile.TYPE_VIDEO
        albumFile.mimeType = "video/mp4"
        if (length != null) {
            albumFile.size = length
        }

        objVideo.resume(albumFile)
    }`

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
hafiz013commented, Feb 24, 2022

com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(2, null, null, audio/mp4a-latm, mp4a.40.0, -1, en, [-1, -1, -1.0], [1, 48000]), format_supported=YES

0reactions
HashiR8commented, Apr 25, 2022

The issue presents after compressing any video with silli compressor if you play the video without compressing it plays just fin on exoplayer.

The issue i get on exoplayer is the same as mentioned by hafiz013 i.e. com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(2, null, null, audio/mp4a-latm, mp4a.40.0, -1, en, [-1, -1, -1.0], [1, 48000]), format_supported=YES

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - ExoPlayer
This error will occur if your app requests cleartext HTTP traffic (i.e., http:// rather than https:// ) when its Network Security Configuration does...
Read more >
playback problems after upgrade · Issue #5582 - GitHub
I updated the ExiPlayer library version to 2.8.4 as the last one, about which the Gradle informs, from 2.4.4 for playing live HLS...
Read more >
Exoplayer, NanoHTTPD : Exoplayer is not able to play a .mp3 ...
The files are .mp3 files and I am able to play the file on browser or by using MediaPlayer library on android. Here...
Read more >
ExoPlayer - Android Developers
ExoPlayer is an open source project that is not part of the Android framework and is distributed separately from the Android SDK.
Read more >
Battling problematic videos with Google's ExoPlayer - Ian Bird
The ExoPlayer Library contains a number of demo integrations, ... Since the local HTTP server that we're running isn't configured with an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found