Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:51:37+00:00 2026-06-15T18:51:37+00:00

I have captured a video using objective c,however I am not able to save

  • 0

I have captured a video using objective c,however I am not able to save it in the iphone photos library.I dont want to use the AlAssets library,I want to use the image picker only.I have seen a lot of methods on stack overflow and other sites but they either use storage location path(which is not mentioned what it is) or they dont work.
This is my piece of code.

-(IBAction)Onclick:(id)sender
{
    UIImagePickerController *imagePicker = [[UIImagePickerController

                                             alloc] init];
    imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
    imagePicker.mediaTypes =  [NSArray arrayWithObject:(NSString *)

                               kUTTypeMovie];
    imagePicker.delegate = self;
    //UISaveVideoAtPath
    imagePicker.allowsImageEditing = NO;
    [self.view addSubview:imagePicker.view];
    [imagePicker viewWillAppear:YES];

    CGRect overlayFrame = CGRectMake(0, 380, 320, 44);
    //UILabel *lbl=[[UILabel alloc]init];
    UIView *baseView = [[[UIView alloc] init] autorelease];
    baseView.backgroundColor =[UIColor greenColor];
    //lbl.text=@"dfgfdgfd";
    baseView.frame=overlayFrame;
    //view.delegate = self;
    //view.picker = picker;
    //[view customize];
    imagePicker.cameraOverlayView = baseView;


    [self presentModalViewController:imagePicker animated:YES]; 


}


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


    NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];

    if ([mediaType isEqualToString:@"public.image"]){
        UIImage *picture = [info objectForKey:UIImagePickerControllerOriginalImage];
        UIImageWriteToSavedPhotosAlbum(picture, nil, nil, nil);
    }
    else if ([mediaType isEqualToString:@"public.movie"]){

        NSURL *url = [[[info objectForKey:UIImagePickerControllerMediaURL] copy] autorelease];

//        ALAssetsLibrary* library = [[[ALAssetsLibrary alloc] init] autorelease];
//        [library writeVideoAtPathToSavedPhotosAlbum:url
//                                    completionBlock:^(NSURL *assetURL, NSError *error){/*notify of completion*/}];
UISaveVideoAtPathToSavedPhotosAlbum(url, nil, nil, nil);
    }

    [self dismissModalViewControllerAnimated:YES];

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:51:38+00:00Added an answer on June 15, 2026 at 6:51 pm

    Try this:

    - (void) imagePickerController: (UIImagePickerController *) picker
     didFinishPickingMediaWithInfo: (NSDictionary *) info
    {
            NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
    
             [self dismissViewControllerAnimated:YES completion:nil];
    
            // Handle a movie capture
            if (CFStringCompare (( CFStringRef) mediaType, kUTTypeMovie, 0)
                == kCFCompareEqualTo)
            {
    
                NSString *moviePath = [[info objectForKey:
                                        UIImagePickerControllerMediaURL] path];
                if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath))
                {
                    UISaveVideoAtPathToSavedPhotosAlbum (moviePath,self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
                }
    
    
            }
        }
    }
    - (void)video:(NSString*)videoPath didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo
    {
        if (error)
        {
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Photo/Video Saving Failed"  delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil, nil];
            [alert show];
        }
        else
        {
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Photo/Video Saved" message:@"Saved To Photo Album"  delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil];
            [alert show];
        }
    }
    

    Hope it helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to take an image that i have already captured
I have one audio file captured from my iphone. I want to upload this
In my application, I have a preview option to show video captured in iPhone(camera),
How can you capture Video using Java ? You have to use JMF ?
I have created a FLV video player using the AS3 flash.media.Video object (not the
I have an Application in that I want to capture video using Surfaceview and
I am trying to implement video capture in my app using AVFoundation. I have
You captured a video of a moving car using your camera equipped in a
I'm new here. I have been trying to create a video capture app using
I have a video stream coming in on rtp to ffmpeg and I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.