@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:
- Created 2 years ago
- Comments:6
Top GitHub Comments
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
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