FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
109 stars 18 forks source link

Error in MediaCodecVideoRender #3346

Open Aging-Developer opened 2 weeks ago

Aging-Developer commented 2 weeks ago

Can we access your project?

Current Behavior

Videos do not play on some phones on Andriod:

MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, -1, null, [500, 350, 25.0], [-1, -1]), format_supported=YES

Works in debug, works or devices with app from Play Store, doesnt work on some devices.

Expected Behavior

For videos to play on devices without error

Steps to Reproduce

Build app with video and test on different physical devices. (Fails on Andriod 10 device)

Reproducible from Blank

Bug Report Code (Required)

IT8shsrqx5NgoctZ1s7ide9VoGA5KW4/bZIaluwadw8gGJD2PewTe+D4RFNWUu7ma1NcHmKZmmcypdrMhezLDsADaEiqRtg5wqlxFjvPe16iSra0PaW8RHFfJ8NRC0Cjy6uRvCVQNsFiLHMlxkyYCdiXaBfDJrLJOzM7HvKiVYbIn2yfGjLBIDgz0W45HkuVCuQXIVDq+f6QspZl1eTjzw==

Visual documentation

346900852-f1f01529-e7f7-4ed7-af04-34d0f75e742f

E/ExoPlayerImplInternal(16867): Playback error E/ExoPlayerImplInternal(16867): com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.64001F, -1, null, [500, 350, 25.0], [-1, -1]), format_supported=YES E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:578) E/ExoPlayerImplInternal(16867): at android.os.Handler.dispatchMessage(Handler.java:106) E/ExoPlayerImplInternal(16867): at android.os.Looper.loop(Looper.java:219) E/ExoPlayerImplInternal(16867): at android.os.HandlerThread.run(HandlerThread.java:67) E/ExoPlayerImplInternal(16867): Caused by: com.google.android.exoplayer2.video.MediaCodecVideoDecoderException: Decoder failed: OMX.hisi.video.decoder.avc E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1639) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:803) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1007) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:502) E/ExoPlayerImplInternal(16867): ... 3 more E/ExoPlayerImplInternal(16867): Caused by: java.lang.IllegalStateException E/ExoPlayerImplInternal(16867): at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) E/ExoPlayerImplInternal(16867): at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2789) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:106) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1814) E/ExoPlayerImplInternal(16867): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:782) E/ExoPlayerImplInternal(16867): ... 5 more E/ExoPlayerImplInternal(16867): Disable failed.

Environment

- FlutterFlow version: 4.1.65+
- Platform:
- Browser name and version:
- Operating system and version affected:

Additional Information

Cannot deploy App to Store as video doesn't play on all devices. So it is critical to get working so app can go live. So for me this is business critical.

Alezanello commented 2 weeks ago

Hello!

I'm sorry to hear you're facing this issue. Let's take a step-by-step approach to identify the root cause. Please give me a few minutes to validate whether the problem is specific to Android 10 devices, and then we can proceed from there.

In the meantime, are you compiling directly from FlutterFlow, or are you using GitHub, Codemagic, or another compiler to deploy to the store?

Thank you for your patience.

Alezanello commented 2 weeks ago

Hello again!

I was able to compile the app and run it on an Android 10 device (Pixel 4 with Android 10). After logging in, a pop-up message with a tour video appears. However, when I click on it, I receive an error indicating that the file is missing:

Caused by: java.io.FileNotFoundException: flutter_assets/assets/videos/onboarding_walk_through.mp4

I checked the assets, and it appears the file is indeed missing.

Alezanello commented 2 weeks ago

On the other hand, I noticed that you have a video at the top of the HomePage. This video runs smoothly without any issues on my Android 10 device.

I also tested it on Android 11 to see if something changes and all is running smoothly

Aging-Developer commented 2 weeks ago

Hi, Yes the video for the tour is missing at the moment (that is by choice, as will add last thing). The video on top of the homepage is the video in question (it is also used on welcome page - where the original bug report is for, it is also in onboarding pages).

I Have been trying many combinations of devices and api levels:

  1. The original bug report (and crash) is for a physical device (HUAWEI MAR-LX1A)
  2. I have found an issue with the video player on a Nexus 5 Virtual device (api33) - As that's what Google uses alot - It is throwing this (on a cold boot only):

======== Exception caught by services library ====================================================== The following PlatformException was thrown while de-activating platform stream on channel flutter.io/videoPlayer/videoEvents0: PlatformException(error, No active stream to cancel, null, null)

When the exception was thrown, this was the stack:

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)

1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)

#2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:688:9) ==================================================================================================== I dont think it is Android 10 specific as just tested on a virtual Pixel 7 api 29 and its ok. The above tests have been from downloaded code from FF. The original bug report on a physical device, is deployed through FF using a github repo.
Aging-Developer commented 2 weeks ago

also get below, when connected to physical device (samsung A32) when the homepage (has video) loads for the first time:

======== Exception caught by services library ====================================================== The following PlatformException was thrown while de-activating platform stream on channel flutter.io/videoPlayer/videoEvents2: PlatformException(error, No active stream to cancel, null, null)

When the exception was thrown, this was the stack:

0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)

1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)

#2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:688:9) ====================================================================================================
Aging-Developer commented 2 weeks ago

@Alezanello The crash still happens when Android Studio is attached to a HUAWEI MAR-LX1A, both with the inbuilt video player and video_player: ^2.8.6 (in custom widget/tour video).

In the tour video it throws (captured by crashlytics):

PlatformException(error, No active stream to cancel, null, null). Error thrown . at StandardMethodCodec.decodeEnvelope(message_codecs.dart:648) at MethodChannel._invokeMethod(platform_channel.dart:334) at EventChannel.receiveBroadcastStream.(platform_channel.dart:688)

So this device really doesn't like video players!

I have noticed errors being captured for other devices to with the same error as above, so think there is something more generic happening with the video play, it can be reproduced by navigating away from the Homepage after its been left for 10 minutes.

Alezanello commented 2 weeks ago

Hello Again!
Did you tried to compile with the new FlutterFlow update to see if this issue was fixed?

Aging-Developer commented 2 weeks ago

yes, the error still exists.

Aging-Developer commented 1 week ago

Hi, Any update on this?

Alezanello commented 1 week ago

Hello Aging!

I haven't encountered anything new from my side. I've been trying to replicate the issue, and everything seems to be working as expected for me. The PlatformException issue might be triggered because the video hasn't been initiated yet. If you wait a few milliseconds after initialization, it should work correctly.

Aging-Developer commented 1 week ago

Hi, Thanks for the reply, but that really doesn't help me solve the issue.

I think to has something to do with flutter_flow_video_player.dart not disposing correctly when:

github-actions[bot] commented 5 days ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

Aging-Developer commented 5 days ago

@Alezanello Do you have an update on this?