AVAssetExportSessionStatusFailed randomly to write the video - ios

I am creating the video from a set of images with AVAssetwriter and AVAssetExportSession and successfully getting the video and save it to the documents. But randomly the video exporting failed and it shows An Unknown error occured with error code -11800.
ExportSessionError: -11800 adn userinfo{
NSLocalizedDescription = "The operation could not be completed";
NSLocalizedFailureReason = "An unknown error occurred (-12124)";
NSUnderlyingError = "Error Domain=NSOSStatusErrorDomain Code=-12124 \"The operation couldn\U2019t be completed. (OSStatus error -12124.)\"";
This is the error console i got.. Please help me.. Thanks

Related

My app is collecting a lot of StoreKit underlyingErrors: AMSErrorDomain Code=305 Purchase Failed, what might be the reasons?

The issue occurs in production, couldn't reproduce it in Sandbox.
Full example of underlyingError I get:
Error Domain=SKErrorDomain
Code=0
"An unknown error occurred"
UserInfo={
NSLocalizedDescription=An unknown error occurred,
NSUnderlyingError=0x282db1230 {
Error Domain=ASDErrorDomain
Code=504
"The operation couldn’t be completed. (ASDErrorDomain error 504.)"
UserInfo={
NSLocalizedDescription=The operation couldn’t be completed. (ASDErrorDomain error 504.),
NSUnderlyingError=0x282db0780 {
Error Domain=AMSErrorDomain
Code=305
"Purchase Failed"
UserInfo={
NSLocalizedDescription=Purchase Failed,
NSLocalizedFailureReason=Server canceled the purchase
}
}
}
}
};
What might be the reasons for it? Is there really something I can do to resolve it?

How can I get this Fairplay HLS setup to work?

I'm running:
mediafilesegmenter movie.mp4 --encrypt-key-file=key.bin --streaming-key-delivery -t 10 --file-base=.`
where key.bin is just aaaaa... (32 a's). Then, in my prog_index.m3u8 file, I set it up as:
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.1.27/just_key.bin",KEYFORMAT="identity",IV=0x6161616161...
However, when I try to run it, I get:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-16040), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1c0250200 {Error Domain=NSOSStatusErrorDomain Code=-16040 "(null)"}.
just_key.bin is just 16 a's.
Any ideas what might be the issue? Is there an easy way to get Fairplay going otherwise?
FairPlay uses SAMPLE-AES encryption, not AES-128. Try with:
METHOD=SAMPLE-AES

upload and save video from api with UISaveVideoAtPathToSavedPhotosAlbum

I have a video that is displayed through the one api in my application. I want to upload and save it on my device and I am using this code:
- (IBAction)saveMovie:(id)sender {
NSString *path = #"http://development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4";
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){
UISaveVideoAtPathToSavedPhotosAlbum(path, nil, nil, nil);
[self alert];
} else {
NSLog(#"incompatible video");
}
}
The link "path" is a own link to upload the file but also have the view link.
When I call the method that receives an answer
Video http://development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4 cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x1660f300 {NSErrorFailingURLStringKey=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4, NSErrorFailingURLKey=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4, NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x16542030 "The operation couldn’t be completed. No such file or directory", NSURL=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4}
what's wrong?
I tried to do it from NSTemporaryDirectory and it worked. It seems that if one accepts this way.
In my case I put this url
http://qa-elb-765904057.us-west-2.elb.amazonaws.com/plugin/execute?pluginName=xxxx&pluginMethod=xxxx&clientId=b0007920-88b4-11e5-a62a-fxxxxx&token=xxx94d60-91xx-11e5-a62a-f362d1d2xxx0&file_key=Mbxxx5v6RxxxQOR.mp4
and the error was this
Video /plugin/execute cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x176644e0 {NSErrorFailingURLStringKey=file:///plugin/execute, NSErrorFailingURLKey=file:///plugin/execute, NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x17661850 "The operation couldn’t be completed. No such file or directory", NSURL=file:///plugin/execute}
It seems that the entire url that was sending only detected this
/plugin/execute

Strange Behaviour while loading URL in Webview in IOS

It looks simple, but don't know what goes wrong. I am trying to load a basic URL in WebView, as shown below
WebsiteWebView.delegate=self;
NSURL* url = [NSURL URLWithString:#"http://firstclasspizzaoc.com/"];
[WebsiteWebView loadRequest:[NSURLRequest requestWithURL:url]];
while loading i am getting below error everytime..
Error : Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0xe036d20 {NSErrorFailingURLKey=http://firstclasspizzaoc.com/, NSErrorFailingURLStringKey=http://firstclasspizzaoc.com/}
2014-01-07 15:18:46.142 FirstClassPizza[1583:
Error : Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0xe0ef310 {NSErrorFailingURLStringKey=XXXXXXXX, NSErrorFailingURLKey=XXXXXXXX, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0xcbe9130 "A server with the specified hostname could not be found."}
At Browser it is loading perfectly..
Please suggest what went wrong in my code..
Any Valuable suggestions will be appreciated...
Thanks
It is due to Your Web URL http://firstclasspizzaoc.com/ can you use your url with
http://www.firstclasspizzaoc.com/
You can find your answer here :
How do I fix NSURLErrorDomain error -999 in iPhone 3.0 OS
This thread contained this description for this error: "This error may occur if an another request is made before the previous request of WebView is completed..."
I worked around this by ignoring this error and letting the webview continue to load.
if ([error code] != NSURLErrorCancelled) {
//show error alert, etc.
}

checkResourceIsReachableAndReturnError always return Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)"

I am trying to use: checkResourceIsReachableAndReturnError of NSURL class
But I always get FALSE and the NSError shows : Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)"
I checked the URL with safary and it works, any idea?
This is not the method you are looking for. The description of the method in NSURL's class reference states:
Returns whether the resource pointed to by a file URL can be reached.
The method should be used to test reachability of file URLs, you cannot check whether an internet resource is available or not using this method.
You'll find several answers in stack overflow if you search for reachability testing or something similar.. However, you could probably just attempt to reach the URL and handle the error if that fails.

Resources