How to convert video path to nsdata?

i record video in i-pad application and then get the path that is saved 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 path to the NSData file. how am i doing this

+4
source share
3 answers

Use this:

 NSData *videoData = [NSData dataWithContentsOfFile:strURL]; 
+14
source
 NSString * filPath=@ "file_url"; NSData *dt=[NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]]; 
+4
source

I had the same problem

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

I also think that you cannot include a video file in the link library. goto: target section“Phase Assembly” tabcompilation sourcesclick + → → select your video fileclcik on the add button .

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

+1
source

All Articles