1

I am currently seeking a solution whereby I can store accelerometer data into a file and retrieve the results by indexing into a file by CMTime. This way I can pass in a time value like 1.5 seconds and retrieve the motion data (stored as a plain text line)

AVAssetWriter allows me to write to a file and encode images/audio with CMTime and then retrieve using copyCGImageAtTime. However, I'm looking for a way, instead of images/audio, to store a plain text line with CMTime.

Overall, I am storing accelerometer data into a file every 10 milliseconds and once I finish writing to the file, I would like to index into a file using CMTime. Simultaneously, I will be writing a video file as well so that I can retrieve the frame associated with that CMTime. Another solution can include writing a line into the file to include the timestamp followed by the data, or perhaps encoding the accelerometer data alongside the video? But I would like to see if there is a better way of doing so.

Appreciate any thoughts.

iOScoder
  • 181
  • 1
  • 12

0 Answers0