Genvid Ingest sample

The Genvid Ingest sample shows you how to add an RTMP Ingest server in your project using gvencode, which allows you to work with an external A/V source.

Note that you can only add audio and video streams to the composition. The Ingest server can’t receive data streams or notifications, nor can it send commands or events.

Note

Changing the video resolution while streaming is not supported.

For this sample, we will start with the Genvid Studio service and we will replace the second instance of the DirectX Cube Sample Integration sample with the Ingest server and a local instance of OBS Studio (version 20 or later) to connect to it, providing us a second source for a webcam, for example.

Configure the Cluster

  1. Follow the Genvid Studio service instructions to start all the services.

  2. Verify everything works correctly.

  3. Stop the services.

  4. Load the Ingest configuration:

    py ingest.py load
    
  5. Use the Cluster UI to verify that the Ingest job is present.

  6. Click the Start All button to restart the services.

  7. Wait for the Ingest link to turn blue.

  8. Right click the Ingest link and select Copy link address.

    You’ll need the link address to configure OBS.

Configure OBS Studio

  1. Download and install OBS Studio.

  2. Configure it and select the scene you want to stream.

  3. Select the Advanced Parameters panel in Settings.

  4. Verify your video color format is NV12, I420, or I444.

    Recommended: NV12

  5. Verify your video color space is 601 or 709.

    Recommended: 601

  6. Verify your video color range is Partial or Full.

    Recommended: Partial

  7. Select the Stream Parameters panel in Settings.

  8. Select Custom Streaming Server.

  9. Paste the URL you copied from the Cluster UI.

    It should start with rtmp://.

    Important

    If your browser added unsafe- to the address, delete it from the URL.

  10. Verify your video settings match those of the output.

    The DirectX sample defaults to 1280x720 @ 30 FPS.

Now you can start streaming.

Composing the stream

Go back to Cluster UI and click the Studio link. Your stream is now the second source. See The Studio website for information on working with your broadcast stream.

Script reference

Ingest sample script

usage: ingest.py [-h] [--loglevel {DEBUG,INFO,WARNING,ERROR}]
                 [--logformat LOGFORMAT] [-c CLUSTER_ID]
                 {env,load,unload} ...

Positional Arguments

command Possible choices: env, load, unload

Named Arguments

--loglevel

Possible choices: DEBUG, INFO, WARNING, ERROR

Set the script log level

--logformat Set the script log format
-c, --cluster_id
 

The cluster id. If not set with the command line, uses the environment variable GENVID_CLUSTER_ID if it exists. Otherwise defaults to ‘local’

Default: “local”

Sub-commands:

env

Print environment variables

ingest.py env [-h]

load

Load the specified target definition in the cloud

ingest.py load [-h]

unload

Unload the specified target definition in the cloud

ingest.py unload [-h]

Streams timing

This section covers the timing of audio / video streams when several sources are involved in a production.

The following figure shows the deployment of a production with a first source that shows the game and a second source that contains the audio and video of a commentator. The second source can be used in PIP, voice-over, or as is. This diagram also shows that a director makes the realization of the diffusion with the Genvid Studio.

Game deployement diagram

Fig. 88 Diagram of a broadcast deployment with a video game and a commentator

Any processing on a stream results in a delay on the stream. This delay is mainly due to the encoding, decoding, and transmission of streams. The typical delay between the gamer and the director is about 15 frames or 0.5 seconds. The delay between the commentator and the director is about 3 seconds.

You can adjust the delay using the controls in the Sources section of the Studio website

Source delay adjustment

Fig. 89 Source Delay adjustment control