MJPEG streaming through HTTP in Node.js / Total.js
A simple controller's action for streaming MJPEG data via HTTP with the help of the Total.js framework in Node.js Platform.
MJPEG (HTTP) streaming in Node.js / Total.js
Streaming of MJPEG is effortless in the Total.js framework. So you need to receive the buffer
with the JPEG image from your e.g., IP camera.
Create a controller /controllers/mjpeg.js
:
Receiving MJPEG buffer and resend to all clients
You will need to declare your source from where you obtain MJPEG data. This is only an example, how to send MJPEG buffer
to all web clients:
Usage on client-side (HTML)
Good to know
/mjpeg/
endpoint keeps open all connections- easy to convert this code to
WebSocket
Other posts from Total.js Platform
- 2024-11-13Benchmarking Node.js Frameworks: selecting your framework for 2025!
- 2024-11-01October report 2024
- 2024-10-22Performance Testing: Total.js vs. NestJS
- 2024-10-01September report 2024
- 2024-09-27Total.js UI Builder: #2 designing your first interface
- 2024-09-26Total.js V5: Middlewares
- 2024-09-23Beginner Guide to Total.js UI: # 05 Client-side routing
- 2024-09-23Total.js UI #4: Data Binding (Part 2 – Practical Example)
- 2024-09-20Introduction to Total.js UI Builder: A Beginner’s Guide
- 2024-09-13Total.js v5: #06 Understanding File Routing