2011-04-20 118 views
1

喂,如何将视频从应用程序文档目录移至相机胶卷?

我已经找到了一些节约iphone摄像头,视频avfoundation代码示例 过网(也IM试着写我自己的代码,但没有完成它尚未)

这样的例子工艺和不要从相机捕获输入保存的视频(通过AVAssetWriter) 到文件位于documments目录

但现在(我假设是唯一的选择吗?) - 我不甚至可以看到在这样的目录中的文件来检查如果我的视频在那里,则为 ;我想我应该将这样的视频文件移动到 '相机胶卷',该怎么做?

TNX

回答

1

传输至相机罗尔 - 这里有一个link,应该帮助。

,看看有什么在你的文档目录,这里的代码片段:

-(void) dump { 

    NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"]; 
    NSFileManager *localFileManager = [NSFileManager defaultManager]; 
    NSDirectoryEnumerator *dirEnum = 
     [localFileManager enumeratorAtPath:docsDir]; 
    NSError *error=nil; 

    NSLog(@" Documents Directory: %@", docsDir); 
    NSString *file; 
    while (file = [dirEnum nextObject]) { 
     NSString *fullPath = [NSString stringWithFormat:@"%@/%@", docsDir,file]; 
     NSDictionary *attrs = [localFileManager attributesOfItemAtPath:fullPath error:&error]; 
     if (error) { 
      NSLog(@" error - %@", error); 
     } else { 
      //NSLog(@" file : %@", file); 
      NSInteger fsiz = [attrs fileSize]; 
      NSString *ftyp = [attrs fileType]; 
      NSDate *fmod = [attrs fileModificationDate]; 
      NSLog(@" %9d : %@ : %@ : %@", fsiz, file, ftyp, fmod); 
     } 
    } 
    NSLog(@" ====== End Documents Directory ========"); 
    } 
+1

TNX恩你,特别是对于片段 - 这将是更有益的 - 在链接它是关于图像没有视频,[但确实现在我有UISaveVideoAtPathToSavedPhotosAlbum - 如果它的工作,这是我需要:)] – 2011-04-20 15:02:52

+0

(由于引用nabokov,我是('我是')'高级'nabokov学者) – 2011-04-20 17:41:38

+0

我几乎不知道关于纳博科夫,除了报价,这对我来说很有意义。 – Rayfleck 2011-04-20 18:07:27

相关问题