使用 MediaCapture API,StartRecordToStorageFileAsync 无法 return 并且不会引发错误

Using the MediaCapture API, StartRecordToStorageFileAsync fails to return and does not raise an error

我正在尝试使用此 MediaCapture API 示例:

https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

但是当我按下 Start Record 来记录到一个文件时,这一行从来没有 returns:

await m_mediaCaptureMgr.StartRecordToStorageFileAsync(recordProfile, m_recordStorageFile);

并且没有抛出任何错误。这台计算机是 Cyber​​power PC。不过,该示例确实适用于我的另一台 windows 10 计算机(mac mini)。我认为这可能是编解码器问题,但找不到有关安装编解码器的任何信息,所以也许不是这样——不确定。感谢您提供任何帮助或信息。

附加信息:创建这样的配置文件有效:

MediaEncodingProfile recordProfile = null;
recordProfile = MediaEncodingProfile.CreateWmv(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);

但是调用 CreateMp4 而不是 CreateWmv 不起作用。

我怀疑您的特定安装的编码器有问题。如果你可以升级到 Windows 10,用 Visual Studio 2015 你可以开发通用应用程序。相同的代码应该可以正常工作。