Closed SeptJY closed 8 years ago
I'm not sure what you're asking here. Are you saying that your video is recording at 640x480? Make sure that you aren't setting your movie write to only output at that resolution.
I use GPUImage set 640x480, 1280x720, 1920x1080, 3840x2160 resolution recorded 10 seconds of video memory occupied by the same size, the video bit rate is the same @BradLarson
NSDictionary *videoCleanApertureSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:videoSize.width], AVVideoCleanApertureWidthKey, [NSNumber numberWithInt:videoSize.height], AVVideoCleanApertureHeightKey, [NSNumber numberWithInt:0], AVVideoCleanApertureHorizontalOffsetKey, [NSNumber numberWithInt:0], AVVideoCleanApertureVerticalOffsetKey, nil];
NSDictionary *videoAspectRatioSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:3], AVVideoPixelAspectRatioHorizontalSpacingKey,
[NSNumber numberWithInt:3], AVVideoPixelAspectRatioVerticalSpacingKey,
nil];
NSMutableDictionary * compressionProperties = [[NSMutableDictionary alloc] init];
[compressionProperties setObject:AVVideoCodecH264 forKey:AVVideoCodecKey];
[compressionProperties setObject:[NSNumber numberWithInt:videoSize.width] forKey:AVVideoWidthKey];
[compressionProperties setObject:[NSNumber numberWithInt:videoSize.height] forKey:AVVideoHeightKey];
[compressionProperties setObject:videoCleanApertureSettings forKey:AVVideoCleanApertureKey];
[compressionProperties setObject:videoAspectRatioSettings forKey:AVVideoPixelAspectRatioKey];
[compressionProperties setObject:[NSNumber numberWithInt: 2000000] forKey:AVVideoAverageBitRateKey];
[compressionProperties setObject:[NSNumber numberWithInt: 16] forKey:AVVideoMaxKeyFrameIntervalKey];
[compressionProperties setObject:AVVideoProfileLevelH264Main31 forKey:AVVideoProfileLevelKey];
[outputSettings setObject:compressionProperties forKey:AVVideoCompressionPropertiesKey];
This section of the GPUImageMovieWriter.m file in the code of the notes I simply studied, this is the set of video bit rate? Can use this to set the video bit rate @BradLarson
Where's the code for where you initialize your GPUImageMovieWriter? You have to set size as one of its parameters, so are you setting the size to something other than 640x480?
(void)cameraManagerEffectqualityWithTag:(NSInteger)tag withBlock:(CanSetSessionPreset)canSetSessionPreset { NSError *error = nil;
AVCaptureDevice videoDevice = [JYCameraManager deviceWithMediaType:AVMediaTypeVideo preferringPosition:AVCaptureDevicePositionBack]; AVCaptureDeviceInput videoDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error];
if ( ! videoDeviceInput ) { NSLog( @"Could not create video device input: %@", error ); }
[self.captureSession beginConfiguration];
NSString *sessionPreset = nil;
switch (tag) {
} if ([self.captureSession canSetSessionPreset:sessionPreset]) { [self setCaptureSessionPreset:sessionPreset];
} else{ canSetSessionPreset(NO); }
if ( [self.captureSession canAddInput:videoDeviceInput] ) { [self.captureSession addInput:videoDeviceInput]; videoInput = videoDeviceInput; }
[self.captureSession commitConfiguration]; // }); }
I set the video resolution by this way, set up the effect is there, but in the same time to save the video with the same time the size of the resolution is indeed different, it seems that only the resolution of 640x480