Spaces:
Running
Running
urstark commited on
Commit Β·
1fd13a0
1
Parent(s): 05ce22a
docs: Update README.md and add STRUCTURE.md
Browse files- README.md +92 -23
- STRUCTURE.md +45 -0
README.md
CHANGED
|
@@ -1,30 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
|
| 16 |
-
* **Developer:** urstarkz
|
| 17 |
-
* **Website:** [urstark.is-a.dev](https://urstark.is-a.dev)
|
| 18 |
-
* **Telegram:** [t.me/urstarkz](https://t.me/urstarkz)
|
| 19 |
-
* **Instagram:** [@urstarkz](https://instagram.com/urstarkz)
|
| 20 |
|
| 21 |
-
##
|
| 22 |
-
* Direct MKV proxy streaming
|
| 23 |
-
* Zero-latency HEVC/H.264 handling
|
| 24 |
-
* Offline capability for local files
|
| 25 |
-
* Theater mode with auto-hiding UI
|
| 26 |
-
* Subtitle parsing & track switching
|
| 27 |
-
* Glassmorphism cinematic design
|
| 28 |
|
| 29 |
-
|
| 30 |
-
Can be deployed via Docker or a standard Node.js server.
|
|
|
|
| 1 |
+
<div align="center">
|
| 2 |
+
|
| 3 |
+
<h1>NovaStream</h1>
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<strong>A powerful, offline-capable browser media player with cinematic glassmorphism design.</strong>
|
| 7 |
+
</p>
|
| 8 |
+
|
| 9 |
+
<p align="center">
|
| 10 |
+
Stream direct URLs, play large local MKV files with advanced HEVC hardware decoding, and convert subtitles on the fly with a sleek, theater-grade interface.
|
| 11 |
+
</p>
|
| 12 |
+
|
| 13 |
+
<div align="center">
|
| 14 |
+
<img src="https://img.shields.io/badge/Node.js-Express-68a063?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js" />
|
| 15 |
+
<img src="https://img.shields.io/badge/React-Vite-61dafb?style=for-the-badge&logo=react&logoColor=black" alt="React" />
|
| 16 |
+
<img src="https://img.shields.io/badge/License-GPL%203.0-blue?style=for-the-badge&logo=open-source-initiative&logoColor=white" alt="GPL 3.0" />
|
| 17 |
+
<img src="https://img.shields.io/badge/FFmpeg-Transmuxing-ff4f00?style=for-the-badge&logo=ffmpeg&logoColor=white" alt="FFmpeg" />
|
| 18 |
+
</div>
|
| 19 |
+
</div>
|
| 20 |
+
|
| 21 |
+
<hr />
|
| 22 |
+
|
| 23 |
+
## β¨ Features
|
| 24 |
+
|
| 25 |
+
- **Direct MKV Proxy Streaming**: Seamlessly stream remote MKV files right within the browser without having to download them completely.
|
| 26 |
+
- **Zero-Latency HEVC/H.264 Handling**: Native support for high-efficiency video coding. Hardware decoding for crisp, lag-free playback.
|
| 27 |
+
- **Offline Capability**: Directly stream large local files from your server or through the browser sandbox.
|
| 28 |
+
- **On-the-fly Transmuxing**: Real-time conversion of MKV containers using FFmpeg backend integration. Supports real-time HEVC to H.264 transcoding fallback.
|
| 29 |
+
- **Subtitle Parsing & Track Switching**: Automatically converts standard SRT subtitle files to WebVTT on the fly. Switch between multiple embedded audio tracks effortlessly.
|
| 30 |
+
- **Cinematic Theater Mode**: An immersive, auto-hiding UI wrapped in a premium Glassmorphism design language.
|
| 31 |
+
- **Real-Time Telemetry**: Monitor bandwidth speed and buffer health instantly with the built-in speedometer.
|
| 32 |
+
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
## π οΈ Tech Stack & Architecture
|
| 36 |
+
|
| 37 |
+
- **Frontend**: React 19, Vite, Lucide Icons. Pure custom CSS for dynamic cinematic and glassmorphic aesthetics.
|
| 38 |
+
- **Backend**: Node.js, Express.js. Handles URL probing, CORS bypassing, direct stream proxying, and spawns FFmpeg processes for real-time transmuxing.
|
| 39 |
+
- **Transmuxer Engine**: FFmpeg is utilized to map video and audio streams seamlessly to browser-compatible fragmented MP4.
|
| 40 |
+
|
| 41 |
+
Check out our [STRUCTURE.md](STRUCTURE.md) for a detailed breakdown of the codebase and file structure.
|
| 42 |
+
|
| 43 |
---
|
| 44 |
+
|
| 45 |
+
## π Deployment & Installation
|
| 46 |
+
|
| 47 |
+
NovaStream can be deployed natively using Node.js or easily containerized with Docker.
|
| 48 |
+
|
| 49 |
+
### Prerequisites
|
| 50 |
+
- Node.js (v18+)
|
| 51 |
+
- FFmpeg installed and available in the system PATH.
|
| 52 |
+
|
| 53 |
+
### Standard Node.js Setup
|
| 54 |
+
|
| 55 |
+
1. **Clone the repository:**
|
| 56 |
+
```bash
|
| 57 |
+
git clone https://github.com/urstark/NovaStream.git
|
| 58 |
+
cd NovaStream
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
2. **Install dependencies:**
|
| 62 |
+
```bash
|
| 63 |
+
npm install
|
| 64 |
+
```
|
| 65 |
+
*(Note: For development, use `npm run dev` to start concurrently)*
|
| 66 |
+
|
| 67 |
+
3. **Build the Frontend:**
|
| 68 |
+
```bash
|
| 69 |
+
npm run build
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
4. **Start the Server:**
|
| 73 |
+
```bash
|
| 74 |
+
npm start
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
The application will be running on port `7860` (or `process.env.PORT`).
|
| 78 |
+
|
| 79 |
+
### Docker Setup
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
docker build -t novastream .
|
| 83 |
+
docker run -p 7860:7860 novastream
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
---
|
| 87 |
|
| 88 |
+
## π¨βπ» Developer Credits
|
| 89 |
|
| 90 |
+
- **Developer:** [urstarkz](https://github.com/urstark)
|
| 91 |
+
- **Website:** [urstark.is-a.dev](https://urstark.is-a.dev)
|
| 92 |
+
- **Telegram:** [t.me/urstarkz](https://t.me/urstarkz)
|
| 93 |
+
- **Instagram:** [@urstarkz](https://instagram.com/urstarkz)
|
| 94 |
|
| 95 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
+
## βοΈ License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
+
NovaStream is open-source software licensed under the **GPL-3.0 License**. See the [LICENSE](LICENSE) file for more details.
|
|
|
STRUCTURE.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ποΈ Project Structure
|
| 2 |
+
|
| 3 |
+
NovaStream is built on a hybrid architecture, combining a highly interactive React frontend with a robust Node.js streaming proxy backend.
|
| 4 |
+
|
| 5 |
+
Below is an overview of the core file structure and components:
|
| 6 |
+
|
| 7 |
+
```text
|
| 8 |
+
NovaStream/
|
| 9 |
+
βββ server.cjs # Core Node.js Express server
|
| 10 |
+
β # Handles /api/metadata, /api/stream, FFmpeg transmuxing, and file probing
|
| 11 |
+
βββ package.json # Project dependencies and npm scripts
|
| 12 |
+
βββ vite.config.js # Vite configuration for building the React frontend
|
| 13 |
+
βββ eslint.config.js # Linter configuration
|
| 14 |
+
βββ index.html # Entry point for the frontend application
|
| 15 |
+
βββ Dockerfile # Configuration for containerizing the application
|
| 16 |
+
βββ LICENSE # GPL-3.0 Open Source License
|
| 17 |
+
βββ README.md # Project overview, features, and setup guide
|
| 18 |
+
β
|
| 19 |
+
βββ public/ # Static assets
|
| 20 |
+
β
|
| 21 |
+
βββ src/ # React Frontend Source Code
|
| 22 |
+
βββ App.jsx # Main Application component (UI, Player Logic, State Management)
|
| 23 |
+
βββ App.css # Glassmorphism & Cinematic styling, animations
|
| 24 |
+
βββ main.jsx # React DOM rendering entry point
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## βοΈ Backend Architecture (`server.cjs`)
|
| 28 |
+
|
| 29 |
+
The backend is responsible for bypassing cross-origin restrictions (CORS) and handling unsupported browser video formats (like MKV) through real-time processing.
|
| 30 |
+
|
| 31 |
+
### Key Endpoints:
|
| 32 |
+
- `GET /api/metadata`: Probes the provided video URL using HTTP HEAD requests or `ffprobe`. Detects file size, duration, container type, and extracts internal audio track metadata.
|
| 33 |
+
- `GET /api/stream`: The core streaming engine.
|
| 34 |
+
- If the file is a standard MP4/WebM, it acts as a direct byte-range proxy.
|
| 35 |
+
- If the file is an MKV or requires transcoding, it spawns an `ffmpeg` child process. It pipes fragmented MP4 directly to the Express response, supporting real-time seeking, audio track switching, and optional HEVC-to-H.264 transcoding.
|
| 36 |
+
|
| 37 |
+
## π¨ Frontend Architecture (`src/App.jsx`)
|
| 38 |
+
|
| 39 |
+
The frontend is a monolithic yet organized React component that manages the entire lifecycle of the media player.
|
| 40 |
+
|
| 41 |
+
### Key Capabilities:
|
| 42 |
+
- **State Management**: Handles player states (Play/Pause, Volume, Fullscreen), stream metadata, bookmarks, history, and buffering telemetry.
|
| 43 |
+
- **Subtitle Processing**: The `srtToVtt` utility function converts uploaded SRT subtitle files into WebVTT format entirely on the client side.
|
| 44 |
+
- **Speedometer & Telemetry**: Uses video buffering API (`video.buffered`) to calculate download speeds and buffer health in real-time.
|
| 45 |
+
- **Sandbox Player**: Utilizes `URL.createObjectURL` to allow users to play large local files securely without uploading them to the server.
|