尚未嘗試過,但有一個名爲Microsoft.Expression.Encoder.Live.LiveJob的類應該支持流式傳輸。我嘗試過這個示例,它從我的硬盤中傳輸了一個文件。我想它應該也支持編碼視頻流。這裏是示例代碼(對於編碼器3.0)
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();
}
我進一步查看類LiveJob,並且有多個選項可添加實況視頻和音頻設備。所以這絕對是你正在尋找的類 有關進一步的參考,看看這篇文章:http://social.expression.microsoft.com/Forums/en-US/encoder/thread/c575c5be-99dc-4473-bdc8 -25e59f1a91b3 – shake 2009-11-17 08:51:14