Table of Contents

Getting Started

This page takes a camera from nothing to on screen: add the extension, configure a player, write the few lines of client code, and deploy to an OpenView Pro or Flex.

Table of Contents

Before You Start

Add the Extension to Your Project

Declare a Surface for the Camera

Configure a Player

Host the Service and Connect

Play and Stop

Run It on the Desktop

Run It on a Display

Start From a Demo Instead

Before You Start

Why
An OpenView Pro or Flex Camera video only runs on OpenViewLinuxPro. The desktop simulates playback without showing video.
A display prepped with Developer Toolkit 5.30.0 or newer Prep Target installs the camera-driver blacklist the GMSL/analog bring-up requires. Without it the bring-up refuses and every GMSL/analog player reports Unavailable.
Cameras on supported firmware GMSL sensors below firmware 25.10.0.1 are skipped at bring-up.
Commissioned VCIC cameras (VCIC only) Factory Orlaco cameras all share one address. See VCIC Cameras.

Add the Extension to Your Project

In the OpenPV Developer Toolkit, open the Extensions tab and add the Video Player extension. Then reference the package in your application:

<PackageReference Include="Ahsoka.Extensions.VideoPlayer" />

Adding it in the Toolkit is what puts VideoService in your package's service list and makes the extension take part in packaging. Referencing the package is what lets your code compile against VideoServiceClient. You need both.

The Toolkit's SDK step also regenerates AhsokaStartup.g.cs in your project, which registers every extension the project uses before your code runs:

Ahsoka.Core.ExtensionRegistry.RegisterExtension(new Ahsoka.Registrars.VideoPlayer.AhsokaExtensionsVideoPlayerRegistrar());

Do not edit it. Re-run the SDK step whenever you add or remove an extension.

Declare a Surface for the Camera

Each feed renders to its own compositor surface. Declare one per camera in your platform's screen configuration (the Display tool in the Toolkit, saved to <Platform>.PackageInfo.json), with the rectangle where you want the video:

{
  "surfaceId": 1002,
  "locationRectangle": { "surfaceId": 1002, "x": 40, "y": 100, "width": 560, "height": 350 },
  "visibility": { "surfaceId": 0, "isVisible": true, "opacity": 1 },
  "appID": "GMSL_Camera1",
  "layer": "MainLayer"
}

Save the package before configuring players. The Video Player page lists surfaces from the saved package file, so a surface you have only just added in the Display editor is not offered until you save.

Configure a Player

Open the Video Player page. It starts with one player; Add Video Player adds more.

Column Set it to
Input Type GMSL, Analog, VCIC or File
Player Name Anything — it appears in the log next to the player id
Source For a camera, the port it is plugged into, for example GMSL0; the list comes from what the board declares. For File, the file's path — see Video Files.
Rendering Surface The surface you declared above

Advanced Options opens the selected player in an editor that adds Flip (H) and Flip (V) for cameras and — for analog players only — Deinterlace, which an analog player gets turned on. Leave it on.

Saving writes VideoPlayerConfiguration.json beside PackageInfo.json:

{
  "version": "5.12.0",
  "players": [
    {
      "videoPlayerID": 1,
      "surfaceID": 1002,
      "sourceName": "GMSL Camera 1",
      "inputType": "GMSL",
      "videoSource": "GMSL0",
      "pixelFormat": "UYVY",
      "width": 1920,
      "height": 1200,
      "frameRate": 30
    }
  ]
}

Every field is described in the Configuration Reference.

Host the Service and Connect

The application that uses the video service must host it. Start the local service manager first — before you create any client:

using Ahsoka.Core;
using Ahsoka.Services.Video;

AhsokaRuntime.StartLocalServiceManager();

var client = new VideoServiceClient();
client.NotificationReceived += OnVideoNotification;
client.Start();
Warning

Without StartLocalServiceManager() nothing hosts VideoService. The client still connects optimistically, and the first request — usually GetVideoPlayers() — blocks forever. There is no error; the application simply hangs.

Play and Stop

VideoPlayerInfo info = client.GetVideoPlayers();

foreach (var player in info.Players)
    Console.WriteLine($"{player.VideoPlayerID}: {player.SourceName} ({player.InputType} {player.VideoSource})");

VideoStatus status = client.PlayVideo(new VideoPlaybackRequest
{
    VideoPlayerID = 1,
    StatusUpdateInMs = 1000,
});

if (status.VideoState == PlaybackState.Unavailable)
    Console.WriteLine("No camera on that port");

// ... later
client.StopVideo(new VideoPlayer { VideoPlayerID = 1 });

PlayVideo returns once the feed has been launched or has failed over. Check its VideoState: Playing means the pipeline started, Unavailable means the camera, its port, the file or the native helper was missing, or the file was not one the display can play. The log says which — see Troubleshooting.

Tip

PlayVideo can block for a while — it waits for the boot-time camera bring-up on the first play, and for any previous feed on that player to shut down. Call it off your UI thread, as both demos do.

Play only the players you mean to show. Playing every configured player at once puts every feed on screen, each at its own surface.

Run It on the Desktop

On the desktop the service runs a simulation: PlayVideo returns Playing, status notifications arrive with a simulated one-minute timeline, and nothing is drawn. A File player follows the device's rules: it pauses in place, restarts only from 0, and sends Stopped when its minute is up, so a repeat-on-Stopped handler can be tried. That is enough to develop the application's page flow and state handling, but not to see a camera. The desktop does not check the file, so a refused file only shows up on the display.

Run It on a Display

Package and deploy from the Toolkit as for any OpenPV application. Packaging compiles the player configuration into the package and, for Pro and Flex, adds the camera bring-up service. See Packaging & the Device for what ends up on the display and how to confirm it arrived.

Start From a Demo Instead

The extension ships two working demos, available from the Toolkit:

Demo Display Shows
Ahsoka.CS.VideoPlayer OpenView Pro (P100) A GMSL/Analog page, a VCIC page with a dynamic layout, and a Video File page
Ahsoka.CS.VideoPlayerFlex OpenView Flex Four GMSL cameras as a quad, or split across two screens, and a Video File page

See The Demos for a guided tour.