You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[video_player] Videos are stretched when the video being played doesn't have a 1.0 Pixel Aspect Ratio (PAR) #132934
Doctor summary (to see all details, run flutter doctor -v):[✓] Flutter (Channel stable, 3.10.5, on macOS 11.6.1 20G224 darwin-x64, locale zh-Hans-CN)[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)[✓] Chrome - develop for the web[✓] Android Studio (version 2022.2)[✓] VS Code (version 1.81.1)[✓] Connected device (3 available)[✓] Network resources• No issues found!
this is the video which PAR(pixel aspect ratio) is not 1.0:
test.mp4
you can use ffmpeg to get this video's detail info as shown below. what I want to get is the real display aspect ratio to set my video in flutter page. in this case, the value is 9:16. but I can only use 【videoController.value.aspectRatio】to get 1.0.
Hi @shirlay-Chang. Thanks for your response. I'm unable to reproduce the stretch on the latest flutter versions, is there any reproduction steps I might be missing out on or can you share the actual behaviour on your end vs the expected? Also, I'm not sure I fully understand this issue, can you edit the minimal complete reproducible code sample I added below to reproduce your issue?
Hi, I noticed your device is iphone? my device is android. I use your code sample and same video that I upload, my page just like this,
this is my flutter doctor info:
my video_player version is 2.7.0, I check the video_player source code, the aspectRatio is calculated by width and height, when video PAR is not 1.0, there will be a stretch.
changed the title [-]use video_player load a video witch PAR is not 1.0,cannot get the real DAR[/-][+][video_player] Videos are stretched when the video being played doesn't have a 1.0 Pixel Aspect Ratio (PAR)[/+]on Aug 29, 2023
I can reproduce the issue using the code sample in #132934 (comment). I modified it to use the GitHub URL of the video in question. Updated sample below. So far it seems like it is an android only issue. The video is not stretched on either iOS or web.
[✓] Flutter (Channel stable, 3.13.1, on macOS 13.4.1 22F770820d darwin-arm64, locale en-GB)
• Flutter version 3.13.1 on channel stable at /Users/nexus/dev/sdks/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e1e47221e8 (6 days ago), 2023-08-22 21:43:18 -0700
• Engine revision b20183e040
• Dart version 3.1.0
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/nexus/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode-14.3.0.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.10121639/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 17.0.6+0-17.0.6b802.4-9586694)
[✓] Android Studio (version 2022.3)
• Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/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 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
• IntelliJ at /Users/nexus/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin version 75.1.4
• Dart plugin version 232.8660.129
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
• IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9225.16/IntelliJ IDEA.app
• 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
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
• IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/232.8660.185/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.81.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.70.0
[✓] Connected device (4 available)
• Pixel 7 (mobile) • 28291FDH2001SA • android-arm64 • Android 13 (API 33)
• Nexus (mobile) • 00008020-001875E83A38002E • ios • iOS 16.6 20G75
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F770820d darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.110
[✓] Network resources
• All expected network resources are available.
• No issues found!
[!] Flutter (Channel master, 3.14.0-12.0.pre.78, on macOS 13.4.1 22F770820d darwin-arm64, locale en-GB)
• Flutter version 3.14.0-12.0.pre.78 on channel master at /Users/nexus/dev/sdks/flutters
! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 6dae269881 (3 hours ago), 2023-08-29 00:22:24 -0400
• Engine revision c7c61ff973
• Dart version 3.2.0 (build 3.2.0-118.0.dev)
• DevTools version 2.26.2
• 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 33.0.1)
• Android SDK at /Users/nexus/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode-14.3.0.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.10121639/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 17.0.6+0-17.0.6b802.4-9586694)
[✓] Android Studio (version 2022.3)
• Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/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 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
• IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9225.16/IntelliJ IDEA.app
• 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
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
• IntelliJ at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/232.8660.185/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.81.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.70.0
[✓] Connected device (4 available)
• Pixel 7 (mobile) • 28291FDH2001SA • android-arm64 • Android 13 (API 33)
• Nexus (mobile) • 00008020-001875E83A38002E • ios • iOS 16.6 20G75
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F770820d darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.110
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
With Android, I have the same problem. I'm using the most recent version of the video player, and several of the videos—mostly those that were taken from a wide angle (0.6) are playing stretched. However, the same video with the same pixel ratio working in iOS.
Reacted by DERONIC, Ufo411, Jifflis, Célian Frasca, Laestry, daniel adame , Mahdi, SAGNIK SANYAL, Misoba and Michael Schmidmaier
What I've noticed if that the height and width come in as the same value, so for now I'm just aplying the "correct" aspectratio on my videos as most of have an aspect ratio of 9/16. Defo not the best solution but works for now.
If you are storing your vids in your own backend the best solution for now would be to probably keep the correct aspect ratio on your backend or get it using another library.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
dam-ease commentedon Aug 21, 2023
Hi @shirlay-Chang. Thanks for filing this. Please can you provide more information on this issue, more specifically:
Thank you!
shirlay-Chang commentedon Aug 28, 2023
this is the video which PAR(pixel aspect ratio) is not 1.0:
test.mp4
you can use ffmpeg to get this video's detail info as shown below. what I want to get is the real display aspect ratio to set my video in flutter page. in this case, the value is 9:16. but I can only use 【videoController.value.aspectRatio】to get 1.0.

