如何使用Xamarin中的libvlcsharp播放HDR内容?
我在Google,developer.android.com和libvlcsharp/libvlc.android文档上没有成功。在LIBVLC文档中,它显然指出了它支持HDR,但我在GIT存储库中没有发现如何启用HDR播放的示例。 Google和Stackoverflow似乎没有任何片段,文档,甚至没有问题,询问如何启用C#中的HDR播放,也没有在Java中启用;既没有“原始”代码,也不使用诸如libvlc之类的库。
我使用普通VLC Android应用程序测试,它确实播放了HDR含量。我正在尝试播放本地HDR媒体(更具体地说是SMB共享。普通的VLC应用程序和我的应用都有适当的访问和播放媒体的权限)
以下代码片段确实播放了视频,但没有启用HDR,因此颜色在视频中被洗净:
_libVLC = new LibVLC();
m_VlcControl = new MediaPlayer(_libVLC);
_videoView = new VideoView(this) { MediaPlayer = m_VlcControl };
AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
var media = new Media(_libVLC, new Uri(cleanFilePathStr));
m_VlcControl.EnableHardwareDecoding = true;
m_VlcControl.Play(media);
我的应用确实确实检测到显示屏通过显示?ishdr
支持HDR,但是在启动播放时它不能自动启用它。
设备OS:Android 11
(min)目标SDK:30
I had no success on google, developer.android.com and LibVLCSharp/LibVLC.Android documentation. In the LibVLC documentation, it clearly states it supports HDR, but I found no examples in the git repos of how to enable HDR playback. Google and StackOverflow seemed to not have any snippets, documentation nor even questions asking how to enable HDR playback neither in C# nor in Java; neither "raw" code nor using any libraries like LibVLC.
I tested with the normal VLC android app, and it indeed plays HDR content. I am attempting to play local HDR media (more specifically SMB share. Both the normal VLC app and my app has the proper permissions to access and play the media)
The following code snippet does play the video but does not enable HDR, thus the colors in the video become washed up:
_libVLC = new LibVLC();
m_VlcControl = new MediaPlayer(_libVLC);
_videoView = new VideoView(this) { MediaPlayer = m_VlcControl };
AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
var media = new Media(_libVLC, new Uri(cleanFilePathStr));
m_VlcControl.EnableHardwareDecoding = true;
m_VlcControl.Play(media);
My app does indeed detect that the display supports HDR via Display?.IsHdr
, but it does not auto-enable it when starting the playback.
Device OS: Android 11
(min) Target SDK: 30
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论