Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pixelated Videos on some devices(Package: video_player) #162979

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

Open
ZaynMeledath opened this issue Feb 10, 2025 · 17 comments
Open

Pixelated Videos on some devices(Package: video_player) #162979

ZaynMeledath opened this issue Feb 10, 2025 · 17 comments
Assignees
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level found in release: 3.29 Found to occur in 3.29 found in release: 3.30 Found to occur in 3.30 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: video_player The Video Player plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@ZaynMeledath
Copy link

ZaynMeledath commented Feb 10, 2025

Steps to reproduce

Create a video player using the video_player package and play any video.
My app users reported this problem.
It happened in Oneplus node, realme etc.

Expected results

Expected result was to play videos seamlessly.

Actual results

Getting Pixelated Videos on some devices like Oneplus node, realme etc.
4-5 of my app users have reported this issue.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

Image

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.27.4, on macOS 15.3 24D60 darwin-arm64, locale
    en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      and macOS development.
      Download at: https://developer.apple.com/xcode/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
[✗] Chrome - develop for the web (Cannot find Chrome executable at
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2024.2)
[✓] VS Code (version 1.97.0)
[✓] VS Code (version 1.97.0)
[✓] Connected device (2 available)
[✓] Network resources
@ZaynMeledath ZaynMeledath changed the title Pixelated Videos on some devices Pixelated Videos on some devices(Package: video_player) Feb 10, 2025
@wbbtech
Copy link

wbbtech commented Feb 10, 2025

I had the same problem and it turns out that this error occurs from version (Flutter) 3.24.0 onwards. And it only happens in Android versions lower than 13 onwards. The temporary solution is to upgrade to Flutter version 3.22.3.

This error occurred a while ago, however, it happens again in recent versions. You can read more 24888

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Feb 11, 2025
@danagbemava-nc
Copy link
Member

Hi @ZaynMeledath, what version of video_player are you using? Do you have impeller enabled in your project? Does this still happen if you disable impeller?

What versions of android are those devices running and do you know the GPUs of the devices?

Can you check if this still reproduces on the master channel?

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 11, 2025
@ZaynMeledath
Copy link
Author

however

Thanks bro🤜🏻🤛🏻. Gonna try this

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 11, 2025
@ZaynMeledath
Copy link
Author

Hi @ZaynMeledath, what version of video_player are you using? Do you have impeller enabled in your project? Does this still happen if you disable impeller?

What versions of android are those devices running and do you know the GPUs of the devices?

Can you check if this still reproduces on the master channel?

  • video_player: 2.9.2
  • Impeller is disabled
  • I'll check the android version and gpu and update you bro.

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 14, 2025
@danagbemava-nc
Copy link
Member

@ZaynMeledath, can you also try the latest stable version to see if this reproduces?

@wbbtech
Copy link

wbbtech commented Feb 21, 2025

flutter version

Flutter 3.29.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 35c388afb5 (11 days ago) • 2025-02-10 12:48:41 -0800
Engine • revision f73bfc4522
ToolsDart 3.7.0DevTools 2.42.2

The video problem keeps happening, I'm emulating on Android 10.

Image

@danagbemava-nc
Copy link
Member

Hi @wbbtech, does this happen if you disable impeller? Also, are you seeing this on any physical devices?

@wbbtech
Copy link

wbbtech commented Feb 28, 2025

The error occurs with or without impeller, and I have only been able to test it on emulators, however, users report similar problems on their Android devices with versions 11 and below.

@danagbemava-nc
Copy link
Member

@wbbtech, please provide a minimal sample with a video we can use to reproduce the issue so that we can properly investigate this.

Thank you

@wbbtech
Copy link

wbbtech commented Mar 3, 2025

You can see the steps to reproduce the problem in the following link: #162890 (comment)

@danagbemava-nc
Copy link
Member

danagbemava-nc commented Mar 7, 2025

Reproducible using the code sample from #162890 (comment), pasted below for convenience.
I can reproduce this on an emulator running android 11, but It wasn't able to reproduce on an android 12/15 emulator.
This happens with both SKIA and Impeller

Labeling for further investigation.

