A lightweight JavaScript video player with MPEG1/MP2 decoder for static files and low-latency WebSocket streaming.
JSMpeg is a JavaScript library that decodes and plays MPEG1 video and MP2 audio directly in the browser. It solves the problem of low-latency video streaming and playback without requiring browser plugins or modern codec support, making it ideal for real-time applications like live streaming or embedded video players.
Web developers needing lightweight, low-latency video playback in browsers, especially for real-time streaming applications, IoT projects (like Raspberry Pi webcam streaming), or environments where modern codecs are unavailable.
Developers choose JSMpeg for its minimal footprint, low-latency WebSocket streaming capability, and pure JavaScript implementation that works across all modern browsers without external dependencies.
MPEG1 Video Decoder in JavaScript
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Achieves ~50ms delay via WebSockets, making it ideal for real-time applications like live webcam feeds, as demonstrated in the Raspberry Pi example.
Weighs only 20kb gzipped, minimizing load times and bandwidth usage, which is highlighted in the README as a key efficiency feature.
Works in all modern browsers including Chrome, Firefox, Safari, and Edge without plugins, ensuring broad accessibility.
Supports instantiation via HTML attributes or JavaScript constructor with extensive configuration options, such as callbacks and buffer controls.
Offers optional WebAssembly decoders for improved performance on supported devices, enhancing decoding speed without bloating the core library.
Limited to MPEG1 video and MP2 audio, which are inefficient compared to modern codecs, requiring higher bitrates for acceptable quality.
Lacks a built-in buffered mode for smooth playback with exact timing, as the README admits this is 'conceivable but currently not implemented.'
Requires running separate Node.js WebSocket relay and ffmpeg encoding processes, increasing deployment and maintenance overhead.
High bitrates can strain JavaScript decoding, especially on mobile devices; the README advises capping at 540p and 2Mbit/s for reliable performance.