Genvid Forum

Confusion on next steps to take for Unity integration


#1

I’m currently working on integrating Genvid into an existing Unity project. I believe I have most of the Unity side implementation correctly set up but am having trouble figuring out exactly what remaining steps I need to take for doing a local stream.

So far I have downloaded the full SDK from the Genvid website. I have opened the example unity project (and brought in the appropriate .dlls so the project compiles) and carefully reviewed the C# code contained within. Using the example prefabs included in the sample project I have used the instructions and information found in the Unity prefab for the Genvid SDK documentation to setup the prefabs. I have also created data formatted similar to that found in the sample project (such as that found in CubesGameData.cs) to send via the SubmitGameData function in GenvidStreams.cs.

Additionally, I have attempted to follow the steps to setup the Local Environment by running the install-toolbox.py, which I believe to be correctly installed since running it again takes just a moment to complete (whereas the first time took several minutes).

However it is at this point that I don’t exactly know what steps I need to take next and where exactly in the documentation I should be looking. I have examined the steps followed by another user in this thread but can’t seem to find the files they reference in my appdata folder. Perhaps I’ve done something wrong alone the way?

I’m really primarily a Unity developer so a lot of command line work is foreign to me and digging around through the documentation often leads me to pages like such as the genvid-bastion info page that seem to reference the items found in step 4 of the above linked thread, but don’t actually provide me any additional clarity as to where I should go next since I’m not quite sure where I should even be applying that data.

Is there perhaps a step I’ve missed, or is there anywhere else I should be looking (either in the documentation or externally) that could provide me with any additional info on what to do next?

Thanks.


#2

Edit: It might be easier to follow the steps of @cbtanguay below me, especially because they allow you to see and test the stream more easily.


I always followed the tutorial-sample, but here are the next few stepsin my own words:

After setting up the toolbox, the next thing you need to know about is bastion: Bastion is the tool that manages all the programs genvid needs to run. It really deserves an entry in the glossary (@sidaigle :slight_smile: )

So we need to set up bastion, for that you should be able to run

genvid-bastion install

If you aren’t, make sure that you added the toolbox to your PATH variable. (py install-toolbox.py --user and relog). Then run genvid-bastion install.

For the rest, you can try following the tutorial-sample (I found it to be more clear than the Unity one), or I have tried making a mini-guide up to a certain point:


To see if everything worked, you can run genvid-bastion monitor. This should open a webpage that looks somewhat like this - the port might be different though.

It should already have created a Cluster, if you click on the cluster-tab, which looks like so.

This means that the whole back-end is set up and ready to go. Next you need to install the services, so bastion knows what to do.

For that, just run genvid-sdk load-config-sdk. This installs a job named services in your ‘cluster’ (just your local PC, really).

If you execute genvid-sdk monitor (or click on the circled “cluster ui” button in the previous screenshot, you should see this.

Now, you need to edit some settings in the top left, OR load a config. Here is an example config, you can copy these values manually.

Now, if you start your application and call SubmitGameData and SubmitVideoData, you should notice that gvencode will start taking CPU, that means that everything is set up correctly and your PC is actively encoding a stream.

After that, you just need to set up your website so it accesses the game-data. On how to do this you can look at the tutorial-website, or the unity website sample - albeit I have to admit that I don’t know how well the unity website works, as I never tried it.


#3

I normally use the Unity sample pipeline to display the stream of any Unity application which I did the integration, so I’ll give you some steps to help you out:

  1. write via command line: genvid-bastion install
  2. write via command line: genvid-sdk load-config-sdk
  3. write via command line: py unity.py load
  4. write via command line: py unity.py build

Step 1 is needed to start the local bastion on your machine which is needed to run the Genvid SDK stack.
Step 2 and 3 will load the config files used for our Unity sample (though we will use it to see your Unity project instead for testing purpose).
Step 4 will build the Unity sample, the plugin and the website (in this case, we just need the website).

  1. write via command line: genvid-sdk monitor OR you can open the window Genvid available the Unity Editor from your project in Window -> Genvid and select Local cluster from the dropdown of this window.

You should have a page displayed with all the jobs available for your project.

  1. You need to start Services and Web.

Once both jobs are started, you can start your game with the Genvid SDK activated.

  1. Click on the Tutorial Demo link on the same page where the jobs where located.

This will open the web page that will be streaming the game. Note that we are using the Unity sample webpage, so the resolution might be a bit off compared to the one used with your application. If you want any data to be displayed properly on the webpage, you will need to do changes to the website, but for now, let’s see if the streaming works as intended with your application !


#4

Thanks for your responses.

I have been attempting to input those commands (and ensuring I’ve run the required before steps again, restarting my computer, etc) but I can’t seem to get any results. Putting genvid-bastion install into my command line gives me the result “genvid-bastion is not recognized as an internal or external command, operable program, or batch file”. I assume that I’m just putting these commands directly into a regular old command line (run: cmd.exe) without any particular steps or directory access?

It is trying to execute against my C drive by default (C:\Users\Jyro Blade for me). And my Genvid SDK was downloaded to the same drive. I had previously run the toolbox install by clicking on the .py file using windows explorer. Attempting to do the same via the command line using py install-toolbox.py --user also gives me a “no such file or directory”.

When I downloaded the SDK and ran the .exe I just let it stick everything in default locations from what I remember. Is it possible somehow things are in the wrong location to be accessed by these calls even though I can visually see the Genvid files are in LocalDisk (C: )/Genvid? I have attempted to reinstall again already just in case something went wrong and had the same results. Moving the Genvid folder to within the actual Local Disk(C: )/Users/Jyro Blade had no effect on the file being found as well (since I figured that perhaps I was targeting the wrong location)

Any thoughts on why I would be missing those calls?
Thank you.


#5

After investigating a bit with Jyro, we noticed that the path that we use to detect genvid-bastion was not installed properly on this version of Windows without performing a restart of the computer (normally not required). If someone else has this issue in the future, hopefully this information will help !

Otherwise, you should be able to proceed with the other steps indicated above.