积极答复者
使用 Interop.WMEncoderLib.dll做屏幕录像

问题
-
IWMEncSourceGroupCollection SrcGrpColl; IWMEncSourceGroup2 SrcGrp; IWMEncAudioSource SrcAud; //音频 IWMEncVideoSource2 SrcVid; //视频 IWMEncProfile2 Pro; enc = new WMEncoderClass(); try { SrcGrpColl = enc.SourceGroupCollection; SrcGrp = (IWMEncSourceGroup2)SrcGrpColl.Add("SG_1"); SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); if (ckbSound.Checked) { SrcAud = (IWMEncAudioSource)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO); SrcAud.SetInput("Default_Audio_Device", "DEVICE", ""); } SrcVid.SetInput("ScreenCapture1", "ScreenCap", ""); Pro = GetSelectProfile(); SrcGrp.set_Profile(Pro); enc.File.LocalFileName = System.IO.Directory.GetCurrentDirectory()+"\\video.wma"; this.WindowState = FormWindowState.Minimized; enc.Start();
从网上找的源码提出重要代码
enc = new WMEncoderClass();
执行到此句时 程序强制关闭。
弹出错误信息 vshost32.exe 已停止工作
错误存储段 ,类型 0
事件名称: BEX
响应: 不可用
Cab ID: 0问题签名:
P1: WMERecord.vshost.exe
P2: 10.0.30319.1
P3: 4ba2084b
P4: StackHash_23fe
P5: 0.0.0.0
P6: 00000000
P7: 046f06e8
P8: c0000005
P9: 00000008
P10:附加文件:
可在此处获取这些文件:
C:\Users\ntbbit-1\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_WMERecord.vshost_136afd65c28758ba9bc4668647f0edf575f3_0f14472f分析符号:
重新检查解决方案: 0本人新手 第一次发帖 如有不对之处 还望指正。
- 已编辑 dgtg77 2012年10月13日 2:50