none
How to open .xef files? RRS feed

  • Question

  • Hello,

    KStudio saves the recorded data in .xef file. I need to read the data present in this file and for that I searched for any application apart from KStudio. Can anyone help me to open this file and extract the data present in it?

    Thanks in advance.

    Wednesday, December 14, 2016 5:37 PM

All replies

  • It's binary so I doubt there's any reader apart from Kinect Studio out there for reading them.

    Also what do you want to do and need to extract data from it?

    Kinect Studio can hijack feed into your application and feed you the recorded data, if you need it for debugging purposes.

    Thursday, December 15, 2016 10:34 AM
  • How exactly to feed the recorded data into a unity application? 
    Monday, January 27, 2020 12:51 PM
  • It doesn't matter what kind of application you have. It can be Unity, Unreal, Python whatever.

    The SDK and tools were designed to be able to feed multiple applications at the same time, so there is a background service which keeps grabbing raw data from the sensor and gets them processed in the GPU. Then it serves the processed data to the applications by the use of <Source>Frame(e.g. BodyFrame, BodyIndexFrame etc).

    KinectStudio can hijack into that flow and feed the xef data into the service. So all applications end up getting the file data when they subscribe to the service.

    You can try it, by playing an xef back in Kinect Studio and having two applications(e.g. one of the sample apps provided by the SDK Browser) and your own in Unity. They should both get the data of the playback.

    Tuesday, January 28, 2020 9:05 AM
  • Thank you very much for your answer so far! But still, I cannot make it work to use the recorded data with the following code. The BodyFrameReader just does not get triggered when I play a Kinect Studio Recording (Body Source channel is recorded during the recording). However, the code works perfectly fine when I use 'realtime' Kinect data (I myself stand in front of the Kinect). Do you have an idea why? 

    using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
    using Windows.Kinect;

    public class BodySourceManager : MonoBehaviour
    {
        /******************************************************
         * PRIVATE
         *****************************************************/
        private KinectSensor sensor;
        private BodyFrameReader reader;
        private Body[] data = null;
        private Dictionary<ulong, Body> bodies = new Dictionary<ulong, Body>();
        private List<ulong> bodyOrder = new List<ulong>();

        /******************************************************
         * START
         *****************************************************/
        void Start()
        {
            this.sensor = KinectSensor.GetDefault();

            if (this.sensor != null)
            {
                this.reader = this.sensor.BodyFrameSource.OpenReader();

                int bodycount = this.sensor.BodyFrameSource.BodyCount;

                this.data = new Body[bodycount];

                if (!this.sensor.IsOpen)
                {
                    this.sensor.Open();
                }
            }
        }
        void Update()
        {
            if (this.reader != null)
            {
                var frame = this.reader.AcquireLatestFrame();
                if (frame != null)
                {
                    if (this.data == null)
                    {
                        this.data = new Body[this.sensor.BodyFrameSource.BodyCount];
                    }

                    frame.GetAndRefreshBodyData(this.data);
                    FloorClipPlane = frame.FloorClipPlane;

                    frame.Dispose();
                    frame = null;


                }

                ...
                
            }
        }
        void OnApplicationQuit()
        {
            if (this.reader != null)
            {
                this.reader.Dispose();
                this.reader = null;
            }

            if (this.sensor != null)
            {
                if (this.sensor.IsOpen)
                {
                    this.sensor.Close();
                }
                this.sensor = null;
            }
        }
    }

    Tuesday, January 28, 2020 11:10 AM
  • If the code works for realtime data, it works for recordings as well. It's the same interface. Have you pressed Are you properly connecting to the service on playback? Left of the Play button does it say "Connected" or "Not Connected"? If it's Not Connected, basically you haven't pressed the left most button which connects to the service and starts feeding it data. If you are properly connected, then there are some checkboxes to the left most of each stream below. e.g. Nui Uncompressed Color has this tendency to be disabled by default when opening an xef and connecting to the service. Instead of a tick, it shows a red circle with a red diagonal line(like a stop sign). You have to toggle that so it's a tick. This basically enables/disables the streams you want to feed the service from the xef file.

    Tuesday, January 28, 2020 12:14 PM
  • you made my day!!!! :) thank you! 
    The mistake I made was the following: I did not press the "connect to Service" button (left to play button) during the play of the recording, since I thought this connection is supposed to connect to the actual Kinect device and its recording data. This is apparently not the case and since I press this connect button it works :) thank you! 
    Tuesday, January 28, 2020 12:51 PM