4

i record the video in my i pad application and then get the path which is save in my ipad

 /private/var/mobile/Applications/F1F1F9A4-41FB-4E80-9070-4A9EC8BA8823/tmp/capture-T0x24ae10.tmp.ND2S7e/capturedvideo.MOV

i also find this file my organizer. now i want to convert to this file path into NSData. how i do it?

Rinju Jain
  • 1,694
  • 1
  • 14
  • 23

3 Answers3

16

Use this:

NSData *videoData = [NSData dataWithContentsOfFile:strURL];
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
4
NSString *filPath=@"file_url";
NSData *dt=[NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]];
piet.t
  • 11,718
  • 21
  • 43
  • 52
2

i had also same problem

NSString *filePath1 = [[NSBundle mainBundle] pathForResource:@"Waterfall_h264" ofType:@"mov"];
NSError *error = nil;
NSData *data1 = [NSData dataWithContentsOfFile:filePath1 options:nil error:&error];

also i think you may not include video file into link library. goto: target section -> Build Phases tab -> compile sources -> click on + button -> select your video file -> clcik on add button.

now try again...hope this will be useful...:)

Amit Bhatiya
  • 2,621
  • 1
  • 12
  • 20
asheesh Verma
  • 404
  • 6
  • 17