my UI code is:
AspectRatio( aspectRatio: _videoController.value.aspectRatio, child: VideoPlayer(_videoController), )dam-ease commentedon Aug 28, 2023
Hi @shirlay-Chang. Thanks for your response. I'm unable to reproduce the stretch on the latest flutter versions, is there any reproduction steps I might be missing out on or can you share the actual behaviour on your end vs the expected? Also, I'm not sure I fully understand this issue, can you edit the minimal complete reproducible code sample I added below to reproduce your issue?
Code Sample Used
stable, master flutter doctor -v
shirlay-Chang commentedon Aug 29, 2023
Hi, I noticed your device is iphone? my device is android. I use your code sample and same video that I upload, my page just like this,

this is my flutter doctor info:

my video_player version is 2.7.0, I check the video_player source code, the aspectRatio is calculated by width and height, when video PAR is not 1.0, there will be a stretch.

[-]use video_player load a video witch PAR is not 1.0,cannot get the real DAR[/-][+][video_player] Videos are stretched when the video being played doesn't have a 1.0 Pixel Aspect Ratio (PAR)[/+]danagbemava-nc commentedon Aug 29, 2023
I can reproduce the issue using the code sample in #132934 (comment). I modified it to use the GitHub URL of the video in question. Updated sample below. So far it seems like it is an android only issue. The video is not stretched on either iOS or web.
Maybe related? #94234
Labeling for further investigation.
updated sample
flutter doctor -v
6 remaining items
titobrezende commentedon May 31, 2024
JiyadAhammad commentedon Oct 21, 2024
With Android, I have the same problem. I'm using the most recent version of the video player, and several of the videos—mostly those that were taken from a wide angle (0.6) are playing stretched. However, the same video with the same pixel ratio working in iOS.
Laestry commentedon Dec 1, 2024
What I've noticed if that the height and width come in as the same value, so for now I'm just aplying the "correct" aspectratio on my videos as most of have an aspect ratio of 9/16. Defo not the best solution but works for now.
If you are storing your vids in your own backend the best solution for now would be to probably keep the correct aspect ratio on your backend or get it using another library.
juliamwangi123 commentedon Sep 26, 2025
misobadev commentedon Oct 12, 2025
DevHitesh29 commentedon Oct 13, 2025
[video_player_android] Report display size for anamorphic video (flut…
[video_player_android] Report display size for anamorphic video (flut…
[video_player_android] Report display size for anamorphic video (flut…
github-actions commentedon Sep 16, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.