0
我注意到Exression Encoder 4的屏幕錄製有時比指定的短。例如。一個5分鐘的錄製只會產生15秒的視頻。這似乎與視頻同時捕獲的音頻有關。最初我使用耳機揚聲器作爲音頻配置文件。當我從錄音中刪除音頻時,問題停止了。當我將音頻配置文件更改爲標準揚聲器時,它也停止了。但是,當錄製開始時,我可以通過快速更改音量輕鬆地進行復制。結果是錄音凍結了......它仍然需要5分鐘才能錄製;但結果只有15秒左右(視頻)。Microsoft Expression Encoder。 ScreenCapture
代碼片段如下所示。
try
{
_screenCaptureJob = new ScreenCaptureJob();
_screenCaptureJob.CaptureRectangle = _screenRectangle;
_screenCaptureJob.ShowFlashingBoundary = true;
_screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
_screenCaptureJob.CaptureMouseCursor = false;
_screenCaptureJob.ScreenCaptureCommandFinished += new EventHandler<ScreenCaptureCommandFinishedEventArgs>(_screenCaptureJob_ScreenCaptureCommandFinished);
_screenCaptureJob.ScreenCaptureFinished += new EventHandler<ScreenCaptureEventArgs>(_screenCaptureJob_ScreenCaptureFinished);
Collection<EncoderDevice> audioDevices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);
try
{
EncoderDevice foundDevice = audioDevices.First(delegate(EncoderDevice item) { return item.Name.StartsWith(@"Speakers"); });
_screenCaptureJob.AddAudioDeviceSource(foundDevice);
}
catch (Exception ex)
{
_appLogger.Error(string.Format("RecordNextSegment. Cannot find prefered audio device using {0} !", audioDevices[0].Name), ex);
_screenCaptureJob.AddAudioDeviceSource(audioDevices[0]);
}
_currentDurationInSeconds = (_recordDurationInSeconds < _maxSegmentDurationInSeconds) ? _recordDurationInSeconds : _maxSegmentDurationInSeconds;
_screenCaptureJob.Duration = DateTimeUtilities.DurationToTimeSpan(_currentDurationInSeconds);
_screenCaptureJob.OutputScreenCaptureFileName = string.Format(@"{0}\{1}.wmv", _tvaConfiguration.TVAVideoDirectoryRawVideo, FileNameFromSegment(_segmentNumber));
_screenCaptureJob.Start();
LogInfo(string.Format("Remaining time (seconds): {0}. Current time: {1}. File: {2}", _recordDurationInSeconds, _currentDurationInSeconds, _screenCaptureJob.OutputScreenCaptureFileName));