惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
F
Full Disclosure
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
L
LangChain Blog
T
The Blog of Author Tim Ferriss
D
DataBreaches.Net
GbyAI
GbyAI
Y
Y Combinator Blog
博客园 - Franky
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
Jina AI
Jina AI
N
Netflix TechBlog - Medium
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
腾讯CDC
H
Help Net Security
H
Heimdal Security Blog
J
Java Code Geeks
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
The Exploit Database - CXSecurity.com
The Register - Security
The Register - Security
大猫的无限游戏
大猫的无限游戏
T
Threatpost
B
Blog RSS Feed
T
Threat Research - Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
S
Securelist
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
量子位
AWS News Blog
AWS News Blog
Project Zero
Project Zero
P
Proofpoint News Feed
Cisco Talos Blog
Cisco Talos Blog
Spread Privacy
Spread Privacy
S
Schneier on Security

Mux Blog - Video technology and more

How Disciple lowered its video costs with Mux | Mux New Mux Robots workflows: Better captions, dubbed audio, and deeper insights | Mux How Cutsio is making massive video libraries searchable | Mux Making it easier for agents to understand video: Introducing Find Scenes and Shots | Mux How Mux detects shot boundaries | Mux React Native needs a new video player | Mux Protect your prod environment: New rate limit controls | Mux Mux Robots Directives: less plumbing, more automation | Mux Fine-tuning a multimodal model for video intelligence | Mux How Mux helped Fuertafit make smarter product decisions | Mux Using Mux Robots to organize my archive of 90s-era VHS home videos | Mux The death of the to-do app | Mux One click content moderation dashboard with Mux Robots | Mux Introducing Mux Robots: Hosted AI workflows for Mux Video | Mux How Wellfound built AI video interviews in a weekend | Mux Simple pricing doesn't work for infrastructure | Mux Ship your next Mux integration from the terminal | Mux Your video is more valuable on Mux | Mux How HubSpot scaled video infrastructure — and built AI tools on top | Mux That's no video — it's an array | Mux ‘It's so much better’: Why Punchpass switched from Vimeo to Mux | Mux Video.js v10 Beta: Hello, World (again) | Mux
The new Mux Convex component | Mux
Joshua Alphonse · 2026-03-18 · via Mux Blog - Video technology and more

Convex is a seriously impressive serverless database. It's not just fast; the developer experience is one of the best I've ever, well... experienced. The Convex team shipped something new called Components, which are self-contained backend modules that bundle functions, schemas, and data. Think of them as plugins for your database. I did some digging and found a lot of value in using some of their existing components, like the ones for Stripe, BetterAuth, and a few others. So I figured, why not make one for Mux?

A few months back when I joined Mux our team released @mux/supabase so developers could quickly spin up a Supabase database instance and transfer over their Mux asset data. This showed us that there is more to this database story that we have to tell. There are a ton of serverless database providers out in the wild and Convex just so happens to be one of my favorites.

We just released @mux/convex, our Convex component that keeps your Mux assets, live streams, and uploads in sync with real-time webhook updates and scaffolds Convex tables you need to start building video streaming apps.So you might be asking yourself now, what could I actually build with this @mux/convex component? The answer is just about anything, but let me give you an example to steer you where you could be going with this.

I built Robotube—a mobile app built with Mux, Convex, and React Native, and of course, @mux/convex. Using @mux/convex was really for setting the foundation and getting myself up to speed quickly. This is a video streaming app that uses a combination of Mux and Convex features like AI-generated tags, summaries, chapters, and video embeddings, using @mux/ai. We also used @mux/ai for moderating videos during uploading to make sure they were appropriate. Not only did I get to integrate these great AI features, but since I generated the embeddings of my videos with @mux/ai, it was easy to sync my app up with Convex to utilize its vector search and RAG features. So, when I say you can pretty much just build anything with this stack, you see what I mean.

LinkWhat gets created

After setup, your Convex project gets five tables that are compatible with Mux:

  • assets — video assets and their processing state
  • uploads — direct upload records
  • liveStreams — live stream configurations
  • events — a webhook event log
  • videoMetadata — your app's own data: titles, user ownership, visibility, tags

The first four tables are managed by Mux and kept up to date via webhooks. The videoMetadata table is yours to fill in. That means your users can set titles, or you can generate summaries and tags with @mux/ai and store them there. When you need both, the component’s queries return Mux data and your metadata together in one response.

