-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Video Player HDR Problem #91241
Comments
Hey @jmagman , I suspect about "kCVPixelFormatType_32BGRA" in FLTVideoPlayerPlugin.m > createVideoOutputAndDisplayLink() function. But I'm not sure which value should be there. |
Hi @ibrahimdevs, Can you please provide a link to any HDR videos so that I may confirm this behaviour? Thank you |
Hi @danagbemava-nc , Thanks for your interest. I'm really stuck in this issue and very surprise that nobody even mentioned it until now. I'm getting lots of complaints about this issue from my app. If you provide any workaround, it will be great. Thank you so much again, |
Hi @ibrahimdevs, thanks for the sample. I can reproduce this with the flutter doctor -v[✓] Flutter (Channel stable, 2.5.2, on macOS 11.5.1 20G80 darwin-arm, locale en-GB)
• Flutter version 2.5.2 at /Users/nexus/dev/sdks/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3595343e20 (5 days ago), 2021-09-30 12:58:18 -0700
• Engine revision 6ac856380f
• Dart version 2.14.3
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/nexus/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /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 11.0.10+0-b96-7249189)
[✓] VS Code (version 1.60.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.27.0
[✓] Connected device (3 available)
• M2007J20CG (mobile) • 5dd3be00 • android-arm64 • Android 11 (API 30)
• macOS (desktop) • macos • darwin-arm64 • macOS 11.5.1 20G80 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61
• No issues found! code sampleimport 'package:video_player/video_player.dart';
import 'package:flutter/material.dart';
void main() => runApp(const VideoApp());
class VideoApp extends StatefulWidget {
const VideoApp({Key? key}) : super(key: key);
@override
_VideoAppState createState() => _VideoAppState();
}
class _VideoAppState extends State<VideoApp> {
late VideoPlayerController _controller;
@override
void initState() {
super.initState();
_controller = VideoPlayerController.asset('assets/hdr_video.MOV')
..initialize().then((_) {
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Video Demo',
home: Scaffold(
body: Center(
child: _controller.value.isInitialized
? AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: VideoPlayer(_controller),
)
: Container(),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {
_controller.value.isPlaying
? _controller.pause()
: _controller.play();
});
},
child: Icon(
_controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
),
),
),
);
}
@override
void dispose() {
super.dispose();
_controller.dispose();
}
}
video asset |
better_player displays HDR correctly for some reason, I'd be very happy if this plugin could do it too! I'll try to see if I can find something. |
I have noticed that I have way too little experience in native iOS development to understand anything 😅 So any help would be greatly appreciated! I'm happy to provide assistance wherever I can help. The main thing that I found out is that better_player uses a UIKitView on iOS for the video player. This explains why it's behaving a little differently from this packages VideoPlayer (e.g. BackdropFilter isn't applied to better_player but is for video_player) |
Hi @danagbemava-nc and @stuartmorgan , |
I have the same problem this is my solution ,I hope it helps
|
@blackox626 we take pull requests 🙂 |
@blackox626 Yeah tonemapping would at least help this package deal with HDR video in a decent way. As far as I understand we could only achieve HDR brightness by using an embedded native view, so I think this is the way to go for now? |
you mean platform view? |
@blackox626 Where did you get in self mContext? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@BurykinNikolay Did you ever find out what mContext was? |
anything new? |
My approach is to make modifications by duplicating the plugin code and defining a new variable called mcontext to handle the pixelBuffer. |
Hello everyone, I am seeking recommendations on playing HDR videos in Flutter. Currently, I see two potential solutions:
I find it hard to believe that there aren't any Flutter video applications addressing this issue. So, I am curious to know how others have tackled the problem of HDR playback in Flutter. Could someone help with ideas, plz) Thank you! |
I just found this package recently, I don't know if it addresses the issue with HDR, I have not been able to test it. |
It works! #129238 (comment) |
What should I do if I encounter the same problem? |
@qpalzm963 You can refer to the documentation of |
i try video_player_media_kit example but same question myvideo is .mov |
I am trying to install media_kit but I get the following error:
|
@hellohejinyu |
This is a big issue with the explosion of HDR content in recent years, especially when it's increasingly common for phones to shoot HDR videos. I see that the re-triage tag was recently removed from this issue. Are there any plans underway to bring HDR to Flutter? This is the single feature I'm most looking forward to. |
Perhaps this would be fixed by switching to PlatformView: #86613 |
Hi,
Video player plugin is not supporting HDR videos. When you try to play HDR video, it plays like SDR and different color.
You can try it video_player plugin's example, simply try to play any HDR video, you will notice different color video.
Video Player is top of AVPlayer and AVPlayer should play HDR videos automatically, but it didn't. I tried everything to find a workaround but no luck. Maybe https://developer.apple.com/news/?id=rwbholxw this helps.
Thanks,
The text was updated successfully, but these errors were encountered: