> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Building with Video

> How to build video applications on Livepeer: live streaming, VOD, and transcoding, using the livepeer SDK and the go-livepeer broadcaster gateway.

export const TableCell = ({children, align = "left", header = false, style = {}, className = "", ...rest}) => {
  const Component = header ? "th" : "td";
  return <Component className={className} style={{
    padding: "0.75rem 1rem",
    textAlign: align,
    border: header ? "none" : "1px solid var(--lp-color-border-default)",
    ...style
  }} {...rest}>
      {children}
    </Component>;
};

export const TableRow = ({children, header = false, hover = false, style = {}, className = "", ...rest}) => {
  const rowId = `table-row-${Math.random().toString(36).substr(2, 9)}`;
  return <>
      {hover && <style>{`
          #${rowId}:hover {
            background-color: var(--lp-color-bg-card);
          }
        `}</style>}
      <tr id={rowId} className={className} style={{
    ...header && ({
      backgroundColor: "var(--lp-color-accent-strong)",
      color: "var(--lp-color-on-accent)",
      fontWeight: "bold"
    }),
    ...style
  }} {...rest}>
        {children}
      </tr>
    </>;
};

export const StyledTable = ({children, variant = "default", style = {}, className = "", ...rest}) => {
  const wrapperVariants = {
    default: {
      border: "1px solid var(--lp-color-border-default)",
      backgroundColor: "var(--lp-color-bg-card)",
      overflow: "hidden"
    },
    bordered: {
      border: "2px solid var(--lp-color-accent)",
      backgroundColor: "var(--lp-color-bg-page)",
      overflow: "hidden"
    },
    minimal: {
      border: "none",
      backgroundColor: "transparent",
      overflow: "visible"
    }
  };
  return <div data-docs-styled-table-shell className={className} style={{
    width: "100%",
    padding: 0,
    margin: 0,
    ...wrapperVariants[variant],
    ...style
  }} {...rest}>
      <table data-docs-styled-table style={{
    width: "100%",
    borderCollapse: "collapse",
    borderSpacing: 0,
    margin: 0,
    backgroundColor: "transparent"
  }}>
        {children}
      </table>
    </div>;
};

export const CenteredContainer = ({children, maxWidth = "800px", padding = "0", preset = "default", width = "", minWidth = "", marginRight = "", marginBottom = "", textAlign = "", style = {}, className = "", ...rest}) => {
  const presets = {
    default: {},
    fitContent: {
      width: "fit-content",
      minWidth: "fit-content"
    },
    readable70: {
      width: "70%",
      minWidth: "fit-content"
    },
    readable80: {
      width: "80%",
      minWidth: "fit-content"
    },
    readable90: {
      width: "90%"
    },
    wide900: {
      maxWidth: "900px"
    }
  };
  const presetStyle = presets[preset] || presets.default;
  return <div className={className} style={{
    maxWidth: presetStyle.maxWidth || maxWidth,
    margin: "0 auto",
    padding: padding,
    ...presetStyle.width ? {
      width: presetStyle.width
    } : {},
    ...presetStyle.minWidth ? {
      minWidth: presetStyle.minWidth
    } : {},
    ...width ? {
      width
    } : {},
    ...minWidth ? {
      minWidth
    } : {},
    ...marginRight ? {
      marginRight
    } : {},
    ...marginBottom ? {
      marginBottom
    } : {},
    ...textAlign ? {
      textAlign
    } : {},
    ...style
  }} {...rest}>
      {children}
    </div>;
};

