Get filenames for photos from camera roll
So... in the end, how long does it take to ftp the 1600 files?
@ccc: Once I get everything for the video transfer in place, I will let you know. At this point, I have made no attempt at anything other than functionality. Also, of the 1600+ files, only 32 or so are videos. I will post results when I'm finished.
I have the video copy code in my ftp app. It now copies video files (MOV) over ftp to the server and the videos play perfectly.
So, thank you for the pointer. It works.
While attempting to understand the code I found myself stumbling on what was happening with the asset. A group of videos is sent to the script, they are then each processed by standard PHIImageManager into what appears to be an AVAsset rather than a Photos.Asset. I am guessing that is required to get at the video data. What is missing on the server side are the other meta-data (video creation date, etc.) that the AVAsset seems to imply should be there. So, the video data is copied, and nothing else. Ideas on improving this to get everything across, including meta-data.
This seems to work for a block of video assets, it would be nice to have it handle a single video file as well. Other than packing up a single video file asset into a collection (having only one element) and passing that to the script, does anyone understand what is happening in the OS enough to make the sample gist above work for just one file at a time?
Those are picky "wishlist" things, but I am investigation them for completion sake.
Finally, once again, thanks to everyone for their amazing pointers and help.
@billbris Are you willing to publish your code on GitHub? It is easier to debug Python code than English prose. My bet is that it would be easier for folks to add their code to your code rather than start from scratch.
The original asset list could instead be passed to pick_asset to choose a single asset, which would then be passed the
request..... method. The fundamental method operates on a single asset at a time.
As i mentioned in the comments, it would be possible to do the work inside the request handle, though it might be necessary to have a threading lock (not sure).
As for metadata, AVAsset has a
metadatamethod, also a `creationDate’.
@ccc: Sorry for the long delay.
I finally had some time to work on this and just finished running a full batch from my iPad mini.
I copied 1803 files, 32 of which are videos. The total time (not overly scientific, but with a simple take a time at the beginning and end to calculate the delta) was 28minutes and 34 seconds.
I've done nothing to optimize this, but it does work and that's not awful for a first attempt.
Thanks again for the help!