Skip to main content

Mux

Mux is a video platform that provides APIs for streaming video and monitoring video performance. Shaped can integrate with Mux to ingest viewer video engagement data via AWS Kinesis.

Overview

This integration allows you to:

  • Stream video viewing data from Mux to Shaped in real-time
  • Analyze viewer engagement and video performance metrics
  • Combine Mux data with other data sources in Shaped

The integration works by:

  1. Creating a Kinesis dataset in Shaped with an appropriate schema for Mux data
  2. Configuring Mux to export data to the Kinesis stream provisioned by Shaped

Dataset Configuration

To receive Mux video views data, you'll need to create a Kinesis dataset in Shaped.

Required fields

FieldExampleDescription
schema_typeKINESISSpecifies the connector schema type, in this case "KINESIS".
column_schemaSee belowSpecifies the schema of the dataset matching Mux's data structure.
unique_keys["view_id"]Specify the column that uniquely identifies a row in the dataset.
tenant_aws_account_id"123456789012"Your AWS Account ID where Mux will be configured to send data from.

Example Schema for Mux Video Views

mux_views_dataset.yaml
name: mux_video_views
schema_type: KINESIS
unique_keys: [view_id]
column_schema:
view_id: String
viewer_os_family: String
viewer_application_name: String
video_title: String
view_start: DateTime
view_end: DateTime
video_id: String
player_error_code: String
player_error_message: String
player_error_type: String
player_startup_time: Float
player_watch_time: Float
video_startup_time: Float
video_duration: Float
view_max_request_latency: Float
view_max_downscale_percentage: Float
view_max_upscale_percentage: Float
view_average_request_throughput: Float
view_average_request_latency: Float
view_error_count: Int32
viewer_experience_score: Float
continent_code: String
country_code: String
city: String
region: String
metadata: String
tenant_aws_account_id: "123456789012"

Note: Adjust the schema as needed to match the specific Mux data points you want to capture. The above example includes common fields from Mux video view events.

Creating the Dataset

shaped create-dataset --file mux_views_dataset.yaml

Once created, the dataset will be provisioned asynchronously and will transition from SCHEDULING to DEPLOYING then ACTIVE once the Kinesis Data Stream is ready to receive events.

Connecting Mux to Shaped

When the Kinesis dataset is provisioned, Shaped will provide:

  • Kinesis Stream ARN - The Amazon Resource Name of the Kinesis Data Stream
  • Kinesis Access Role ARN - The IAM Role that Mux will need to assume to send data to the stream

Configuring Mux Export to Kinesis

Follow these steps to configure Mux to export data to your Shaped Kinesis stream:

  1. In the Mux dashboard, navigate to Settings > Data Export

  2. Select Amazon Kinesis Data Streams as the export destination

  3. Configure the export with the following information:

    • AWS Region: The region of your Kinesis stream (provided by Shaped)
    • Kinesis Stream Name: Extract this from the Kinesis Stream ARN provided by Shaped
    • AWS IAM Role ARN: The Kinesis Access Role ARN provided by Shaped
  4. Select the data types you want to export (ensure "Video Views" is selected)

  5. Click "Save" to activate the export

For more detailed instructions, refer to Mux's documentation on exporting to Amazon Kinesis Data Streams.

Data Validation

After setting up the export, you can validate that data is flowing correctly:

  1. Stream a test video through your Mux-powered player
  2. Check the Shaped dashboard to confirm that video view data is being received

Troubleshooting

If you don't see data appearing in Shaped:

  1. Check that the Mux export is configured correctly and showing as "Active" in the Mux dashboard
  2. Verify the IAM role permissions are correctly set up
  3. Confirm the Kinesis dataset is in "Active" state
  4. Contact Shaped support for further assistance with debugging connection issues