node-mac-recorder 2.23.1 → 2.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ static int64_t g_avFrameNumber = 0;
|
|
|
25
25
|
static CMTime g_avStartTime;
|
|
26
26
|
static void* g_avAudioRecorder = nil;
|
|
27
27
|
static NSString* g_avAudioOutputPath = nil;
|
|
28
|
-
static const NSInteger kAVFoundationHighQualityVideoBitrate =
|
|
28
|
+
static const NSInteger kAVFoundationHighQualityVideoBitrate = 100 * 1000 * 1000;
|
|
29
29
|
|
|
30
30
|
// AVFoundation screen recording implementation
|
|
31
31
|
extern "C" bool startAVFoundationRecording(const std::string& outputPath,
|
|
@@ -158,6 +158,14 @@ extern "C" bool startAVFoundationRecording(const std::string& outputPath,
|
|
|
158
158
|
bitrate = MAX(bitrate, minBitrate);
|
|
159
159
|
bitrate = MIN(bitrate, maxBitrate);
|
|
160
160
|
qualityHint = @0.9;
|
|
161
|
+
} else { // high - çözünürlüğe DUYARLI yüksek kalite (eski sabit 50 Mbps yerine)
|
|
162
|
+
NSInteger multiplier = 32; // ~0.53 bpp @60fps
|
|
163
|
+
NSInteger minBitrate = kAVFoundationHighQualityVideoBitrate; // 100 Mbps taban
|
|
164
|
+
NSInteger maxBitrate = 200 * 1000 * 1000; // 200 Mbps tavan
|
|
165
|
+
bitrate = (NSInteger)(recordingSize.width * recordingSize.height * multiplier);
|
|
166
|
+
bitrate = MAX(bitrate, minBitrate);
|
|
167
|
+
bitrate = MIN(bitrate, maxBitrate);
|
|
168
|
+
qualityHint = @1.0;
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
MRLog(@"🎬 AVFoundation encoder (%@): %dx%d, codec=H.264 High Profile, bitrate=%.2fMbps",
|
|
@@ -165,7 +165,7 @@ static NSInteger g_targetFPS = 60;
|
|
|
165
165
|
static NSString *g_qualityPreset = @"high";
|
|
166
166
|
static NSInteger g_frameCount = 0;
|
|
167
167
|
static CFAbsoluteTime g_firstFrameTime = 0;
|
|
168
|
-
static const NSInteger kSCKHighQualityVideoBitrate =
|
|
168
|
+
static const NSInteger kSCKHighQualityVideoBitrate = 100 * 1000 * 1000;
|
|
169
169
|
|
|
170
170
|
// Quality helpers
|
|
171
171
|
static NSString *SCKNormalizeQualityPreset(id preset) {
|
|
@@ -214,10 +214,12 @@ static void SCKQualityBitrateForDimensions(NSString *preset,
|
|
|
214
214
|
multiplier = 18;
|
|
215
215
|
minBitrate = 18 * 1000 * 1000;
|
|
216
216
|
maxBitrate = 80 * 1000 * 1000;
|
|
217
|
-
} else { // high/default -
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
} else { // high/default - çözünürlüğe DUYARLI yüksek kalite
|
|
218
|
+
// Eski hali sabit 50 Mbps idi: Retina/4K kayıtta çok düşük (hatta medium
|
|
219
|
+
// yüksek çözünürlükte high'ı geçebiliyordu). Artık çözünürlükle ölçeklenir.
|
|
220
|
+
multiplier = 32; // ~0.53 bpp @60fps
|
|
221
|
+
minBitrate = kSCKHighQualityVideoBitrate; // 100 Mbps taban
|
|
222
|
+
maxBitrate = 200 * 1000 * 1000; // 200 Mbps tavan (realtime güvenli)
|
|
221
223
|
}
|
|
222
224
|
|
|
223
225
|
double base = ((double)MAX(1, width)) * ((double)MAX(1, height)) * (double)multiplier;
|
|
@@ -805,10 +807,21 @@ extern "C" NSString *ScreenCaptureKitCurrentAudioPath(void) {
|
|
|
805
807
|
AVVideoMaxKeyFrameIntervalDurationKey: @(1.0)
|
|
806
808
|
};
|
|
807
809
|
|
|
810
|
+
// Renk etiketleri: kayıt sRGB uzayında yakalanıyor (streamConfig.colorSpaceName),
|
|
811
|
+
// BT.709 olarak etiketle ki Chromium/QuickTime decode'da doğru yorumlasın.
|
|
812
|
+
// Etiket olmadan player'lar tahmin yürütüyor ve renkler soluk/kaymış görünüyordu.
|
|
813
|
+
// Bitrate/boyut maliyeti sıfırdır.
|
|
814
|
+
NSDictionary *colorProps = @{
|
|
815
|
+
AVVideoColorPrimariesKey: AVVideoColorPrimaries_ITU_R_709_2,
|
|
816
|
+
AVVideoTransferFunctionKey: AVVideoTransferFunction_ITU_R_709_2,
|
|
817
|
+
AVVideoYCbCrMatrixKey: AVVideoYCbCrMatrix_ITU_R_709_2
|
|
818
|
+
};
|
|
819
|
+
|
|
808
820
|
NSDictionary *videoSettings = @{
|
|
809
821
|
AVVideoCodecKey: AVVideoCodecTypeH264,
|
|
810
822
|
AVVideoWidthKey: @(width),
|
|
811
823
|
AVVideoHeightKey: @(height),
|
|
824
|
+
AVVideoColorPropertiesKey: colorProps,
|
|
812
825
|
AVVideoCompressionPropertiesKey: compressionProps
|
|
813
826
|
};
|
|
814
827
|
|
|
@@ -1534,6 +1547,12 @@ static void SCKPerformRecordingSetup(NSDictionary *config, SCShareableContent *c
|
|
|
1534
1547
|
streamConfig.shouldBeOpaque = YES;
|
|
1535
1548
|
MRLog(@"🎯 Using SCCaptureResolutionBest + shouldBeOpaque for maximum quality (macOS 14+)");
|
|
1536
1549
|
}
|
|
1550
|
+
if (@available(macOS 13.0, *)) {
|
|
1551
|
+
// Frame'leri bilinen bir renk uzayında (sRGB) iste; encoder tarafında
|
|
1552
|
+
// BT.709 etiketiyle birlikte uçtan uca tutarlı renk sağlar.
|
|
1553
|
+
// Aksi halde P3 ekranlarda display-native, etiketsiz piksel gelir.
|
|
1554
|
+
streamConfig.colorSpaceName = kCGColorSpaceSRGB;
|
|
1555
|
+
}
|
|
1537
1556
|
|
|
1538
1557
|
BOOL shouldCaptureMic = includeMicrophone ? [includeMicrophone boolValue] : NO;
|
|
1539
1558
|
BOOL shouldCaptureSystemAudio = includeSystemAudio ? [includeSystemAudio boolValue] : NO;
|