문제

나는 현재 Expression Encoder SDK를 실험하고 있지만 라이브 스트리밍과 관련하여 사용하는 것이 매우 혼란 스럽다. 웹캠에서 비디오 스트림을 캡처하고 프로그램을 인코딩 한 다음 스크립트 명령을 주입하면서 컴퓨터에서 라이브 스트림으로 게시하려고합니다. 나는 SDK를 살펴 보았지만 라이브 스트림이나 웹캠과 관련된 것을 찾을 수 없습니다. 몇 가지 코드 예제는 사용 방법을 언급합니다 Job 인코딩 할 클래스이지만 내가 찾은 것은 파일을 로컬로 인코딩하는 것입니다.

도움이 되었습니까?

해결책

Havent는 아직 시도했지만 Streamning을 지원 해야하는 Microsoft.expression.encoder.live.livejob이라는 클래스가 있습니다. 샘플을 시험해 보았고 하드 디스크에서 파일을 스트리밍했습니다. 비디오 스트림 인코딩도 지원해야한다고 생각합니다. 다음은 샘플 코드입니다 (Encoder 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();
            }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top