0

I am performing processing on the camera output on the iPhone that I can only perform on the device. I now need to store each processed frame together with some additional information that has been provided by the processing step. Ultimately I need to open the data in Matlab to analyze it further.

Currently Im using AVAssetWriter to write a mov file and simultaneously building up a separate data.txt file which I email to myself at the end of each recording.

This process is unpleasant because it means I have to download the data.txt file every time I record something. Then I have to import the movie file from the phone (I obviously cant email the movie file because its too big for email) and then I have to give them both a common name.

Is there a video format supported by iOS and that I can open in Matlab which would allow me to get per frame data AND metadata? Is there a better method than what Im currently doing? I saw there is an AVMediaTypeText but I havnt found sample code for it and I doubt I can interleave it into a mov file...

twerdster
  • 4,977
  • 3
  • 40
  • 70
  • http://www.mathworks.com.au/help/matlab/ref/videoreaderclass.html - apparently you can open .mov files. – Fabian Tamp Feb 18 '13 at 01:43
  • @Fabian Tamp I know how to open mov files. I would like to be able to save a single video format and open the movie file in matlab and be able to get bot image data and per frame metadata simultaneously instead of the longwinded process I described above. – twerdster Feb 18 '13 at 02:06
  • ... got it, I understand your question now. Sorry about that. – Fabian Tamp Feb 18 '13 at 05:11

1 Answers1

0

It seems to me that you should create a "metafile" that includes the information about the name and location of the movie - then pass matlab the name of the metafile from which it accesses all the metadata and figures out what movie file to open. In other words - turn the problem around: instead of adding meta data to the mov, add mov information to the meta file.

I think that would solve 90% of the headache you are referencing?

Floris
  • 45,857
  • 6
  • 70
  • 122
  • That was my original solution but I couldnt figure out how to get the name of the movie file programmatically. I can get its NSURL but that doesnt seem to include its file name ... – twerdster Feb 18 '13 at 02:41
  • That is odd. Can you get a directory listing of the NSURL right before and right after you create the new asset, and deduce the file name from the difference? Or create a unique location for a given file - so you know the only file in that location is the one you want. It seems like a terrible hack... – Floris Feb 18 '13 at 02:47