ScreenRecorderLib
ScreenRecorderLib copied to clipboard
Recording get skinny and distorted pixels
When starting the application recording on resolution 500*500 then resizing the application then resolution gets distorted.
I tried with this code but no success private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { var a = e.NewSize; ScreenSize screenSize = new ScreenSize(a.Width, a.Height); if (recorder?.Status == RecorderStatus.Recording) { recorder?.GetDynamicOptionsBuilder() .SetDynamicOutputOptions(new DynamicOutputOptions { VideoFramePreviewSize = screenSize }) .Apply(); } }
And this is my options: IVideoEncoder videoEncoder = new H265VideoEncoder { BitrateMode = H265BitrateControlMode.Quality, EncoderProfile = H265Profile.Main }; //IntPtr windowHandle = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; //sources.Add(new WindowRecordingSource(windowHandle)); ScreenSize screenSize = new ScreenSize(1920, 1080); RecorderOptions options = new RecorderOptions { SourceOptions = new SourceOptions { RecordingSources = sources
},
VideoEncoderOptions = new VideoEncoderOptions
{
Framerate = 10,
Encoder= videoEncoder,
IsFixedFramerate = false,
IsHardwareEncodingEnabled = true,
Quality = 70,
},
OutputOptions = new OutputOptions
{
RecorderMode = RecorderMode.Video,
OutputFrameSize = screenSize,
Stretch = StretchMode.Uniform,
VideoFramePreviewSize = new ScreenSize(0, 150)
}
};
@sskodje pls help me in this as I am stuck