ExoPlayer: Video player had error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error
The error message comes up sometimes when I try to access a video displayed in my Flutter application. I am using Chewie (https://pub.dev/packages/chewie) when rendering my videos. The video is an mp4 file and works most of the time.
Full error message:
Video player had error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, null, -1, null, [1280, 720, 29.973475], [-1, -1]), format_supported=YES
It is not evident to me how the problem can be reproduced because it happens arbitrarily.
I don’t know the ExoPlayer version number. But I downloaded Chewie and video_player yesterday so I should have the latest. If I can find the version number in the bug report let me know. The expected behavior is no error message and a working video Device: Samsung SM-J105H Android version 5.1.1
Here is info from the bugReport. I do not know what information is of use…
01-18 12:22:38.159 770 1228 D InputMethodManagerService: windowGainedFocus mCurrentFocusedUserId - 0 and mSecureKeypadEnabled-false
01-18 12:22:38.169 1691 1691 D InputMethodFrameWorkUtils: InputMethodSubtype is found as local:sv
01-18 12:22:38.169 1691 1691 D InputMethodFrameWorkUtils: InputMethodSubtype is set as local:sv
01-18 12:22:38.169 9355 9400 I flutter : singleTestscreenItem :: Chewie Error: Video player had error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, null, -1, null, [1280, 720, 29.973475], [-1, -1]), format_supported=YES
01-18 12:22:38.169 1691 1691 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1748 android.content.ContextWrapper.sendBroadcast:392 com.sec.android.inputmethod.inputmethodframework.InputMethodFrameWorkUtils.setCurrentInputMethodSubtype:49 com.ime.framework.common.InputManagerImpl.finishInput:5031 com.sec.android.inputmethod.SamsungKeypad.onFinishInput:682
01-18 12:22:38.179 14816 14816 W linker : libliger.so: unused DT entry: type 0x6ffffef5 arg 0x4b4c
01-18 12:22:38.179 1691 1691 D SamsungIME: onStartInput: No inputType, No imeOption, isInputViewShown = false, isExtractViewShown = false, isShowInputRequested = false, isConfigChanged = false
01-18 12:22:38.179 9497 9497 D StatusBar: getNumberOfActiveSim: 1
01-18 12:22:38.179 770 848 V WindowStateAnimator: Finishing drawing window Window{c0d5266 u0 d0 SurfaceView}: mDrawState=READY_TO_SHOW
01-18 12:22:38.189 14816 14816 W linker : libliger.so: unused DT entry: type 0x6ffffffe arg 0x4b0c
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 41
- Comments: 51 (2 by maintainers)
I am also seeing similar error in a production Flutter app that uses the
video_playerpackage (thechewieflutter package usesvideo_playeras well).I see a number of crashes in Crashlytics, almost always Samsung devices like Samsung A11.
Unfortunately Flutter itself (or Crashlytics in Flutter) doesn’t seem to capture much additional info, it sends me this:
The Flutter
video_playerpackage is using a recent, but not latest version of ExoPlayer,v2.12.1: https://github.com/flutter/plugins/blob/2068cce1d06c7cbbc6e241f83af24e67dc72863d/packages/video_player/video_player/android/build.gradle#L47Any fixes for flutter? still not able to find a fix
any news
Same issue on Android 11.
This does not work if you need to store more than a single controller in the app (for buffering next videos etc.)
The same issue here… using flutter
Thanks, but I found some new debug information when the phone is directly attached to the computer:
Is this information helpful?
Exactly. And this is a common use case, for instance:
If you use video_player, for each video you should to use: _controller.dispose(); This fix for me.
Same error here
Getting the same issue in react-native also
I also had similar issue on android using Flutter and
video_player. I solved it by calling_controller.dispose()every time after the work was done.have you solve this?
any fix here, i am also facing same problem if i want to run more than 4 videos in PageViewBuilder
W/MediaCodecRenderer(18803): Failed to initialize decoder: OMX.Exynos.avc.dec W/MediaCodecRenderer(18803): android.media.MediaCodec$CodecException: Failed to initialize OMX.Exynos.avc.dec, error 0xfffffff4 W/MediaCodecRenderer(18803): at android.media.MediaCodec.native_setup(Native Method) W/MediaCodecRenderer(18803): at android.media.MediaCodec.<init>(MediaCodec.java:1912) W/MediaCodecRenderer(18803): at android.media.MediaCodec.createByCodecName(MediaCodec.java:1890)
Still not working 😭😭
As of June 2023, Flutter’s current video player version (2.6.1) is using the 2.18.7 version of exo player which happens to be the latest, but I am facing the same issue. I am preloading the videos and they work OK on emulator (Android Pixel 5 API level 32) but results in above error on the physical device (Android 10)
I’ve realised that this error only comes when you use IP path instead of domain path to play the videos.
Anyone who have managed to resolve this issue?