Amazon IoT TwinMaker video integration - Amazon IoT TwinMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon IoT TwinMaker video integration

Video cameras present a good opportunity for digital twin simulation. You can use Amazon IoT TwinMaker to simulate your camera's location and physical conditions. Create entities in Amazon IoT TwinMaker for your on-site cameras, and use video components to stream live video and metadata from your site to your Amazon IoT TwinMaker scene or to a Grafana dashboard.

Amazon IoT TwinMaker can capture video from edge devices in two ways. You can stream video from edge devices with the edge connector for Kinesis video stream, or you can save video on the edge device and initiate video uploading with MQTT messages. Use this component to stream video data from your devices for use with Amazon IoT services. To generate the required resources and deploy the edge connector for Kinesis Video Streams, see the Getting started with the edge connector for Kinesis video stream on GitHub. For more information about the Amazon IoT Greengrass component, see the Amazon IoT Greengrass documentation on edge connector for Kinesis Video Streams.

After you've created the required Amazon IoT SiteWise models and configured the Kinesis Video Streams Greengrass component, you can stream or record video on the edge to your digital twin application in the Amazon IoT TwinMaker console. You can also view livestreams and metadata from your devices in a Grafana dashboard. For more information about integrating Grafana and Amazon IoT TwinMaker, see Amazon IoT TwinMaker Grafana dashboard integration.

Use the edge connector for Kinesis video stream to stream video in Amazon IoT TwinMaker

With the edge connector for Kinesis video stream, you can stream video and data to an entity in your Amazon IoT TwinMaker scene. You use a video component to do this. To create the video component for use in your scenes, complete the following procedure.

Prerequisites

Before you create the video component in your Amazon IoT TwinMaker scene, make sure you've completed the following prerequisites.

  • Created the required Amazon IoT SiteWise models and assets for the edge connector for Kinesis video stream. For more information about creating the Amazon IoT SiteWise assets for the connector, see Getting started with the edge connector for Kinesis video stream.

  • Deployed the Kinesis video stream edge connector on your Amazon IoT Greengrass device. For more information about deploying the Kinesis video stream edge connector component, see the deployment README.

Create video components for Amazon IoT TwinMaker scenes

Complete the following steps to create the edge connector for the Kinesis video stream component for your scene.

  1. In the Amazon IoT TwinMaker console, open the scene you want to add the video component to.

  2. After the scene is opens, choose an existing entity or create the entity you want to add the component to, and then choose Add component.

  3. In the Add component pane, enter a name for the component, and for the Type, choose com.amazon.iotsitewise.connector.edgevideo.

  4. Choose an Asset Model by selecting the name of the Amazon IoT SiteWise camera model you created. This name should have the following format: EdgeConnectorForKVSCameraModel-0abc, where the string of letters and numbers at the end matches your own asset name.

  5. For Asset, choose the Amazon IoT SiteWise camera assets you want to stream video from. A small window appears showing you a preview of the current video stream.

    Note

    To test your video streaming, choose test. This test sends out an MQTT event to initiate video live streaming. Wait for a few moments to see the video show up in the player.

  6. To add the video component to your entity, choose Add component.

Add video and metadata from Kinesis video stream to a Grafana dashboard

After you've created a video component for your entity in your Amazon IoT TwinMaker scene, you can configure the video panel in Grafana to see live streams. Make sure you have properly integrated Amazon IoT TwinMaker with Grafana. For more information, see Amazon IoT TwinMaker Grafana dashboard integration.

Important

To view video in your Grafana dashboard, you must make sure the Grafana datasources have the proper IAM permissions. To create the required role and policy see Creating a dashboard IAM role.

Complete the following steps to see Kinesis Video Streams and metadata in your Grafana dashboard.

  1. Open the Amazon IoT TwinMaker dashboard.

  2. Choose Add panel, and then choose Add an empty panel.

  3. From the panels list, choose the Amazon IoT TwinMaker video player panel.

  4. In the Amazon IoT TwinMaker video player panel, enter the stream name of the KinesisVideoStreamName, with the name of the Kinesis video stream you want to stream video from.

    Note

    To stream metadata to the Grafana video panel, you must first have created an entity with a video streaming component.

  5. Optional: To stream metadata from Amazon IoT SiteWise assets to the video player, for Entity, choose the Amazon IoT TwinMaker entity that you created in your Amazon IoT TwinMaker scene. For the Component name, choose the video component you created for the entity in your Amazon IoT TwinMaker scene.