---
title: "Mux, Fly, Wocket and RTMP"
description: "Wocket is a proof-of-concept application for sending live video from a browser to an RTMP server, potentially avoiding a local encoder such as OBS or Ecamm Live. Built with Next.js and a custom WebSocket server, it captures webcam video, renders it onto a canvas, and uses ffmpeg to support streaming to a Mux live stream through an RTMP ingest URL. The post documents local setup with npm, production commands, and deployment to Fly.io via flyctl and a Dockerfile, while noting that ffmpeg must be available on the PATH. The intended integration uses the MediaRecorder API to send video when dataavailable fires. Mux test streams are limited to five minutes, watermarked, and deleted after 24 hours when no credit card is entered, and the author cautions against relying on the demo for important production workloads."
---

# Mux, Fly, Wocket and RTMP

[Fly.io](https://yomu.fyi/company/fly-io) · May 19, 2020

**Type:** Tutorial

## Summary

Wocket is a proof-of-concept application for sending live video from a browser to an RTMP server, potentially avoiding a local encoder such as OBS or Ecamm Live. Built with Next.js and a custom WebSocket server, it captures webcam video, renders it onto a canvas, and uses ffmpeg to support streaming to a Mux live stream through an RTMP ingest URL. The post documents local setup with npm, production commands, and deployment to Fly.io via flyctl and a Dockerfile, while noting that ffmpeg must be available on the PATH. The intended integration uses the MediaRecorder API to send video when dataavailable fires. Mux test streams are limited to five minutes, watermarked, and deleted after 24 hours when no credit card is entered, and the author cautions against relying on the demo for important production workloads.

## Context

Streaming to RTMP typically requires local encoder software such as OBS or Ecamm Live. Wocket demonstrates how browser-based streaming might work instead, using a Mux live streaming API endpoint rather than streaming directly to platforms such as Twitch, YouTube Live, or Facebook Live.

## Approach / What changed

Wocket uses Next.js, a custom WebSocket server, the browser webcam, a canvas element, the MediaRecorder API, and ffmpeg to send video to a Mux RTMP ingest URL. The server can be run locally or built and deployed to Fly.io with flyctl and a Dockerfile.

## Takeaways

- The browser demo accesses the webcam, renders video onto a canvas, and streams it to a Mux live stream after the user enters a stream key.
- Local setup requires ffmpeg to be installed and available in PATH, followed by npm install and npm run dev for development.
- Without a credit card, Mux live streams are limited to five minutes, watermarked with the Mux logo, and deleted after 24 hours.

**Tags:** [Fly.io](https://yomu.fyi/topic/fly-io), [Video](https://yomu.fyi/topic/video)

- Source: [Fly.io](https://fly.io/blog/mux-fly-wocket-and-rtmp)
- Source URL: https://fly.io/blog/mux-fly-wocket-and-rtmp
- Ingested by Yomu: 2026-09-02T11:57:49.308Z

[Read original post](https://fly.io/blog/mux-fly-wocket-and-rtmp)
