Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

stop using photo, it is actually lower res

rorycleardd98b4fc5e9f
diff --git a/clearcam/ViewController.m b/clearcam/ViewController.m
index 11c9fde..81eea79 100644
--- a/clearcam/ViewController.m
+++ b/clearcam/ViewController.m
@@ -129,7 +129,7 @@ NSMutableDictionary *classColorMap;
- (void)setupCamera {
self.captureSession = [[AVCaptureSession alloc] init];
- self.captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
+ self.captureSession.sessionPreset = AVCaptureSessionPreset1920x1080;
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
NSError *error = nil;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
@@ -190,7 +190,7 @@ NSMutableDictionary *classColorMap;
NSDictionary *videoSettings = @{
AVVideoCodecKey: AVVideoCodecTypeH264,
AVVideoWidthKey: @1280,
- AVVideoHeightKey: @960,
+ AVVideoHeightKey: @720,
AVVideoScalingModeKey: AVVideoScalingModeResizeAspectFill
};
self.videoWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings];
@@ -205,7 +205,7 @@ NSMutableDictionary *classColorMap;
NSDictionary *sourcePixelBufferAttributes = @{
(NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA),
(NSString *)kCVPixelBufferWidthKey: @1280,
- (NSString *)kCVPixelBufferHeightKey: @960
+ (NSString *)kCVPixelBufferHeightKey: @720
};
self.adaptor = [AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:self.videoWriterInput sourcePixelBufferAttributes:sourcePixelBufferAttributes];
@@ -587,8 +587,8 @@ NSMutableDictionary *classColorMap;
}
- (CVPixelBufferRef)addTimeStampToPixelBuffer:(CVPixelBufferRef)pixelBuffer{
- NSInteger pixelSize = 4;
- NSInteger spaceSize = 2;
+ NSInteger pixelSize = 6;
+ NSInteger spaceSize = 3;
NSInteger digitOriginX = spaceSize;
NSInteger digitOriginY = spaceSize;
NSInteger height = spaceSize*2 + pixelSize*5;
diff --git a/clearcam/player.html b/clearcam/player.html
index 07c46ea..7214155 100644
--- a/clearcam/player.html
+++ b/clearcam/player.html
@@ -9,7 +9,7 @@
width: 100%;
max-width: 640px; /* Default max-width for landscape */
background: black;
- aspect-ratio: 4 / 3; /* Default aspect ratio for landscape */
+ aspect-ratio: 16 / 9; /* Default aspect ratio for landscape */
overflow: hidden; /* Prevent overflow */
transition: max-width 0.3s ease-in-out, aspect-ratio 0.3s ease-in-out; /* Smooth transitions */
}
@@ -810,12 +810,12 @@
portrait = true;
// Portrait mode: set container to 480x640
videoContainer.style.maxWidth = '480px';
- videoContainer.style.aspectRatio = '3 / 4'; // 480:640 simplifies to 3:4
+ videoContainer.style.aspectRatio = '9 / 16'; // 480:640 simplifies to 3:4
} else {
portrait = false;
// Landscape mode: set container to 640x480
videoContainer.style.maxWidth = '640px';
- videoContainer.style.aspectRatio = '4 / 3'; // 640:480 simplifies to 4:3
+ videoContainer.style.aspectRatio = '16 / 9'; // 640:480 simplifies to 4:3
}
}