从 WPF MediaElement 控件捕获 MediaPlayer 异常
我正在 WPF 的 MediaElement 中播放视频。
它已经工作了数千次,一遍又一遍。
千载难逢(比如每周一次),我会遇到 Windows 异常(你知道对话 Dr. Watson Crash 吗??)。 MediaElment 不会暴露错误,它只是崩溃并在屏幕上显示丑陋的崩溃报告。
如果您“查看此报告”,您可以看到实际上是 MediaPlayer 崩溃了。 我知道我可以禁止弹出崩溃报告 - 但我更感兴趣的是找出出了什么问题。
我不确定如何捕获 Dr. Watson 捕获的结果,但如果有人对更好的捕获方法有建议,我现在会打开对话框。 这是数据的开头行,它指向我的应用程序,然后指向 wmvdecod.dll
AppName:ScottApp.exe 应用版本:2.2009.2291.805 应用标记:4a36c812 模组名称: wmvdecod.dll 模组版本:11.0.5721.5145 ModStamp:453711a3 f调试:0 偏移量:000cbc88
并来自 Win 事件日志。 (相同信息)
事件类型:错误 事件源:.NET 运行时 2.0 错误报告 活动类别:无 事件ID:1000 日期:2009 年 7 月 13 日 时间:上午 10:20:27 用户:不适用 电脑:28022 描述:错误应用程序 ScottApp.exe,版本 2.2009.2291.805,标记 4a36c812,错误模块 wmvdecod.dll,版本 11.0.5721.5145,标记 453711a3,调试? 0,故障地址0x000cbc88。
I'm playing video in a MediaElement in WPF.
It's working 1000's of times, over and over again.
Once in a blue moon (like once a week), I get a windows exception (you know the dialog Dr. Watson Crash??) that happens. The MediaElment doesn't expose an error, it just crashes and sits there with an ugly Crash report on the screen.
If you "view this report" you can see it is in fact MediaPlayer that has crashed. I know I can disable the crash reports from popping up - but I'm more interested in finding out what's going wrong.
I'm not sure how to capture the results of the Dr. Watson capture, but I have the dialog open now if someone has advice on a better way to capture. Here is the opening line of data, that points to my application, then to wmvdecod.dll
AppName: ScottApp.exe
AppVer: 2.2009.2291.805
AppStamp:4a36c812
ModName: wmvdecod.dll
ModVer: 11.0.5721.5145
ModStamp:453711a3
fDebug: 0
Offset: 000cbc88
And from the Win Event Log. (same information)
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 1000
Date: 7/13/2009
Time: 10:20:27 AM
User: N/A
Computer:28022
Description: Faulting application ScottApp.exe, version 2.2009.2291.805, stamp 4a36c812, faulting module wmvdecod.dll, version 11.0.5721.5145, stamp 453711a3, debug? 0, fault address 0x000cbc88.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这是 Windows 媒体解码器过滤器的错误。 我在其他不使用 MediaElement 的媒体播放器中也经历过同样的异常。
此异常来自您无权访问的线程上的本机代码。 所以我不知道如何捕获这些异常。
如果您想向 microsoft connect 站点提交详细的错误报告,请尝试在崩溃后运行此实用程序 (DebugDiag): http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang= zh
添加“崩溃规则”并浏览选项以生成崩溃报告。 我也会做同样的事情,也许他们可以解决这个问题。
如果可能的话,您的解决方法是找到一个稳定的编解码器(divx?)并将您的 Windows Media 文件转换为这种格式。
您可能会在不同的 GPU 上遇到不同的结果,因为 WM 编解码器将使用 DXVA 进行硬件加速。 我认为不同的驱动程序/GPU 会提供不同程度的可靠性。
I believe this to be a bug with the windows media decoder filter. I have experienced the same exception in other media players that DO NOT use MediaElement.
This exception is coming from native code on a thread you don't have access to. So I am unaware of how to catch these exceptions.
If you want to submit a detailed bug report to the microsoft connect site, try running this util after it crashes (DebugDiag): http://www.microsoft.com/DOWNLOADS/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en
Add the "Crash Rule" and go through the options to generate a crash report. I will do the same and maybe they can get this fixed.
A work around for you, if possible, is to find a stable codec (divx?) and convert your Windows Media Files to this format.
You may be experiencing different results with different GPUs because the WM codec will use DXVA for hardware acceleration. I think different drivers/gpus will give different amount of reliability.