Link
Things you need beforehand

  • Mux and Convex accounts
  • Mux Token ID
  • Mux Secret Key
  • Mux Webhook Secret

LinkGetting set up

Install the packages:

bash

npm install convex @mux/convex @mux/mux-node

Run the init script to generate the Convex config and webhook handler:

bash

npx @mux/convex init --component-name mux

This drops four files into your `convex/` directory: component config, a migrations file, a webhook handler, and an HTTP route that exposes the webhook endpoint. If you already have a convex.config.ts or http.ts, pass the flags `--skip-config` or `--skip-http` and wire things up manually.

Set your Mux credentials in convex:

bash

npx convex env set MUX_TOKEN_ID your-mux-token-id
npx convex env set MUX_TOKEN_SECRET your-mux-token-secret

Start the dev server and run the backfill to pull in your existing assets:

bash

npx convex dev
# in another terminal:
npx convex run migrations:backfillMux '{}'

Then create a webhook in the Mux Dashboard pointed at your Convex HTTP endpoint: https://your-deployment.convex.site/mux/webhook

Copy the signing secret, add it to your environment, and you're done:

bash

npx convex env set MUX_WEBHOOK_SECRET your-webhook-signing-secret

From here, every asset event Mux fires gets routed into your database automatically.

LinkQuerying your videos

The component exposes queries through components.mux. You wrap them in your own functions to control what your app actually exposes:

tsx

// convex/videoQueries.ts
import { query } from './_generated/server';
import { components } from './_generated/api';
import { v } from 'convex/values';

export const listAssets = query({
  handler: async (ctx) => {
    return await ctx.runQuery(components.mux.catalog.listAssets, {});
  },
});

export const getAsset = query({
  args: { muxAssetId: v.string() },
  handler: async (ctx, args) => {
    return await ctx.runQuery(components.mux.catalog.getAssetByMuxId, {
      muxAssetId: args.muxAssetId,
    });
  },
});

Call them from your React components using Convex's useQuery hook:

tsx

import { useQuery } from 'convex/react';
import { api } from '../convex/_generated/api';

function VideoLibrary() {
  const assets = useQuery(api.videoQueries.listAssets);

  if (!assets) return <div>Loading...</div>;

  return (
    <ul>
      {assets.map((asset) => (
        <li key={asset.muxAssetId}>
          {asset.muxAssetId}{asset.status}
        </li>
      ))}
    </ul>
  );
}

Let's take a second to admire Convex’s ease of use. There are no SQL queries, no need to change languages, and the way you can just import into a React component is a work of art on its own. As you can see from this example, the query is reactive. When a webhook comes in and updates an asset from preparing to ready, that change propagates to your UI automatically—no polling, no manual cache invalidation. It's the perfect developer’s "chef’s kiss."

LinkAll metadata is accepted here

The way this component is set up is so that the Mux-level data like playback IDs, duration, aspect ratio, and tracks comes in through webhooks automatically when a video is uploaded. Now the metadata is up to you, the developer. Like I was saying about my Robotube example, that app is hooked up with convex auth to get the uploaded user’s name, and mux/ai takes care of all the other metadata like summary, tags, chapters, and more. You'll also want to attach app context: who uploaded it, what it's called, whether it's public. That's what the videoMetadata table is for:

tsx

// convex/videoMutations.ts
import { mutation } from './_generated/server';
import { components } from './_generated/api';
import { v } from 'convex/values';

export const setVideoMetadata = mutation({
  args: {
    muxAssetId: v.string(),
    userId: v.string(),
    title: v.optional(v.string()),
    visibility: v.optional(
      v.union(v.literal('public'), v.literal('private'), v.literal('unlisted'))
    ),
    tags: v.optional(v.array(v.string())),
  },
  handler: async (ctx, args) => {
    await ctx.runMutation(components.mux.videos.upsertVideoMetadata, args);
  },
});

Once the metadata is set, videos.listVideosForUser (a convex function we packed in the component) returns the Mux asset data and your metadata together.

LinkCook up with this component

Convex and Mux come together like the perfect PB&J—the right amount of each spread for a seriously satisfying combo. We’re excited to see what you build with this component. Dig in, and stay tuned for the next course where we highlight how we used @mux/convex to build Robotube.

LinkCheck out these resources

Leave your wallet
where it is

No credit card required to get started.