Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert video path to nsdata?

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?

like image 736
Rinju Jain Avatar asked Nov 29 '22 02:11

Rinju Jain


2 Answers

Use this:

NSData *videoData = [NSData dataWithContentsOfFile:strURL];
like image 121
Paresh Navadiya Avatar answered Dec 17 '22 15:12

Paresh Navadiya


NSString *filPath=@"file_url";
NSData *dt=[NSData dataWithContentsOfURL:[NSURL URLWithString:filePath]];
like image 20
Anand Kr. Avasthi Avatar answered Dec 17 '22 15:12

Anand Kr. Avasthi