Encoder 3来自windows服务的实时编码 [英] Encoder 3 live encoding from windows service

查看:82
本文介绍了Encoder 3来自windows服务的实时编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用编码器3 SDK从Windows服务编码和广播实时视频?启动我的服务时出现以下错误。我正在运行该服务作为本地系统,我已经尝试允许它与桌面交互无济于事。任何其他进程绝对不会使用视频设备。我可以作为控制台应用程序运行该服务,一切正常。谢谢。

服务无法启动。 Microsoft.Expression.Encoder.SystemErrorException:无法创建设备。该设备可能正被另一个程序使用。 ---> System.Runtime.InteropServices.COMException(0x813A000D):来自HRESULT的异常:0x813A000D


在System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode,IntPtr errorInfo)

$ b在MS的ThrowHRESULT(Int32 hr)


的System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)


的$ b

。在MS.Internal.Expression.Encoder.Live.LiveEncode.AddDeviceSource(LiveDevice videoDevice,LiveDevice audioDevice)中的Internal.Expression.Encoder.Live.LiveEncode.CreateTimelineSegments()



at Microsoft.Expression.Encoder.Live.LiveJob.AddDeviceSource(LiveDevice videoDevice,LiveDevice audioDevice)


---内部异常堆栈跟踪结束---


at Microsoft.Expression.Encoder.Live.LiveJob.AddDeviceSource(LiveDevice videoDevice,LiveDevice audioDevice)



解决方案

我的应用程序中出现了同样的错误,我刚刚制定了&n bsp;快速修复。基本上我在调用LiveJob.StopEncoding()方法时遇到了错误,但它实际上是在另一个线程上运行(也许这就是为什么它说"设备可能正在被另一个程序使用")。然后我使用调度程序将其恢复到主线程,错误消失了。无论如何,希望这会有所帮助。

帅帅< www.aeriandi.com


Is it possible to encode and broadcast live video from a windows service using the encoder 3 SDK?  I'm getting the following error starting up my service.  I'm running the service as Local System and I've tried allowing it to interact with the desktop to no avail.  The video device is definitely not in use by any other process.  I can run the service as a console app and everything works fine.  Thanks.

Service cannot be started. Microsoft.Expression.Encoder.SystemErrorException: Cannot create device. The device may be in use by another program. ---> System.Runtime.InteropServices.COMException (0x813A000D): Exception from HRESULT: 0x813A000D

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)

at ThrowHRESULT(Int32 hr)

at MS.Internal.Expression.Encoder.Live.LiveEncode.CreateTimelineSegments()

at MS.Internal.Expression.Encoder.Live.LiveEncode.AddDeviceSource(LiveDevice videoDevice, LiveDevice audioDevice)

at Microsoft.Expression.Encoder.Live.LiveJob.AddDeviceSource(LiveDevice videoDevice, LiveDevice audioDevice)

--- End of inner exception stack trace ---

at Microsoft.Expression.Encoder.Live.LiveJob.AddDeviceSource(LiveDevice videoDevice, LiveDevice audioDevice)

 

解决方案

I got the same error in my app, and I just worked out a quick fix. Basically I got the error when I was calling the LiveJob.StopEncoding() method, but it's actually running on another thread (Maybe that's why it was saying "The device may be in use by another program"). I then use dispatcher to get it back to the main thread, the error is gone. Anyway, hope this helps.

Shuai
www.aeriandi.com


这篇关于Encoder 3来自windows服务的实时编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