Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Windows 10: Using XBox game bar features from Unity application

Discussion in 'Audio & Video' started by AndreasScholl, Nov 8, 2021.

  1. AndreasScholl

    AndreasScholl

    Joined:
    Oct 16, 2015
    Posts:
    12
    Hey,

    we are looking for an easy way to record sessions for our unity applications on Windows 10. There is the XBox game bar feature that can be accessed via hotkeys (Win + R), (Win + Alt + G).

    I there a way to utilize those functions directly (programatically) from unity without using the hotkeys?

    The gamebar is part of the windows.media.capture api:
    https://docs.microsoft.com/en-us/uwp/api/windows.media.capture

    I'm not sure if it is possible to access this api from within unity. If anybody could provide some infos on this topic it would be great.

    best regards,
    Andreas
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    No idea about the game bar approach. But another avenue perhaps.... Not sure if you can use the Unity Recorder in Timelines somehow.

    Gotchas: if you are playing a game it can be a bit slow (MP4 can have low video quality, WebM can slow down game play). Image sequence is where it writes an image file per frame, which you can use an external tool to turn into a video file. I have not checked that performance, but might be an option without using Timeline (you write code to save a file on disk per frame).

    There are asset store extensions for doing recordings of course. But again no advice from me as I have no experience with them.
     
  3. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Unfortunately, you would need to write a native plugin to access it. I know it is not what you are looking for, but maybe this package could interest you. https://github.com/Unity-Technologies/com.unity.webrtc https://docs.unity3d.com/Manual/NativePlugins.html
     
  4. AndreasScholl

    AndreasScholl

    Joined:
    Oct 16, 2015
    Posts:
    12
    Thanks for your replies I will consider your hints.

    If there is anybody out there that already tried to access the gamebar api through a native plugin it would be great to share some experience on that.