Exporting video using AVExportSession from a streaming AVAsset

My app currently streams video clips. I want to be able to cache them so they are not constantly re-downloaded from the servers even if the app is removed from the memory.


After my AVPlayer finishes playing a video clip I can put my phone into the airplane mode and still be able to playback the same video. So clearly the video is not being re-downloaded. So I thought I would try and use AVExportSession, but I'm getting -11800 error without any useful info:


Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x174c7e500 {NSUnderlyingError=0x17424c510 "The operation couldn’t be completed. (OSStatus error -12780.)", NSLocalizedFailureReason=An unknown error occurred (-12780), NSLocalizedDescription=The operation could not be completed}


If I check AVAsset's exportable property it returns YES which is weird. So can anyone confirm that it's not possible to extract the video from a streamming AVAsset?


I searched around the web and the others seem to be having similar qustions, but no answers. Here's one exmaple: http://stackoverflow.com/questions/25292979/avexportsession-with-a-streaming-avasset-11800-error


If that's not possible, is there any other way to cache the streaming videos? Note that I need to be able to start streaming instantly and can't afford to download the complete file first.

Replies

Did you find the solution to this?