Live streaming
Create a live stream from your code, push to it over RTMP, SRT or WHIP, and play it anywhere.
import { Crumbcast } from "crumbcast"; const crumbcast = new Crumbcast({ token: process.env.CRUMBCAST_TOKEN, baseUrl: "https://your-crumbcast",}); const stream = await crumbcast.live.createLiveStream({ project_id: projectId, liveStreamCreateRequest: { title: "Weekly show", latency: "low", },}); // Where the encoder pushes to: OBS's server and keyconst { rtmp_url, stream_key } = stream.ingest; // And where viewers watch, the same every broadcastconst embed = `https://your-crumbcast/embed/live/${stream.id}`;import os from crumbcast import Crumbcast crumbcast = Crumbcast( token=os.environ["CRUMBCAST_TOKEN"], base_url="https://your-crumbcast",) stream = crumbcast.live.create_live_stream( project_id, body={"title": "Weekly show", "latency": "low"},) # Where the encoder pushes to: OBS's server and keyrtmp_url = stream["ingest"]["rtmp_url"]stream_key = stream["ingest"]["stream_key"] # And where viewers watch, the same every broadcastembed = f"https://your-crumbcast/embed/live/{stream['id']}"use Crumbcast\Crumbcast; $crumbcast = new Crumbcast( token: getenv('CRUMBCAST_TOKEN'), baseUrl: 'https://your-crumbcast',); $stream = $crumbcast->live->createLiveStream($projectId, [ 'title' => 'Weekly show', 'latency' => 'low',]); // Where the encoder pushes to: OBS's server and key['rtmp_url' => $rtmpUrl, 'stream_key' => $streamKey] = $stream['ingest']; // And where viewers watch, the same every broadcast$embed = "https://your-crumbcast/embed/live/{$stream['id']}";const api = "https://your-crumbcast/api/v1";const headers = { Authorization: `Bearer ${process.env.CRUMBCAST_TOKEN}`, "Content-Type": "application/json",}; const stream = await fetch(`${api}/projects/${projectId}/live-streams/`, { method: "POST", headers, body: JSON.stringify({ title: "Weekly show", latency: "low" }),}).then((response) => response.json()); // Where the encoder pushes to: OBS's server and keyconst { rtmp_url, stream_key } = stream.ingest; // And where viewers watch, the same every broadcastconst embed = `https://your-crumbcast/embed/live/${stream.id}`;What you get
- One place for every broadcastIts ingest, stream key, watch page and player stay the same from one broadcast to the next.
- Any encoderOBS, hardware encoders, SRT, or WebRTC through WHIP.
- Recorded as videosEach broadcast becomes a video of the project when it ends.
- SimulcastEach broadcast on to YouTube, Twitch or any RTMP server at the same time.