views:

46

answers:

2

For those of you making iphone applications that record video

  • Are you utilising the camera roll for storage and then indexing the asset URL?
  • Or are you somehow saving the video to the app / bundle / database?

Does the stackoverflow community think it is viable to just store the asset url for replaying or that one should somehow store the recorded vid?

The reason I ask, is that if you just store the URL, and the user inadvertently removes the video from the camera roll then the app will fall out of sync etc. This could be handled but far from ideal.

Comments / queries / suggestions?

A: 

You want to save local data to NSDocumentDirectory (or NSLibraryDirectory/whatever if you've enabled file sharing and don't want users to access it from iTunes).

Storing it in the camera roll has the advantage that it's easier for the user to access, assuming you want them to access it.

I'd suggest sticking it in NSDocumentDirectory and enabling file sharing if you want the user to access it, or not enabling file sharing if you don't want it to disappear under your feet (I'd be wary of assuming that it can never get out of sync though).

tc.
hmmm so you can store the video in the Documents folder internally to the application... Imagine how much space the application would take up having video recorded and saved into the app folder!! I'm still torn as to the approach - its nearly impractical to do this way just because of space! hmmmm... thanks for your respsonse.
Lance
That's why I suggested using file sharing (`<key>UIFileSharingEnabled</key><true/>`). This lets the user see the files in iTunes and upload/download/delete them, but makes it much harder to delete them accidentally.
tc.
A: 

Have you considered using CoreData for that?

toupper
That would lead me to ask how you store binary data in the core data store - but no, thanks for the idea, I wasn't sure you could.I think that I am going to go with using the camera roll / photos library option. It is not ideal as the user can definitely remove media items to unsynchronise entries. For me it comes down to being able to access the media readily outside of the application vs data synchronisation. Time to build in fixing broken entries :\I am interested to hear of any links you might have regarding storing video data within the Core Data Model though!
Lance
Well, I think NSData is supported as an attribute type for Core Data. Here you can check a discussion for that:http://stackoverflow.com/questions/2988747/how-can-core-data-store-an-nsdataThat is how I did it.
toupper