views:

36

answers:

1

Hi Guys,

Thanks to all for responding to the questions which I Posted.

I got one problem that is, While capturing the video in the iPhone, I don't know how to store the time period (duration) that I captured video with iPhone. Can any one solve my problem.

I am using the following code for capturing. -(void) RecordVideoWithCamera { printf("\n Hai I am in record vedio with camera -============"); [self startCameraPickerFromViewController:self usingDelegate:self]; }

  • (BOOL)startCameraPickerFromViewController:(UIViewController*)controller usingDelegate:(id)delegateObject
    {

    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[[UIImagePickerController alloc] init]autorelease]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie]; picker.delegate = self; picker.showsCameraControls=YES; picker.allowsEditing = NO; UIView *overlayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; picker.cameraOverlayView = overlayView; [controller presentModalViewController:picker animated:YES]; } return YES;
    }

Thanking you, Madan Mohan.

A: 

I think you should check CMTime struct.

Steve
I didn't get, Is there any sample code to use it. Please provide more details.
Madan Mohan
Sorry for my previous post, it was wrong. About your problem. I dont know any property or method of UIImagePickerController that return duration of currently recording video, I think you could implement it yourself with NSTimer, start it when you start recording and increment time variable in its selector.
Steve
Is there any other way instead of NSTimer?
Madan Mohan