- (BOOL)setupAVCapture
{
NSError *error = nil;
frameDuration = CMTimeMakeWithSeconds(1./5., 90000);
AVCaptureSession *session = [AVCaptureSession new];
[session setSessionPreset:AVCaptureSessionPresetHigh];
这是我的Xcode项目的.m文件。有人可以告诉我,如果有一种方法来使用UIpickerView或任何方式,以便在运行应用程序时我可以将“5”更改为不同的数字,以便增加每秒帧数。拜托,我看了,在任何地方都没有答案。
---- UIPICKERVIEW CODE--
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, pickerView.frame.size.width, 33)];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.font = [UIFont fontWithName:@"HelveticaNeue-bold" size:36];
label.text = [NSString stringWithFormat:@" %ld", row+1];
return label;
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
return 1;
}
-(NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return [_list count];
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [_list objectAtIndex:row];
}
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
NSString *string = [NSString stringWithFormat:@"Fps:%@", [_list objectAtIndex:row]];
_pickerLabel.text = string;
}
-(void)Viewdidload
_list = [[NSMutableArray alloc] init];
[_list addObject:@" 1"];
[_list addObject:@" 2"];
[_list addObject:@" 3"];
[_list addObject:@" 4"];
[_list addObject:@" 5"];
[_list addObject:@" 6"];
[_list addObject:@" 7"];
[_list addObject:@" 8"];
[_list addObject:@" 9"];
----------帧-----
NSError *error = nil;
frameDuration = CMTimeMakeWithSeconds(1./5., 90000);