Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mdilshan/simple-mjpeg-decoder-js

A simple MJPEG decoder created with vanilla javascript
https://github.com/mdilshan/simple-mjpeg-decoder-js

javascript javascript-generators mjpeg-decoder mjpeg-stream streaming teaching-materials

Last synced: 3 days ago
JSON representation

A simple MJPEG decoder created with vanilla javascript

Awesome Lists containing this project

README

        

### A Simple MJPEG decoder created with vanilla javascript.

> Note: This decoder is created to teach javascript to beginers so it might not production ready and may have performance issues.

#### Content

- `/server` contains a express server which serve mjpeg stream.
- `/server/media30fps` contains frames from a sample video. I used ffmpeg to generate the frames from a mp4 video.

You can also generate frames using,

```ffmpeg -i input.mp4 -vf "fps=10" -q:v 1 output_%04d.jpg```

You can get the fps of the video using,

```ffprobe -select_streams v:0 -show_entries stream=r_frame_rate sample.mp4```

#### Run the project

To start the project, run the `server/server.js` file using node,

```node server/server.js```

Then start the client side code using `live-server` or using any other development server.