Powering Personalized Video Recommendations with Mux and Shaped (via Kinesis)

Mux provides rich video analytics, but turning that data into personalized viewer experiences takes real-time ML infrastructure. This post shows how connecting Mux to Shaped via AWS Kinesis unlocks intelligent features like “What to Watch Next,” personalized feeds, smarter search rankings, and deep viewer insights. Shaped ingests streaming video views, trains relevance models, and serves recommendations via API, no need to build complex pipelines yourself.

From Video Analytics to Intelligent Viewer Experiences

Mux is a leading platform for developers building video experiences, providing powerful APIs for vide o streaming and deep analytics on viewer engagement and quality of experience. Understanding metrics like watch time, rebuffering, errors, and which videos are viewed is crucial. But how do you take this rich stream of Mux data and use it to proactively personalize the experience for each individual viewer in real-time?

How do you predict which video a specific user is most likely to watch next based on their unique viewing history captured by Mux? How do you create dynamic "For You" rows or personalized search results within your video platform? This requires transforming Mux's valuable analytical data into predictive AI models, and that's where integrating Mux with Shaped via AWS Kinesis creates a powerful synergy.

Shaped is an AI-native relevance platform designed to ingest real-time event streams, like video view data from Mux, train state-of-the-art machine learning models on this behavior, and serve personalized recommendations and search rankings via simple APIs. This post explains the value of connecting Mux to Shaped and provides a step-by-step guide using the AWS Kinesis integration path.

Why Connect Mux to Shaped? Elevating the Viewer Experience

Sending your Mux video view data directly to Shaped via Kinesis unlocks sophisticated personalization capabilities that go far beyond basic analytics:

  • Highly Relevant Video Recommendations: Utilize detailed Mux engagement data to power:
    • "What to Watch Next": Predict the most engaging next video based on individual viewing patterns, completion rates, and inferred preferences.
    • Personalized "For You" Feeds/Rows: Curate dynamic feeds showcasing videos tailored to each viewer's specific tastes learned from Mux data.
    • "Similar Video" Suggestions: Recommend videos based on behavioral similarity (e.g., viewers who watched X also engaged strongly with Y), complementing metadata-based similarity.
    • Trending & Popular Content: Surface videos gaining traction based on real-time Mux view signals processed by Shaped.
  • Enhanced Video Search: Improve discoverability within your video library:
    • Personalized Search Ranking: Rank video search results based on a user's viewing history and predicted engagement, learned from Mux data.
    • Engagement-Aware Ranking: Potentially use metrics like average watch time or completion rates (derived from Mux data) as signals in Shaped's ranking models.
  • Deeper Viewer & Content Insights: Apply Shaped's ML models to Mux data for advanced analysis:
    • Viewer Journey Analysis: Understand sequences of video consumption and predict future viewing behavior.
    • Content Embedding Generation: Create vector representations of videos based on viewer engagement patterns for content clustering and analysis.
    • Audience Segmentation: Identify viewer cohorts based on their interactions captured in Mux data using Shaped's embedding insights.
  • Real-Time Adaptability: Leverage the Kinesis stream to allow Shaped's models to adapt recommendations almost instantly based on viewing activity within the current session.
  • Simplified ML Infrastructure: Avoid building complex stream processing pipelines and ML training infrastructure specifically for Mux data; Shaped provides the managed AI layer.

How it Works: Mux -> Kinesis -> Shaped

This integration relies on AWS Kinesis Data Streams as the real-time bridge:

  1. Shaped Provisions Kinesis: You create a KINESIS type dataset in Shaped, defining a schema suitable for Mux video view events. Shaped automatically provisions a dedicated Kinesis Data Stream for this dataset.
  2. Shaped Provides Credentials: Shaped gives you the ARN of the Kinesis stream and an IAM Role ARN specifically designed for Mux to use.
  3. Mux Exports to Kinesis: You configure Mux's Data Export feature to send selected data (specifically "Video Views") to the Kinesis stream provided by Shaped, using the provided IAM Role ARN for secure authentication.
  4. Shaped Ingests & Learns: Shaped continuously ingests the video view events from the Kinesis stream, trains its AI models, and serves personalized results via its APIs.

Connecting Mux to Shaped via Kinesis

The process involves setting up the endpoint in Shaped first, then configuring the data export in Mux.

Step 1: Create the Shaped Kinesis Dataset

You need a dataset in Shaped ready to receive Mux events with the correct structure.

  1. Define the Schema (YAML): Create a YAML file defining the dataset. Critically, the column_schema should match the fields you expect from Mux Video View exports. Use the example below as a starting point, adjusting as needed based on the Mux data you intend to use. You also must include your AWS Account ID in tenant_aws_account_id so Mux can assume the role Shaped creates.
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: TIMESTAMP
  view_end: TIMESTAMP
  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: INT
  viewer_experience_score: FLOAT
  continent_code: STRING
  country_code: STRING
  city: STRING
  region: STRING
  metadata: STRING

