I'm trying to create a Thumbnail image from a video:
func getImageFromUrl(url:URL) -> UIImage?{
print(url)
let video = AVURLAsset(url: url)
let thumbnailGenerator = AVAssetImageGenerator(asset: video)
do
{
let cgImage = try thumbnailGenerator.copyCGImage(at: CMTimeMake(value: 0, timescale: 1), actualTime: nil)
let UiImage = UIImage(cgImage: cgImage)
return UiImage
}
catch
{ print(error) }
return nil
}
and I'm getting this Error:
Error Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSLocalizedFailureReason=The server is not correctly configured., NSLocalizedDescription=Operation Stopped, NSUnderlyingError=0x2804c50b0 {Error Domain=NSOSStatusErrorDomain Code=-12939 "(null)"}}
HELP ANYONE ?
That error tells us that this is an HTTP, not local issue. The Apple Developer Documentation says "This error might indicate that the HTTP server doesn’t support byte range requests." and or that "The HTTP server sending the media resource is not configured as expected." Check to make sure the HTTP server is configured properly and allows this type of query.