2009-06-23 4 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

LiveJob 클래스를 살펴보면 라이브 비디오 및 오디오 장치를 추가 할 수있는 여러 옵션이 있습니다. 그래서 이것은 분명히 당신이 찾고있는 클래스입니다 자세한 내용은이 게시물을보십시오 : 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