rFlex / SCRecorder

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
Apache License 2.0
3.06k stars 583 forks source link

trying to export video with file url #402

Open razan1994alali opened 7 years ago

razan1994alali commented 7 years ago

I want to add filter to an existing video I used the SCRecorder and instead of:

[_player setItemByAsset:_recordSession.assetRepresentingSegments];

I used :

[_player setItemByUrl: videoURL];

the problem is when I'm trying to export the video this error occurs:

Error: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo={NSLocalizedDescription=The requested URL was not found on this server., NSErrorFailingURLStringKey=file:///var/mobile/Containers/Data/Application/35B1F4D9-6EE2-40DE-9745-F2DB2030DB41/Documents/1498123324.mov, NSErrorFailingURLKey=file:///var/mobile/Containers/Data/Application/35B1F4D9-6EE2-40DE-9745-F2DB2030DB41/Documents/1498123324.mov, NSURL=file:///var/mobile/Containers/Data/Application/35B1F4D9-6EE2-40DE-9745-F2DB2030DB41/Documents/1498123324.mov, NSUnderlyingError=0x174252ff0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

to export the file I used this code :

how can I solve this error? thank you in advance.

razan1994alali commented 7 years ago

Solved by using a new url for exportSession.outputUrl:

NSURL *urlFile = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@.mov",docsDir,fileName]]; exportSession.outputUrl = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@",urlFile]];