tags:

views:

90

answers:

1

Hi,

I used the following code to record video.

    UIImagePickerController *m_objpicker;=[[UIImagePickerController alloc] init];
    m_objpicker.sourceType = UIImagePickerControllerSourceTypeCamera;           

    m_objpicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];

    // hide the camera controls
    //picker.showsCameraControls=NO;
    m_objpicker.delegate = self;
    //picker.allowsImageEditing = NO;
    m_objpicker.allowsEditing=NO;
    // and put our overlay view in
    //picker.cameraOverlayView=m_objOverlayView;
    [self presentModalViewController:m_objpicker animated:YES]; 

When we finish recording

  • (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{

    NSURL *m_objMediaURL=[info objectForKey:UIImagePickerControllerMediaURL];

    [m_objpicker dismissModalViewControllerAnimated:YES];

}

My doubt is, how to save the captured video to a location we specify. Also how to use UISaveVideoAtPathToSavedPhotosAlbum .

What all things i need to change in my code so that i can save video to a specified location

Thanks,

A: 

If you would like to save to the Camera Roll photos/videos album on the phone:

Definition: void UISaveVideoAtPathToSavedPhotosAlbum ( NSString *videoPath, id completionTarget, SEL completionSelector, void *contextInfo );

Where and how to execute it: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

{

.... code here .....

NSString* m_objMediaURL= [info objectForKey:UIImagePickerControllerMediaURL];

//remember to test that the video is compatible for saving to the photos album

UISaveVideoAtPathToSavedPhotosAlbum(m_objMediaURL, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);

.... code here .....

}

There is no control beyond saving this to the Camera Roll re: location unless you want to save to the application bundle which I do not recommend.

Lance
Please flag this as the correct answer: this place is give and take.
Lance