Support audio recording with ddagrab

This commit is contained in:
Jaex 2023-07-23 17:38:52 +03:00
parent ea6640c27d
commit abae07ca7c

View file

@ -150,7 +150,7 @@ public string GetFFmpegArgs(bool isCustom = false)
}
// https://ffmpeg.org/ffmpeg-filters.html#ddagrab
AppendInputDevice(args, "lavfi", FFmpeg.IsAudioSourceSelected);
AppendInputDevice(args, "lavfi", false);
args.Append("-i ddagrab=");
args.Append($"output_idx={monitorIndex}:"); // DXGI Output Index to capture.
args.Append($"draw_mouse={DrawCursor.ToString().ToLowerInvariant()}:"); // Whether to draw the mouse cursor.
@ -167,6 +167,12 @@ public string GetFFmpegArgs(bool isCustom = false)
}
args.Append(" ");
if (FFmpeg.IsAudioSourceSelected)
{
AppendInputDevice(args, "dshow", true);
args.Append($"-i audio={Helpers.EscapeCLIText(FFmpeg.AudioSource)} ");
}
}
else
{