Pixel 7 emulator running android 11 Pixel 9 emulator running android 12+
Image Image
code sample
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late VideoPlayerController _videoCtrl;
  late ValueNotifier<bool> _isPlaying;

  @override
  void initState() {
    _isPlaying = ValueNotifier<bool>(false);

    /// Video en formato horizontal
    final horizontal = Uri.parse("https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4");

    /// Video en formato vertical
    /// CC0 Creative Commons, from: Vídeo de Taryn Elliott de Pexels: https://www.pexels.com/es-es/video/una-persona-escondida-en-un-campo-de-flores-levanto-la-mano-haciendo-el-signo-de-la-paz-3127177/
    /// 240x426: https://videos.pexels.com/video-files/3127177/3127177-sd_240_426_24fps.mp4
    /// 360x640: https://videos.pexels.com/video-files/3127177/3127177-sd_360_640_24fps.mp4
    /// 540x960: https://videos.pexels.com/video-files/3127177/3127177-sd_540_960_24fps.mp4
    /// 720x1280: https://videos.pexels.com/video-files/3127177/3127177-hd_720_1280_24fps.mp4
    /// 1080x1920: https://videos.pexels.com/video-files/3127177/3127177-hd_1080_1920_24fps.mp4
    final vertical = Uri.parse("https://videos.pexels.com/video-files/3127177/3127177-sd_240_426_24fps.mp4");

    _videoCtrl = VideoPlayerController.networkUrl(vertical);
    _videoCtrl.initialize().then((_) {
      setState(() {});
    });

    _videoCtrl.setLooping(true);
    _videoCtrl.addListener(() {
      if (_videoCtrl.value.isPlaying != _isPlaying.value) {
        _isPlaying.value = _videoCtrl.value.isPlaying;
      }
    });

    super.initState();
  }

  @override
  void dispose() {
    _videoCtrl.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child:
              _videoCtrl.value.isInitialized
                  ? AspectRatio(aspectRatio: _videoCtrl.value.aspectRatio, child: VideoPlayer(_videoCtrl))
                  : const SizedBox.square(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            if (_isPlaying.value) {
              _videoCtrl.pause();
            } else {
              _videoCtrl.play();
            }
          },
          child: ValueListenableBuilder<bool>(
            valueListenable: _isPlaying,
            builder: (_, play, __) => Icon(play ? Icons.pause : Icons.play_arrow),
          ),
        ),
      ),
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel stable, 3.29.1, on macOS 15.3.1 24D70 darwin-arm64, locale en-US) [1,536ms]
    • Flutter version 3.29.1 on channel stable at /Users/deanli/dev/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 09de023485 (6 days ago), 2025-02-28 13:44:05 -0800
    • Engine revision 871f65ac1b
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.5s]
    • Android SDK at /Users/deanli/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app/Contents/jbr/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [1,750ms]
    • Xcode at /Applications/Xcode-16.3.0-Beta.2.app/Contents/Developer
    • Build 16E5121h
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [12ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [12ms]
    • Android Studio at /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] Android Studio (version 2024.2) [10ms]
    • Android Studio at /Users/deanli/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.97.2) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.106.0

[✓] Connected device (7 available) [8.0s]
    • Pixel 7 (mobile)                • 28291FDH2001SA                       • android-arm64  • Android 15 (API 35)
    • sdk gphone arm64 (mobile)       • emulator-5554                        • android-arm64  • Android 11 (API 30) (emulator)
    • Nexus (wireless) (mobile)       • 00008020-001875E83A38002E            • ios            • iOS 18.3.1 22D72
    • iPhone 16 Pro (mobile)          • B0797AD6-E1FD-4B41-A022-2D7E2276C29B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.3.1 24D70 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.3.1 24D70 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 133.0.6943.142
    ! Error: Browsing on the local area network for Dean’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [926ms]
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.30.0-1.0.pre.502, on macOS 15.3.1 24D70 darwin-arm64, locale en-US) [3.5s]
    • Flutter version 3.30.0-1.0.pre.502 on channel master at /Users/deanli/dev/master
    ! Warning: `flutter` on your path resolves to /Users/deanli/dev/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/deanli/dev/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1090285df (4 hours ago), 2025-03-06 21:01:22 -0800
    • Engine revision f1090285df
    • Dart version 3.8.0 (build 3.8.0-149.0.dev)
    • DevTools version 2.43.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.1s]
    • Android SDK at /Users/deanli/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app/Contents/jbr/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [1,339ms]
    • Xcode at /Applications/Xcode-16.3.0-Beta.2.app/Contents/Developer
    • Build 16E5121h
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [10ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [10ms]
    • Android Studio at /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Users/deanli/Applications/Android Studio Meerkat 2024.3.1 RC 2.app
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] Android Studio (version 2024.2) [9ms]
    • Android Studio at /Users/deanli/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.97.2) [8ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.106.0

[✓] Connected device (6 available) [7.4s]
    • Pixel 7 (mobile)          • 28291FDH2001SA                       • android-arm64  • Android 15 (API 35)
    • sdk gphone arm64 (mobile) • emulator-5554                        • android-arm64  • Android 11 (API 30) (emulator)
    • Nexus (wireless) (mobile) • 00008020-001875E83A38002E            • ios            • iOS 18.3.1 22D72
    • iPhone 16 Pro (mobile)    • B0797AD6-E1FD-4B41-A022-2D7E2276C29B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-4 (simulator)
    • macOS (desktop)           • macos                                • darwin-arm64   • macOS 15.3.1 24D70 darwin-arm64
    • Chrome (web)              • chrome                               • web-javascript • Google Chrome 133.0.6943.142
    ! Error: Browsing on the local area network for Dean’s iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [872ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

@danagbemava-nc danagbemava-nc added platform-android Android applications specifically p: video_player The Video Player plugin package flutter/packages repository. See also p: labels. c: rendering UI glitches reported at the engine/skia or impeller rendering level has reproducible steps The issue has been confirmed reproducible and is ready to work on team-android Owned by Android platform team fyi-ecosystem For the attention of Ecosystem team found in release: 3.29 Found to occur in 3.29 found in release: 3.30 Found to occur in 3.30 and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels Mar 7, 2025
@stuartmorgan-g stuartmorgan-g added the triaged-ecosystem Triaged by Ecosystem team label Mar 11, 2025
@flutter-triage-bot flutter-triage-bot bot removed fyi-ecosystem For the attention of Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels Mar 11, 2025
@jesswrd jesswrd added team-engine Owned by Engine team and removed team-android Owned by Android platform team labels Mar 11, 2025
@jonahwilliams
Copy link
Member

@danagbemava-nc what host platform are you running on? Intel mac?

@jonahwilliams jonahwilliams added P2 Important issues not at the top of the work list triaged-engine Triaged by Engine team labels Mar 17, 2025
@danagbemava-nc
Copy link
Member

@jonahwilliams, I'm running on an m1 mac

@PaMcD
Copy link

PaMcD commented Mar 24, 2025

Any update on this?

i'm seeing the same issue as per the original post, with the diagonal green pixel. i.e. not the other issue with green on the side.

Appears to be happening on Xiaomi Redmi phones occuring to my app users. I cant replicate as i dont have a device (physical or otherwise) to test it with.

@jonahwilliams
Copy link
Member

The explaination of this problem is here: #144407

TLDR: android does not support crop/rotate ec etera. Plugins, in this case the video player plugin, need to correct rendering with their own rotations and clips.

This is not an engine / impeller / skia issue.

@jonahwilliams jonahwilliams added team-android Owned by Android platform team and removed team-engine Owned by Engine team labels Apr 1, 2025
@flutter-triage-bot
Copy link

The triaged-engine label is irrelevant if there is no team-engine label or fyi-engine label.

@flutter-triage-bot flutter-triage-bot bot removed the triaged-engine Triaged by Engine team label Apr 1, 2025
@gmackall gmackall added the triaged-android Triaged by Android platform team label Apr 1, 2025
@mzdm
Copy link
Contributor

mzdm commented May 6, 2025

Got report from Xiaomi user as well - what is interesting, if they replay video recorded from camera, it looks fine. But screen recorded video replay looks exactly like in the issue

Any update on this?

i'm seeing the same issue as per the original post, with the diagonal green pixel. i.e. not the other issue with green on the side.

Appears to be happening on Xiaomi Redmi phones occuring to my app users. I cant replicate as i dont have a device (physical or otherwise) to test it with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level found in release: 3.29 Found to occur in 3.29 found in release: 3.30 Found to occur in 3.30 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: video_player The Video Player plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

10 participants