c# - 如何设置 FFMPEGInterop 以使用 DRM playready

标签 c# ffmpeg uwp drm playready

我正在使用 FFMPEGInterop 类播放 UWP 视频。我需要使用 playready 设置播放它,但遇到了问题。

我可以只使用 mediaplayerelement 并创建保护管理器来播放 playready,但是当我创建一个 FFMPEGMSS 来流式传输它时,它会失败。将保护管理器添加到 MediaStreamSource 时表示值超出范围。

var StreamSource = FFmpegMSS.GetMediaStreamSource();
var protectionManager = new Windows.Media.Protection.MediaProtectionManager();
Windows.Foundation.Collections.PropertySet cpSystems = new Windows.Foundation.Collections.PropertySet();
cpSystems.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput"); //Playready
protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", cpSystems);
protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
protectionManager.ServiceRequested += ProtectionManager_ServiceRequested;
protectionManager.ComponentLoadFailed += ProtectionManager_ComponentLoadFailed;

protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");

var supportsHardwareDrm = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM);
if (!supportsHardwareDrm)
{
    protectionManager.Properties["Windows.Media.Protection.UseSoftwareProtectionLayer"] = true;
}
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

Header.Text = supportsHardwareDrm ? "SUPPORTED" : "NOT SUPPRTED";

StreamSource.MediaProtectionManager = protectionManager;

mediaElement.Source = MediaSource.CreateFromMediaStreamSource(StreamSource);

我应该能够使用设置保护管理器开始播放准备好的 DRM,但在下一步获取任何有关它的信息时感到很困惑。

最佳答案

UWP MediaElement未对来自外部来源的 PlayReady 内容实现必要的支持。也就是说,没有带有 FFmpegMSS 的 UWP PlayReday 播放。 .

您只能使用 Microsoft 自己的流媒体源获得 PlayReady。

关于c# - 如何设置 FFMPEGInterop 以使用 DRM playready,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58665032/

相关文章:

c# - 使用陈述题

c# - UnitOfWork & Generic Repository,带有自定义存储库的 SOLID 原则

html - HTML 的 ffmpeg 编码

sqlite - 如何在UWP应用程序中的应用程序文件夹之外访问文件(如SQLite数据库)?

c# - 解析 UWP 应用中的当前用户

c# - linq 中等效的 SQL 限制

c# - 由于其保护级别而无法访问

php - ffmpeg 没有从 php exec() 函数运行,从命令行工作

PHP exec 无法正常工作

c# - UWP InkCanvas 用颜色填充徒手绘制的形状