Hello!
Alex Podolski
1
Good day, Alex.
Thanks for response. There are two major kinds of PHAssets: photos and videos.
- For the photo asset I extract NSData using requestImageDataForAsset:options:resultHandler: and then put it in the stream described in the referenced article.
- For video PHAssets the story is more interesting. First of all I try to convert PHAsset to ALAsset using the following code and if it was successful I wrap it in the NSInputStream for ALAsset from POSInputStreamLibrary. In other case I use standard NSInputStream for the file as you suggested.
I attached the chart from the Cloud Mail.Ru monitoring dashboard. It demonstrates that more than 90% of PHAssets with videos can be converted to ALAssets.

The approach has 2 advantages:
- No free space required on user’s devices to obtain a copy of video in the application’s sandbox.
- ALAsset stream is much more performant than file stream.