Search Unity

Question How To get Motion Data from AR Session

Discussion in 'AR' started by volt64bolt, Jun 14, 2022.

  1. volt64bolt

    volt64bolt

    Joined:
    Jan 24, 2021
    Posts:
    7
    I have used
    recordingManager.StartRecording(recordingConfig);
    to record the AR Session, however this only records an mp4 file and does not contain any motion data like I thought it would, I must have misread the documentation.

    How would I go about recording the motion data to a file for later processing, I can work with raw position data as long as its synced up to the video and is spliced per frame in an array of triplets or something. Preferably this would work at the same time as recording the video.

    I know basic programming so I'm not completely new, however I mainly work in python and js not c#

    Thanks in advance,
    -volt
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    As far as I understand this, the recorded mp4 is containing metadata describing device position and information about detected planes.
    Then, you can feed this mp4 file back to the ARCore and it will replay the session. Although session playback is not deterministic, which is a bummer.
     
    andyb-unity likes this.
  3. volt64bolt

    volt64bolt

    Joined:
    Jan 24, 2021
    Posts:
    7
    That is what I thought aswell but when I researched mp4 files It didn't look like they could contain that data, I will see if there is a way to extract it somehow then. Also, what do you mean by it isn't deterministic?
     
  4. volt64bolt

    volt64bolt

    Joined:
    Jan 24, 2021
    Posts:
    7
    Ok after looking into it some more I found a tool called exiftool and that mp4 files can contain accelerometer data as meta data, for now I will see if I can extract it with this tool and then I will look into how to do this within the app itself
     
    KyryloKuzyk likes this.
  5. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    Detected planes are not the same between different session playbacks.
     
    andyb-unity likes this.
  6. volt64bolt

    volt64bolt

    Joined:
    Jan 24, 2021
    Posts:
    7
    ahh that makes sense
     
  7. volt64bolt

    volt64bolt

    Joined:
    Jan 24, 2021
    Posts:
    7
    ok this didnt work, it cant locate the data. now i am looking into splicing in my own data of the camera path within unity
     
  8. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    KyryloKuzyk likes this.