tenant_aws_account_id: "YOUR_AWS_ACCOUNT_ID"
  1. Create the Dataset: Use the Shaped CLI. Provisioning the Kinesis stream takes a few minutes.
create_mux_dataset.sh

shaped create-dataset --file mux_views_dataset.yaml
  1. Monitor Status: Wait for the dataset status to become ACTIVE using the Shaped Dashboard or CLI (shaped view-dataset --dataset-name mux_video_views).

Step 2: Retrieve Shaped Kinesis Details

Once the dataset is ACTIVE, Shaped will provide the necessary details for the Mux configuration. You can retrieve these via the CLI, API, or Dashboard:

  • Kinesis Stream ARN: The full ARN of the stream Shaped created (e.g., arn:aws:kinesis:us-east-2:11111111111:stream/ShapedDatasetStream-xyz789). You'll need the Stream Name part of this ARN for Mux.
  • Kinesis Access Role ARN: The ARN of the IAM Role created by Shaped that Mux needs to assume (e.g., arn:aws:iam::11111111111:role/ShapedDatasetAccessRole-xyz789). You'll need this full ARN for Mux.

Note down the Stream Name and the full Access Role ARN.

Step 3: Configure Mux Data Export

Now, configure Mux to send data to the stream Shaped prepared.

  1. Log in to your Mux Dashboard.
  2. Navigate to Settings > Data Export.
  3. Click to add or configure an export destination. Select Amazon Kinesis Data Streams.
  4. Enter the following information obtained from Shaped in Step 2:
    • AWS Region: Specify the AWS region where Shaped provisioned the Kinesis stream (Shaped will provide this, typically us-east-2 or similar).
    • Kinesis Stream Name: Enter the name extracted from the Kinesis Stream ARN (e.g., ShapedDatasetStream-xyz789).
    • AWS IAM Role ARN: Enter the full Kinesis Access Role ARN provided by Shaped.
  5. Select Data Types: Ensure that "Video Views" (or the equivalent data type containing the fields defined in your column_schema) is selected for export. You may choose to export other types, but "Video Views" are typically most relevant for engagement-based personalization.
  6. Save and Activate: Save the configuration. The export should show as "Active" in Mux.

Refer to the official Mux documentation on Kinesis exports for the most up-to-date UI steps and details within their dashboard.

What Happens Next? Streaming Video Insights to AI Models

With the connection live:

  1. Mux Sends Events: As viewers watch videos, Mux generates view data and sends it to the configured Kinesis stream using the assumed role.
  2. Shaped Ingests: Shaped reads the events from the Kinesis stream in near real-time.
  3. Real-Time Learning: Shaped's AI models process these events, updating understanding of viewer preferences and video engagement almost instantly.
  4. Personalized API Responses: Shaped's APIs serve recommendations and search rankings reflecting the very latest insights derived from the Mux data stream.

Data Validation & Troubleshooting Tips

  • Test Stream: After setup, play a video through your Mux-integrated player to generate test events.
  • Check Mux: Ensure the Kinesis export is listed as "Active" in the Mux Data Export settings.
  • Check Shaped: Monitor the dataset in the Shaped dashboard. You should see incoming events (there might be a slight delay). Check for any errors reported.
  • Verify IAM: Double-check that the correct Role ARN was entered in Mux and that the tenant_aws_account_id in your Shaped dataset config matches the AWS account associated with your Mux setup.
  • Contact Support: If issues persist, reach out to Shaped support for assistance.

Conclusion: Intelligent Video Discovery Powered by Mux and Shaped

Your Mux data provides invaluable insights into how viewers engage with your video content. By connecting Mux directly to Shaped via AWS Kinesis, you can transform these analytics into powerful, real-time AI personalization. Deliver hyper-relevant video recommendations, personalize search results, and gain deeper insights into viewer behavior, all powered by a seamless integration that leverages the strengths of both platforms. Elevate your viewer experience from passive watching to intelligent discovery.

Ready to turn your Mux video views into personalized recommendations?

Request a demo of Shaped today to see it in action with your specific use case. Or, start exploring immediately with our free trial sandbox.

Get up and running with one engineer in one sprint

Guaranteed lift within your first 30 days or your money back

100M+
Users and items
1000+
Queries per second
1B+
Requests

Related Posts

Heorhii Skovorodnikov
 | 
June 20, 2023

Exploring the benefits of Large Language Models for Recommendation Systems

Amarpreet Kaur
 | 
January 17, 2025

Titans: Learning to Memorize at Test Time - A Breakthrough in Neural Memory Systems

Zac Weigold
 | 
April 16, 2024

A Technical Intro to Embeddings: The approach to data powering modern AI