Description
mpegts.js is an HTML5 player for MPEG2-TS and FLV streams, written in TypeScript and JavaScript. It is optimized for low latency live playback, such as DVB or ISDB television and surveillance cameras, and it is based on flv.js. It works by converting the MPEG2-TS stream into fragmented MP4 segments, then feeding those segments into a video element through the Media Source Extensions API. The player handles H.264 and H.265 video with AAC audio over HTTP or WebSocket, and it can also play .m2ts files in both 192 and 204 byte packet formats. The project supports Chrome, Firefox, Safari, Edge and Chromium based browsers, and version 1.8 adds support for iOS Safari 17.1 and later through Apple's ManagedMediaSource API. It can chase live latency by changing the playback rate, extracts PES private data such as ARIB B24 subtitles with the companion aribb24.js library, and reports timed ID3 metadata. Its latency is described as under one second in the best case, and it keeps CPU and memory use low. A standalone video server must send correct CORS headers, and the README links a demo and build steps. It is open source on GitHub.…
Highlights
- Plays MPEG2-TS and FLV live streams in the browser
- Low latency playback for TV and cameras
- H.264 and H.265 with AAC audio over HTTP or WebSocket
- Works on Chrome, Firefox, Safari and Edge, including iOS 17.1 and later
- ARIB subtitles and timed ID3 metadata
Ratings & Reviews
No ratings yet
Be the first to rate Mpegts.js.
People also visit
Mpegts.js FAQ
What is mpegts.js?
An HTML5 player for MPEG2-TS and FLV streams, for low latency live video in the browser.
What is it used for?
The README mentions DVB and ISDB television and surveillance cameras as typical live stream sources.
Which browsers work?
Chrome, Firefox, Safari, Edge and Chromium based browsers, with iOS Safari supported from iOS 17.1.
Do I need to set up anything on my server?
If the stream comes from a separate server, it must send the correct Access-Control-Allow-Origin header. The README links a CORS guide.
Which codecs are supported?
H.264 and H.265 video with AAC audio, plus Opus, FLAC and AC-3 audio in some formats, according to the news section.
Is it free?
Yes. It is open source and the code is on GitHub.
What are the best Mpegts.js alternatives?
Popular alternatives to Mpegts.js include Mediaelement, Jmuxer and Clappr. See all Mpegts.js alternatives


