hevc-playerv0.4.0

Play RTSP in the browser — H.264 / H.265 + AAC

npm
Video appears here after Play

Use the package in your app

This demo site is built on hevc-player 0.4.0. Install it, start the bundled gateway, paste an RTSP URL, and play video with synchronized AAC audio.

Install & start gateway

npm install hevc-player@0.4.0
npx hevc-player-copy-assets public
npx hevc-player gateway --port 3002

Open RTSP → play video + audio

import {
  createStreamPlayer,
  createRemuxSession,
  preloadHevcPlayer,
} from "hevc-player";

await preloadHevcPlayer();

// 1) Register RTSP with the package gateway (video copy + audio → AAC)
const streamUrl = await createRemuxSession("rtsp://camera/stream", {
  gatewayUrl: "", // same-origin /v1 proxy
});

// 2) Play MPEG-TS in the browser (WASM H.264/H.265 + AAC)
const player = await createStreamPlayer(container, {
  url: streamUrl,
  live: true,
  mode: "software",
  audio: true,  // default — decode audio when present
  muted: true,  // start muted; unmute from a click
});

// 3) Unlock sound from a user gesture (browser autoplay policy)
soundButton.onclick = async () => {
  await player.setMuted(!player.isMuted());
};

What the package gives you

  • WASM player

    Software H.264 / H.265 + AAC decode — works without GPU HEVC.
  • RTSP gateway

    hevc-player gateway remuxes video (copy) and camera audio to AAC.
  • React helper

    Optional HevcPlayerView from hevc-player/react with audio / muted.

Full docs: npmjs.com/package/hevc-player

How to play RTSP in a browser (H.264 & H.265)

Searching for an RTSP player in the browser, an H.265 / HEVC web player, or a way to stream an IP camera in Chrome? Browsers block raw RTSP. This live demo shows a practical path: remux the camera with the hevc-player gateway, then decode H.264 / H.265 and AAC in-page with WebAssembly.

Why “play RTSP in browser” needs a gateway

IP cameras and NVRs almost always expose rtsp:// for live view. That protocol is perfect for VLC and recorders, but web pages expect HTTP or WebRTC. Converting RTSP → MPEG-TS (video copy, audio to AAC) keeps latency low without re-encoding video, then the WASM player renders frames in any modern browser—including cameras that only offer H.265.

Who this RTSP web player is for

  • Developers & integrators

    Build an IP camera web viewer or live wall with an npm package instead of a custom FFmpeg pipeline.
  • Security & IoT teams

    Preview H.264 / H.265 RTSP feeds in Chrome or Edge without installing a desktop RTSP client for every operator.
  • HEVC troubleshooting

    When “H.265 RTSP not working” in a browser path, WASM decode avoids depending on scarce native HEVC support.
  • npm package evaluators

    Try hevc-player on npm end-to-end before wiring it into React or Next.js.

RTSP browser player FAQ

Can browsers play RTSP directly?
No. Chrome, Firefox, Safari, and Edge cannot open an rtsp:// URL in a normal <video> tag. You need a small server-side gateway that turns RTSP into something the browser understands (HTTP MPEG-TS, HLS, or WebRTC). This demo uses the hevc-player gateway for that step.
How do I play an RTSP stream in the browser?
Paste your camera’s RTSP URL above and click Play, or install the hevc-player npm package, run npx hevc-player gateway, call createRemuxSession with the camera URL, then createStreamPlayer with the returned MPEG-TS URL.
Will H.265 / HEVC work in Chrome without plugins?
Yes on this stack. hevc-player ships WASM (WebAssembly) decoders for H.265 and H.264, so you are not limited to browsers with native HEVC. Audio is normalized to AAC for playback.
What is the difference between an RTSP player and a browser player?
A desktop RTSP player (VLC, Onvif tools) speaks RTSP natively. A browser player needs HTTP or WebRTC. hevc-player bridges both: the gateway speaks RTSP to the camera; the page speaks MPEG-TS over HTTP to WASM.
Why does my IP camera work on localhost but not on a hosted site?
Private addresses like 192.168.1.x are only reachable on your LAN. The hosted gateway runs in the cloud and cannot open that RTSP path unless you VPN, tunnel, or run the gateway on a machine that shares the camera’s network.

Related searches this page targets: play RTSP in browser, RTSP player browser, H.265 browser player, HEVC web player, stream IP camera in browser, RTSP H.264 H.265 WASM player.