export const CustomDivider = ({color = "var(--lp-color-border-default)", middleText = "", spacing = "default", style = {}, className = "", ...rest}) => {
  const spacingPresets = {
    default: {
      margin: "24px 0"
    },
    overlap: {
      margin: "-1rem 0 -1rem 0"
    },
    tight: {
      margin: "0 0 -1rem 0"
    },
    section: {
      margin: "0 0 -2rem 0"
    },
    sectionOverlap: {
      margin: "-1rem 0 -2rem 0"
    },
    deepOverlap: {
      margin: "-1rem 0 -1.5rem 0"
    }
  };
  const spacingStyle = spacingPresets[spacing] || spacingPresets.default;
  return <div role="separator" aria-orientation="horizontal" className={className} style={{
    display: "flex",
    alignItems: "center",
    ...spacingStyle,
    fontSize: style?.fontSize || "16px",
    height: "fit-content",
    ...style
  }} {...rest}>
      <span style={{
    marginRight: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
      </span>
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      {middleText && <>
          <Icon icon="circle" size={2} />
          <span style={{
    margin: "0 8px",
    fontWeight: "bold",
    color: color,
    opacity: 0.7
  }}>
            {middleText}
          </span>
          <Icon icon="circle" size={2} />
        </>}
      <div style={{
    flex: 1,
    height: "1px",
    background: "var(--lp-color-border-default)",
    opacity: 0.4
  }}></div>
      <span style={{
    marginLeft: "var(--lp-spacing-px-8)",
    opacity: 0.2
  }}>
        <span style={{
    display: "inline-block",
    transform: "scaleX(-1)"
  }}>
          <Icon icon="/snippets/assets/logos/Livepeer-Logo-Symbol-Theme.svg" />
        </span>
      </span>
    </div>;
};

export const LinkArrow = ({href, label, description, newline = true, borderColor, className = '', style = {}, ...rest}) => {
  const linkArrowStyle = {
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    gap: "var(--lp-spacing-1)",
    width: 'fit-content',
    ...borderColor && ({
      borderColor
    })
  };
  return <span className={className} style={style} {...rest}>
      {newline && <br />}
      <span style={linkArrowStyle}>
        <a href={href} target="_blank" rel="noopener noreferrer">
          {label}
        </a>
        <Icon icon="arrow-up-right" size={14} color="var(--lp-color-accent)" />
      </span>
      {description && description}
      {description && <div style={{
    height: "var(--lp-spacing-3)"
  }} />}
    </span>;
};

<CenteredContainer preset="readable90">
  <Tip>Livepeer handles the transcoding and delivery layer. Your application sends video in, receives playback URLs out, and the network routes frames through a decentralised set of GPU-equipped Orchestrators.</Tip>
</CenteredContainer>

***

Livepeer's video infrastructure separates ingest, transcoding, and delivery into distinct layers accessible at different abstraction levels. A developer building a live streaming feature can use the `livepeer` JavaScript or Python SDK against the Livepeer API, or operate a go-livepeer broadcaster Gateway node for direct network access with custom routing and pricing.

The three primary video workloads are live streams, video-on-demand (VOD) assets, and direct transcoding. All three go through the same underlying network: Gateway nodes receive video segments, route them to Orchestrators, and return transcoded output.

<CustomDivider />

## Live Streams

A live stream in Livepeer is a named object with an RTMP ingest endpoint and an HLS playback URL. The broadcaster Gateway accepts an RTMP push from OBS, FFmpeg, or any RTMP-capable encoder, segments the stream, and routes segments to the network for transcoding.

The `livepeer` SDK creates and manages stream objects via the Livepeer API:

```javascript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
import { Livepeer } from 'livepeer';

const client = new Livepeer({ apiKey: '<YOUR_API_KEY>' });

const stream = await client.stream.create({
  name: 'my-livestream',
  profiles: [
    { name: '720p', bitrate: 3000000, fps: 30, width: 1280, height: 720 },
    { name: '360p', bitrate: 1000000, fps: 30, width: 640, height: 360 },
  ],
});

console.log(stream.stream.rtmpIngestUrl);   // push here from OBS/FFmpeg
console.log(stream.stream.playbackUrl);     // HLS playback URL
```

See <LinkArrow href="/v2/developers/build/video/ingest-and-playback" label="Ingest" newline={false} /> for ingest configuration, webhook setup, and stream key management.

## VOD Assets

VOD assets are uploaded video files that Livepeer transcodes into ABR HLS for playback. The SDK supports direct upload and upload-via-URL:

```javascript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
const asset = await client.asset.createViaUrl({
  name: 'my-video',
  url: 'https://example.com/source.mp4',
});
```

After transcoding, the asset has a `playbackId` usable with the `@livepeer/react` Player component or any HLS player.

See <LinkArrow href="/v2/developers/build/video/vod-and-recording" label="VOD" newline={false} /> for upload, status polling, and playback integration.

## Direct Transcoding

For applications that manage their own segmented video and need only the transcoding step, the go-livepeer broadcaster Gateway exposes an HTTP endpoint that accepts segments and returns transcoded output. This is the lowest-level integration point and the path LPMS embeds.

See <LinkArrow href="/v2/developers/build/video/transcoding-direct-quickstart" label="Transcoding" newline={false} /> for the segment submission API and profile configuration.

<CustomDivider />

## Access Paths

<StyledTable variant="bordered">
  <thead>
    <TableRow header>
      <TableCell header>Path</TableCell>
      <TableCell header>What it provides</TableCell>
      <TableCell header>Best for</TableCell>
    </TableRow>
  </thead>

  <tbody>
    <TableRow>
      <TableCell>**Livepeer API + SDK**</TableCell>
      <TableCell>Managed streams, asset storage, playback URLs, webhooks, analytics</TableCell>
      <TableCell>Applications that want video features without operating infrastructure</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>**go-livepeer broadcaster Gateway**</TableCell>
      <TableCell>Network-direct transcoding, custom Orchestrator selection, direct ETH payments</TableCell>
      <TableCell>Platform builders who need pricing control and want to route traffic directly</TableCell>
    </TableRow>

    <TableRow>
      <TableCell>**LPMS (Go library)**</TableCell>
      <TableCell>Embeddable media server: RTMP ingest, HLS output, GPU transcoding API</TableCell>
      <TableCell>Go applications building custom media server logic on top of Livepeer</TableCell>
    </TableRow>
  </tbody>
</StyledTable>

<CustomDivider />

## Livepeer SDK

The `livepeer` JavaScript SDK (`npm install livepeer`) and `livepeer` Python SDK (`pip install livepeer`) both wrap the Livepeer REST API. They cover streams, assets, webhooks, playback policies, access control, and viewership metrics.

The current JavaScript SDK version is 3.5.0. The Python SDK is `pip install livepeer`.

Both SDKs are generated from the Livepeer OpenAPI specification at `api/openapi.yaml` in the docs repository.

<CustomDivider />

## Related Pages

<CardGroup cols={2}>
  <Card title="Ingest" icon="broadcast" href="/v2/developers/build/video/ingest-and-playback" arrow horizontal>
    RTMP ingest configuration, stream keys, and webhook event handling.
  </Card>

  <Card title="VOD" icon="film" href="/v2/developers/build/video/vod-and-recording" arrow horizontal>
    Asset upload, transcoding profiles, and HLS playback URL generation.
  </Card>

  <Card title="Transcoding" icon="cpu" href="/v2/developers/build/video/transcoding-direct-quickstart" arrow horizontal>
    Direct segment transcoding via the broadcaster Gateway and LPMS.
  </Card>

  <Card title="LPMS" icon="server" href="/v2/developers/build/video/lpms-integration" arrow horizontal>
    Livepeer Media Server: embeddable Go library for RTMP-in, HLS-out pipelines.
  </Card>
</CardGroup>
