简体   繁体   中英

Split video in iOS from NSDocument directory

I'm trying to read a video from NSDocument Directory and split it to 1 minute. I've been trying to use ALAssetsLibrary but not able to work with that as I do not get ReferenceURL for the video stored in NSDocuments Directory.

Can anyone suggest me a workaround for this?

Thanks a ton in advance

with the use of this code you'll be able to find your video url

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *tempPath = [documentsDirectory stringByAppendingFormat:@"/vid1.mp4"];
NSURL *url = [NSURL fileURLWithPath:tempPath];

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM