首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Expression Encoder SDK帮助

Expression Encoder SDK帮助
EN

Stack Overflow用户
提问于 2009-06-23 19:36:28
回答 1查看 7.4K关注 0票数 2

我目前正在试验Expression Encoder SDK,但我发现在直播时使用它非常令人困惑。我正在尝试从网络摄像头捕获视频流,用我的程序进行编码,然后将其作为实况流从我的计算机发布,同时还注入脚本命令。我一直在寻找SDK,但我找不到任何与直播流或网络摄像头有关的东西。有几个代码示例提到了如何使用Job类进行编码,但我找到的所有内容都是关于本地编码文件的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2009-11-17 15:56:22

还没有尝试过,但是有一个名为Microsoft.Expression.Encoder.Live.LiveJob的类应该支持streamning。我尝试了这个示例,它从我的硬盘上流式传输了一个文件。我想它也应该支持编码视频流。以下是示例代码(适用于编码器3.0)

代码语言:javascript
复制
using (LiveJob job = new LiveJob())
            {
                // Create a new file source from the file name we were passed in
                LiveFileSource fileSource = job.AddFileSource(fileToEncode);

                // Set this source to Loop when finished
                fileSource.PlaybackMode = FileSourcePlaybackMode.Loop;

                // Make this source the active one
                job.ActivateSource(fileSource);

                // Create a new windows media broadcast output format so we
                // can broadcast this encoding on the current machine.
                // We are going to use the default audio and video profiles
                // that are created on this output format.
                WindowsMediaBroadcastOutputFormat outputFormat = new WindowsMediaBroadcastOutputFormat();

                // Let's broadcast on the local machine on port 8080
                outputFormat.BroadcastPort = 8080;

                // Set the output format on the job
                job.OutputFormat = outputFormat;

                // Start encoding
                Console.Out.Write("Press 'x' to stop encoding...");
                job.StartEncoding();

                // Let's listen for a keypress to know when to stop encoding
                while (Console.ReadKey(true).Key != ConsoleKey.X)
                {
                    // We are waiting for the 'x' key
                }

                // Stop our encoding
                Console.Out.WriteLine("Encoding stopped.");
                job.StopEncoding();
            }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1034705

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档