0

Iam using UIImagePicker to record video when i click the record button i want to capture the frame with sound and add it into one array .Please help me to accomplish the same thanks in advance .

naveen
  • 69
  • 7

1 Answers1

0

try this sample code for record videos in frame

customphotoalbum

Edit

    - (void)video:(NSString*)videoPath didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo {
        NSLog(@"%@",contextInfo);
        if (error) {
        }else{        
            NSURL *videoURl = [NSURL fileURLWithPath:videoPath];
            AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURl options:nil];
            AVAssetImageGenerator *generate = [[AVAssetImageGenerator alloc] initWithAsset:asset];
            generate.appliesPreferredTrackTransform = YES;
            NSError *err = NULL;
            CMTime time = CMTimeMake(1, 60);// heare you can set more then one image time
            CGImageRef imgRef = [generate copyCGImageAtTime:time actualTime:NULL error:&err];

            self.strUploadVideoURL = videoPath;
            self.strOriginalVideoURL = videoPath;

            UIImage *img = [[UIImage alloc] initWithCGImage:imgRef];
             // use this image to add in array.
        }
    }
SAMIR RATHOD
  • 3,512
  • 1
  • 20
  • 45