2009-06-23 13 views
2

現在、Expression Encoder SDKを試していますが、ライブストリーミングには非常に混乱しています。私はウェブカメラからビデオストリームをキャプチャしようとしています。私のプログラムでエンコードしてから、スクリプトコマンドを注入しながらコンピュータからライブストリームとして公開しようとしています。私はSDKを見てきましたが、ライブストリームやウェブカメラに関する情報は見つかりませんでした。いくつかのコード例では、Jobクラスを使用してエンコードする方法を説明しましたが、私が見つけたのはファイルをローカルにエンコードすることだけでした。Expression Encoder SDKに関するヘルプ

答えて

2

Haventはまだ試しましたが、ストリーミングをサポートするはずの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(); 
      } 
+0

ライブビデオとオーディオデバイスを追加するオプションは複数あります。これは間違いなくあなたが探しているクラスです さらに詳しい参照のために、この記事を見てください:http://social.expression.microsoft.com/Forums/en-US/encoder/thread/c575c5be-99dc-4473-bdc8 -25e59f1a91b3 – shake

+0

はい、3.0でストリーミングするクラスがありますが、投稿したときに3.0が存在しませんでした。あなたはちょっと遅かったですが、代わりにWMEを使用しました。それは管理されていませんが、それは仕事をしました。 – Bevin

+0

とにかく、それは正解ですので、私はそのようにマークします。 – Bevin

関連する問題