简体   繁体   English

从NSDocument目录在iOS中拆分视频

[英]Split video in iOS from NSDocument directory

I'm trying to read a video from NSDocument Directory and split it to 1 minute. 我正在尝试从NSDocument目录中读取视频并将其拆分为1分钟。 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. 我一直在尝试使用ALAssetsLibrary,但由于无法获取NSDocuments Directory中存储的视频的ReferenceURL,因此无法使用它。

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];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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