跳至內容
MasterDragon
使用者工具
登入
網站工具
搜尋
工具
顯示頁面
舊版
反向連結
最近更新
多媒體管理器
網站地圖
登入
>
最近更新
多媒體管理器
網站地圖
足跡:
program:net:捕捉攝影機内容
本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。
====== 使用 C# 捕捉攝影機内容 ====== <code c#> //在button的click事件中加入:(前提是你装有Media 编码器9) //記得 using WMEncoderLib; // Create WMEncoderApp and WMEncoder objects. WMEncoderApp EncoderApp = new WMEncoderApp(); IWMEncoder Encoder = EncoderApp.Encoder; // Display the predefined Encoder UI. EncoderApp.Visible = true; // Specify the source for the input stream. IWMEncSourceGroupCollection SrcGrpColl = Encoder.SourceGroupCollection; IWMEncSourceGroup SrcGrp = SrcGrpColl.Add("SG_1"); IWMEncSource SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO); IWMEncVideoSource2 SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); SrcAud.SetInput("Default_Audio_Device", "Device", ""); SrcVid.SetInput("Default_Video_Device", "Device", ""); // Specify a profile. IWMEncProfile Pro; IWMEncProfileCollection ProColl = Encoder.ProfileCollection; for (int i = 0; i < ProColl.Count; i++) { Pro = ProColl.Item(i); if (Pro.Name == "Windows Media Video 8 for Local Area Network (384 Kbps)") { SrcGrp.set_Profile(Pro); break; } } // Create a broadcast. IWMEncBroadcast BrdCst = Encoder.Broadcast; BrdCst.set_PortNumber(WMENC_BROADCAST_PROTOCOL.WMENC_PROTOCOL_HTTP, 8080); // Start the encoding process. Encoder.PrepareToEncode(true); Encoder.Start(); </code>
program/net/捕捉攝影機内容.txt
· 上一次變更: 2019/11/16 08:12 由
127.0.0.1
頁面工具
顯示頁面
舊版
反向連結
回到頁頂