Avatar

mux

Your friendly, neighborhood video API.
Joined February 23, 2024
Public vals
6
mux avatar
createDubbingTestAsset
@mux
Script
An interactive, runnable TypeScript val by mux
mux avatar
seiveDubbing
@mux
HTTP (deprecated)
Dub Mux Videos using Sieve This Val exposes an HTTP endpoint that takes a Mux Asset ID and a list of languages, creates dubbed versions of the audio tracks using Sieve , then adds those dubbed audio tracks back to the Mux asset as new audio tracks. Usage: Required environment variables: Sieve API token ( SIEVE_API_KEY ) Mux Access token details ( MUX_TOKEN_ID , MUX_TOKEN_SECRET ) This endpoint requires an existing Mux asset that's ready with an audio-only static rendition associated with it. You can run this val to create a new one for testing. Make a POST request to the Val's endpoint with the following body, replacing the values with your own asset ID and the list of languages you want to create. { "asset_id": "00OZ8VnQ01wDNQDdI8Qw3kf01FkGTtkMq2CW901ltq64Jyc", "languages": ["es", "fr", "nl"] } Limitations This is just a demo, so it's obviously not battle hardened. The biggest issue is that it does this whole process synchronously, so if the Sieve dubbing process takes longer than the Val's timeout, you're hosed.
mux avatar
dubLinkMaker
@mux
HTTP (deprecated)
Dub Shortlink Slackbot We started using dub.co for shortlinks at Mux, so we made a quick Slackbot to make it easier! Usage Fork this thing to your account Set up a Slack bot/app and have the webhooks point at your forked Val Add the following environment variables to Val.town: DUB_API_KEY your Dub API key DUB_WORKSPACE_ID your Dub workspace ID SLACK_MUX_LINK_SIGNING_SECRET Signing secret for the app you created Update the LINK_DOMAIN variable to be the one you want to use (needs to be set up in Dub, of course) Use the command you created in your Slack app! For us, it looks like this: /mux.link https://example.com neat-example This is a quick link for an example.
mux avatar
webhookHandler
@mux
HTTP (deprecated)
Mux Webhook Handler Fork this sucker and point your Mux Webhooks at it to save them to a SQLite DB. Expects the MUX_WEBHOOK_SECRET_STREAMDOTNEW to include your Mux webhook signing secret to validate webhook requests.
mux avatar
videoStorage
@mux
Script
Video Storage Intended to be imported into other Vals and used with Mux Webhooks (like our webhookHandler . Stores videos off into Sqlite. Webhook handlers At least these are how we use them in the webhookHandler | Function | Mux Event | Note | |------------------|-------------------|-------------------------------| | createVideo() | video.upload.created | Triggered when a direct upload is initially created | | updateVideoCreated() | video.upload.asset_created | Triggered when an asset is created | | updateVideoReady() | video.asset.ready | An asset is ready for playback | Others getAllVideos Lists all the videos in the database backfillVideo Takes a video object and puts it in the DB. Useful if you're iterating over to...you guessed it, backfill content.
mux avatar
youTubeCommentWatcher
@mux
Cron
YouTube Comment Watcher Only a few people on the team were getting the comment updates from YouTube, but we wanted everyone to see them just in case. This monitors all the YouTube videos in our channel and sends out an email whenever we get a new comment so the team can pop in if they need to. Usage Set the environment variables for YOUTUBE_API_KEY and YOUTUBE_CHANNEL_ID Fork this Go
Next