From 7263f2d837b48358cd67956cd40cd28a1aaf7dff Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 29 Jun 2026 23:51:19 +0800 Subject: [PATCH] fix: re-encode audio to AAC instead of copy for mp4 compatibility -c copy may produce mp4 files with AC3/DTS/FLAC audio that macOS AVPlayer cannot decode, resulting in silent playback. Change to -c:v copy -c:a aac -b:a 192k to preserve video quality while ensuring universally playable audio. --- Sources/StreamRecorderKit/FFmpegRecorder.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/StreamRecorderKit/FFmpegRecorder.swift b/Sources/StreamRecorderKit/FFmpegRecorder.swift index a02c2b5..2481e36 100644 --- a/Sources/StreamRecorderKit/FFmpegRecorder.swift +++ b/Sources/StreamRecorderKit/FFmpegRecorder.swift @@ -56,7 +56,9 @@ public final class FFmpegRecorder: StreamRecorderEngine { args += ["-t", String(duration)] } args += [ - "-c", "copy", + "-c:v", "copy", + "-c:a", "aac", + "-b:a", "192k", "-movflags", "+faststart", outputPath ]