How to specify encoding bitrate while capturing from a webcam - MS Expression Encoder 4

假装没事ソ 提交于 2019-12-13 02:07:36

问题


I have a program to capture and save live webcam video. This is taken from sample programs coming with Expression Encoder 4.

LiveJob job = new LiveJob();
EncoderDevice video = EncoderDevices.FindDevices(EncoderDeviceType.Video).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Video)[0] : null;
EncoderDevice audio = EncoderDevices.FindDevices(EncoderDeviceType.Audio).Count > 0 ? EncoderDevices.FindDevices(EncoderDeviceType.Audio)[0] : null;

LiveDeviceSource deviceSource = job.AddDeviceSource(video, audio);
job.ActivateSource(deviceSource);

//When the Start Encoding Button is clicked.
fileOut.OutputFileName = "C:\\output\\Capture\\Video1.wmv";
job.PublishFormats.Add(fileOut);
job.StartEncoding();

//When the Stop Encoding Button is clicked.
job.StartEncoding();

How to specify the bitrate of the encoded video.


回答1:


You need to add format

WindowsMediaOutputFormat outputFormat = new WindowsMediaOutputFormat();  
AdvancedVC1VideoProfile profile = new AdvancedVC1VideoProfile();  
profile.Bitrate = 1;  
outputFormat.VideoProfile = profile;  
job.OutputFormat = outputFormat;


来源:https://stackoverflow.com/questions/3879049/how-to-specify-encoding-bitrate-while-capturing-from-a-webcam-ms-expression-en

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!