Skip to content

Open source CapCut alternative.

TypeScript

fix(app): record screen with HEVC at 30fps to match QuickTime size and quality [rebuild]

David Lebb3ad2f90b39
diff --git a/apps/Donkey/Sources/DonkeyRuntime/SCRecordingScreenRecorder.swift b/apps/Donkey/Sources/DonkeyRuntime/SCRecordingScreenRecorder.swift
index d22d73d5..036a9550 100644
--- a/apps/Donkey/Sources/DonkeyRuntime/SCRecordingScreenRecorder.swift
+++ b/apps/Donkey/Sources/DonkeyRuntime/SCRecordingScreenRecorder.swift
@@ -66,7 +66,11 @@ public final class SCRecordingScreenRecorder: ScreenRecording {
let recordingConfig = SCRecordingOutputConfiguration()
recordingConfig.outputURL = configuration.outputURL
recordingConfig.outputFileType = .mov
- recordingConfig.videoCodecType = .h264
+ // HEVC is ~2x more efficient than H.264 for screen content and is what QuickTime records — half
+ // the file at equal or better quality. Every macOS 15 Mac has a hardware HEVC encoder; fall back
+ // to H.264 only if the encoder can't offer HEVC for this container.
+ recordingConfig.videoCodecType =
+ recordingConfig.availableVideoCodecTypes.contains(.hevc) ? .hevc : .h264
let delegate = RecorderDelegate()
delegate.owner = self
diff --git a/apps/Donkey/Sources/DonkeyRuntime/ScreenRecorder.swift b/apps/Donkey/Sources/DonkeyRuntime/ScreenRecorder.swift
index 292eb062..e06fe015 100644
--- a/apps/Donkey/Sources/DonkeyRuntime/ScreenRecorder.swift
+++ b/apps/Donkey/Sources/DonkeyRuntime/ScreenRecorder.swift
@@ -29,7 +29,7 @@ public struct ScreenRecordingConfiguration: Sendable {
capturesMicrophone: Bool = false,
microphoneDeviceID: String? = nil,
showsCursor: Bool = true,
- frameRate: Int = 60,
+ frameRate: Int = 30,
excludedWindowIDs: [CGWindowID] = [],
outputURL: URL
) {