HLS to Video is a web application that converts m3u8 streams to mp4 video files. This application provides real-time progress updates during the conversion process using Pusher.
- Convert m3u8 streams to mp4 video files
- Real-time conversion progress updates
- Download the converted video file
- Node.js
- FFmpeg
- Pusher account
-
Clone the repository:
git clone https://github.com/joshholly/m3u8Convert.git cd m3u8Convert -
Install dependencies:
npm install
-
Install FFmpeg:
- For macOS: Use Homebrew
brew install ffmpeg
- For Ubuntu:
sudo apt update sudo apt install ffmpeg
- For Windows: Download FFmpeg from the official site and add it to your PATH.
- For macOS: Use Homebrew
-
Create a
.envfile:Copy the
.env.examplefile to.env:cp .env.example .env
Fill in your Pusher credentials in the
.envfile:PUSHER_APP_ID=your_pusher_app_id PUSHER_KEY=your_pusher_key PUSHER_SECRET=your_pusher_secret PUSHER_CLUSTER=your_pusher_cluster
If you prefer to set your environment variables directly in the application setup (e.g., through your hosting provider's interface) rather than using a .env file, follow these steps:
- Remove the line
require('dotenv').config();from the top ofapp.js. - Ensure your Pusher credentials (
PUSHER_APP_ID,PUSHER_KEY,PUSHER_SECRET,PUSHER_CLUSTER) are correctly set as environment variables in your application setup.
-
Start the server:
npm start
-
Open your browser and navigate to:
http://localhost:3000/?url=YOUR_M3U8_URLReplace
YOUR_M3U8_URLwith the actual m3u8 URL you want to convert.
app.js: The main server-side script.index.html: The HTML file served to clients.tmp/: Directory where temporary files are stored.
This project is licensed under the MIT License. See the LICENSE file for details.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.