mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-29 17:02:05 +13:00
Fixed audio recording sync issues
This commit is contained in:
parent
99d8e5b964
commit
691c9011bc
1 changed files with 10 additions and 10 deletions
|
@ -101,6 +101,12 @@ public string GetFFmpegArgs(bool isCustom = false)
|
|||
{
|
||||
if (FFmpeg.VideoSource.Equals(FFmpegCaptureDevice.GDIGrab.Value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (FFmpeg.IsAudioSourceSelected)
|
||||
{
|
||||
AppendInputDevice(args, "dshow", true);
|
||||
args.Append($"-i audio={Helpers.EscapeCLIText(FFmpeg.AudioSource)} ");
|
||||
}
|
||||
|
||||
string x = isCustom ? "$area_x$" : CaptureArea.X.ToString();
|
||||
string y = isCustom ? "$area_y$" : CaptureArea.Y.ToString();
|
||||
string width = isCustom ? "$area_width$" : CaptureArea.Width.ToString();
|
||||
|
@ -115,15 +121,15 @@ public string GetFFmpegArgs(bool isCustom = false)
|
|||
args.Append($"-video_size {width}x{height} ");
|
||||
args.Append($"-draw_mouse {cursor} ");
|
||||
args.Append("-i desktop ");
|
||||
|
||||
}
|
||||
else if (FFmpeg.VideoSource.Equals(FFmpegCaptureDevice.DDAGrab.Value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (FFmpeg.IsAudioSourceSelected)
|
||||
{
|
||||
AppendInputDevice(args, "dshow", true);
|
||||
args.Append($"-i audio={Helpers.EscapeCLIText(FFmpeg.AudioSource)} ");
|
||||
}
|
||||
}
|
||||
else if (FFmpeg.VideoSource.Equals(FFmpegCaptureDevice.DDAGrab.Value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Screen[] screens = Screen.AllScreens.OrderBy(x => !x.Primary).ToArray();
|
||||
int monitorIndex = 0;
|
||||
Rectangle captureArea = screens[0].Bounds;
|
||||
|
@ -167,12 +173,6 @@ public string GetFFmpegArgs(bool isCustom = false)
|
|||
}
|
||||
|
||||
args.Append(" ");
|
||||
|
||||
if (FFmpeg.IsAudioSourceSelected)
|
||||
{
|
||||
AppendInputDevice(args, "dshow", true);
|
||||
args.Append($"-i audio={Helpers.EscapeCLIText(FFmpeg.AudioSource)} ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue