fix: re-release v1.1.1 mic capture + hud position

This commit is contained in:
webadderall
2026-03-18 21:00:39 +11:00
parent 15e5c777f0
commit ab1a163281
4 changed files with 53 additions and 15 deletions
+51 -13
View File
@@ -1113,25 +1113,63 @@ function waitForNativeCaptureStop(process: ChildProcessWithoutNullStreams) {
})
}
async function fileHasAudioStream(filePath: string) {
const ffmpegPath = getFfmpegBinaryPath()
try {
await execFileAsync(
ffmpegPath,
['-i', filePath],
{ timeout: 30000, maxBuffer: 10 * 1024 * 1024 },
)
} catch (error) {
const stderr = typeof error === 'object' && error !== null && 'stderr' in error
? String((error as { stderr?: unknown }).stderr ?? '')
: ''
if (stderr) {
return /Audio:/i.test(stderr)
}
}
return false
}
async function mixNativeMacAudioTracks(videoPath: string, microphonePath: string) {
const ffmpegPath = getFfmpegBinaryPath()
const mixedOutputPath = `${videoPath}.mixed.mp4`
const videoHasAudio = await fileHasAudioStream(videoPath)
const args = videoHasAudio
? [
'-y',
'-i', videoPath,
'-i', microphonePath,
'-filter_complex', '[0:a][1:a]amix=inputs=2:duration=longest:normalize=0[aout]',
'-map', '0:v:0',
'-map', '[aout]',
'-c:v', 'copy',
'-c:a', 'aac',
'-b:a', '192k',
'-shortest',
mixedOutputPath,
]
: [
'-y',
'-i', videoPath,
'-i', microphonePath,
'-map', '0:v:0',
'-map', '1:a:0',
'-c:v', 'copy',
'-c:a', 'aac',
'-b:a', '192k',
'-shortest',
mixedOutputPath,
]
await execFileAsync(
ffmpegPath,
[
'-y',
'-i', videoPath,
'-i', microphonePath,
'-filter_complex', '[0:a][1:a]amix=inputs=2:duration=longest:normalize=0[aout]',
'-map', '0:v:0',
'-map', '[aout]',
'-c:v', 'copy',
'-c:a', 'aac',
'-b:a', '192k',
'-shortest',
mixedOutputPath,
],
args,
{ timeout: 120000, maxBuffer: 10 * 1024 * 1024 },
)
@@ -82,7 +82,7 @@ final class ScreenCaptureRecorder: NSObject, SCStreamOutput, SCStreamDelegate {
streamConfig.queueDepth = 6
streamConfig.pixelFormat = kCVPixelFormatType_32BGRA
streamConfig.showsCursor = false
streamConfig.capturesAudio = capturesSystemAudio
streamConfig.capturesAudio = capturesSystemAudio || capturesMicrophone
streamConfig.sampleRate = 48000
streamConfig.channelCount = 2
streamConfig.excludesCurrentProcessAudio = true
+1 -1
View File
@@ -22,7 +22,7 @@ let hudOverlayCaptureProtectionLoaded = false;
let countdownWindow: BrowserWindow | null = null;
const HUD_OVERLAY_SETTINGS_FILE = path.join(app.getPath("userData"), "hud-overlay-settings.json");
const HUD_BOTTOM_CLEARANCE_CM = 7;
const HUD_BOTTOM_CLEARANCE_CM = 3.5;
const DIP_PER_INCH = 96;
const CM_PER_INCH = 2.54;
const HUD_EDGE_MARGIN_DIP = 16;