Skip to main content

Documentation Index

Fetch the complete documentation index at: https://na-36-handover-docs-v2-into-docs-v2-dev-20260518.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.


Livepeer accepts live video via RTMP. A stream object holds the ingest configuration, transcoding profiles, and generates the HLS playback URL. The stream key embedded in the ingest URL authenticates the push; only a client with the correct key can publish to that stream.

Stream Creation

Create a stream via the SDK:
import { Livepeer } from 'livepeer';

const client = new Livepeer({ apiKey: process.env.LIVEPEER_API_KEY });

const { stream } = await client.stream.create({
  name: 'event-stream-2026',
  profiles: [
    { name: '1080p', bitrate: 6000000, fps: 30, width: 1920, height: 1080 },
    { name: '720p',  bitrate: 3000000, fps: 30, width: 1280, height:  720 },
    { name: '360p',  bitrate: 1000000, fps: 30, width:  640, height:  360 },
  ],
  record: false,
});

console.log(stream.rtmpIngestUrl);  // rtmp://rtmp.livepeer.com/live/<streamKey>
console.log(stream.streamKey);      // the key embedded in the ingest URL
console.log(stream.playbackUrl);    // HLS playback, e.g. https://livepeercdn.com/hls/<playbackId>/index.m3u8
The same operation in Python:
from livepeer import Livepeer
from livepeer.models import components

client = Livepeer(api_key=os.environ['LIVEPEER_API_KEY'])

result = client.stream.create(components.NewStreamPayload(
    name='event-stream-2026',
    profiles=[
        components.FfmpegProfile(
            name='720p', bitrate=3000000, fps=30, width=1280, height=720,
        ),
    ],
))
stream = result.stream

Pushing a Stream

Point OBS to the ingest URL and stream key:
  • Server: rtmp://rtmp.livepeer.com/live
  • Stream Key: value of stream.streamKey
With FFmpeg:
ffmpeg -re -i input.mp4 \
  -c:v libx264 -preset veryfast -b:v 3000k \
  -c:a aac -b:a 128k \
  -f flv rtmp://rtmp.livepeer.com/live/<streamKey>
The go-livepeer broadcaster gateway also accepts RTMP on port 1935 when running in broadcaster mode, routing segments directly through the Livepeer network without a managed API layer.

Transcoding Profiles

Each profile in the profiles array defines one output rendition. The Livepeer network transcodes the ingest stream into each requested profile in parallel. Profile fields:
FieldTypeDescription
namestringLabel for this rendition (e.g. 720p)
bitrateintegerTarget video bitrate in bits per second
fpsintegerOutput frames per second
widthintegerOutput width in pixels
heightintegerOutput height in pixels
profilestringH.264 encoder profile: H264Baseline, H264Main, H264High, H264ConstrainedHigh
gopstringGOP length in seconds, or "intra" for all-intra
The HLS manifest at stream.playbackUrl lists all renditions. ABR players select the appropriate rendition based on available bandwidth.

Stream Events

Livepeer fires webhooks on stream lifecycle events. Subscribe to events when creating a stream:
const { stream } = await client.stream.create({
  name: 'event-stream',
  profiles: [...],
  playbackPolicy: {
    type: 'webhook',
    webhookId: '<your-webhook-id>',
    webhookContext: { userId: 'user-123' },
  },
});
Or create a webhook subscription separately:
const webhook = await client.webhook.create({
  name: 'stream-events',
  url: 'https://your-app.example.com/livepeer-webhook',
  events: ['stream.started', 'stream.idle', 'stream.recording.ready'],
});
Key stream events:
EventFires when
stream.startedFirst RTMP frame received; transcoding begins
stream.idleNo RTMP data for 60 seconds
stream.recording.readyRecording asset is ready (if record: true)
All webhook payloads are signed with an HMAC-SHA256 signature using your webhook secret. Verify the Livepeer-Signature header before processing events.

VOD

Upload and transcode video-on-demand assets via the same SDK.

Video Overview

Access paths and workload comparison for Livepeer video.

Transcoding

Direct transcoding for applications managing their own segments.

Player

Embed the @livepeer/react Player component to play back HLS streams.
Last modified on May 19, 2026