https://github.com/runabol/vidproxy
https://github.com/runabol/vidproxy
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/runabol/vidproxy
- Owner: runabol
- Created: 2023-12-07T16:12:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-07T16:41:13.000Z (about 2 years ago)
- Last Synced: 2024-04-16T12:43:23.888Z (over 1 year ago)
- Language: JavaScript
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Video Proxy
Node server to transcode video files and stream on the fly via HLS.
#### Note: requires **[ffmpeg](http://ffmpeg.org)**
### What is the problem?
Streaming videos of any format on demand with seeking.
### How to achieve this?
Using FFmpeg and HTTP Live Streaming (HLS) protocol.
Generate the full `.m3u8` playlist immediately so the client behaves as if the entire video is ready to play. In order to make the playlist ahead of time we need to set a static segment length. When the client seeks to a portion of the video that has not been transcoded yet, we cancel the current job and start a new one.
## How it Works
1. Receive request to start stream session (i.e. `localhost:4000/stream/name-of-movie.mkv`)
2. Get metadata from video file using FFprobe
3. Use file metadata & client limitations to determine how the video will be transcoded (or if)
4. Generate `.m3u8` playlists
5. Start the FFmpeg job of remuxing video to HLS
6. Listen for `.m3u8` and `.ts` requests from client player (HLS.js)
## License
[MIT](https://choosealicense.com/licenses/mit/)