I am currently recording video using AVFoundation api and have specified a fileUrl to write to:
NSURL *fileUrl = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), @"output.mov"]];
However, right now its recording to a temp directory. How do i write this file to the camera roll? Whats the camera roll directory?
Thanks!
After recording to the disk do the following to copy the video to Camera Roll
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(outFileName)) {
UISaveVideoAtPathToSavedPhotosAlbum(outFileName, self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
}
Note that UIVideoAtPathIsCompatibleWithSavedPhotosAlbum() will be successful only of the recorded video is proper QuickTIme format.
我从AVCamDemo代码在Apple网站上找到了一些文档。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.