locked
Replay test.xef - Kinect for Windows v2 RRS feed

  • Question

  • Hi,

    I would like to help. I'm trying to get the frames from a test.xef recorded in Kinect Studio v2. I want to play the "video" like the Kinect. Use Visual Studio 2013 Professional (C#),

    Friday, May 22, 2015 4:31 PM

Answers

  • If you are using KStudio in your code, you will still need to connect to the service. Here is some example code you can put in your constructor:

    string filePath = @"C:\temp\test.xef";
    uint loopCount = 10;
    
    new System.Threading.Thread(() =>
    {
        using (KStudioClient client = KStudio.CreateClient())
        {
            client.ConnectToService();
            using (KStudioPlayback playback = 
                client.CreatePlayback(filePath))
            {
                playback.LoopCount = loopCount;
                playback.Start();
    
                while (playback.State == 
                    KStudioPlaybackState.Playing)
                {
                    Thread.Sleep(500);
                }
            }
    
            client.DisconnectFromService();
        }
    }).Start();

    Tuesday, May 26, 2015 7:53 PM

All replies

  • The xef file that you record from Kinect Studio allows you to simulate data that the Kinect sees.

    Once you record a xef file, go to the "Play" tab in Kinect Studio.  If you have just recorded the file, it should be ready to be played now. Otherwise open the previously recorded file with File > Open (Read-only).  Now, press the "Connect to Service" button on the left of the window and then press the Play button.  You might have to set the Loop Count to a larger number if your clip is too short.

    With a clip playing in Kinect Studio, you can open up an app that renders one of the streams you are playing back.  Instead of seeing live data, you will now see what you had recorded.

    Friday, May 22, 2015 5:48 PM
  • Thanks for the reply, but I want to do just that using C # in Visual Studio. How would?
    Monday, May 25, 2015 2:19 PM
  • Da erro na 3º linha: 

    string filePath = @"c:\temp\test.xef";
    KStudioClient client = KStudio.CreateClient();
    KStudioPlayback playback = client.CreatePlayback(filePath);

    Additional information: The value does not fall within the expected range.

    Monday, May 25, 2015 8:48 PM
  • If you are using KStudio in your code, you will still need to connect to the service. Here is some example code you can put in your constructor:

    string filePath = @"C:\temp\test.xef";
    uint loopCount = 10;
    
    new System.Threading.Thread(() =>
    {
        using (KStudioClient client = KStudio.CreateClient())
        {
            client.ConnectToService();
            using (KStudioPlayback playback = 
                client.CreatePlayback(filePath))
            {
                playback.LoopCount = loopCount;
                playback.Start();
    
                while (playback.State == 
                    KStudioPlaybackState.Playing)
                {
                    Thread.Sleep(500);
                }
            }
    
            client.DisconnectFromService();
        }
    }).Start();

    Tuesday, May 26, 2015 7:53 PM
  • The error in the 10th row. What do I do?
    Wednesday, May 25, 2016 11:03 PM