A simple (and basic) transcoding server built with Node.js and FFmpeg.
It takes one or multiple http(s) streams and converts them to different formats(mp3 and aac) at different bitrates.
Because my "smart" TV doesn't support some audio formats and I wanted to be able to listen to my favorite radio stations on it.
- Single source stream, the data will be requested from the upstream server only once.
- Mp3 and AAC transcoding.
- Multiple bitrates for each format.
- Simple and easy to setup and use.
- Clone the repository
- Install the dependencies with
npm install
- Copy the
config.js.example
file toconfig.js
and set the desired configuration (see comments in config file for more information) - Run the server with
node index.js
(or with pm2 withpm2 start index.js --name node-transcode
)
Once you have the server running, you can access the transcoded streams by using the following URL format:
http://<server-ip>:<port>/<endpoint>[/<quality>][.<format>]
Where:
<server-ip>
is the IP address of the server where the transcoding server is running.<port>
is the port where the server is listening.<endpoint>
is the name of the endpoint you want to transcode (this is defined in theconfig.js
file).<quality>
(optional) is the quality of the transcoded stream (this is defined in theconfig.js
file).<format>
(optional) is the format of the transcoded stream (this is defined in theconfig.js
file).
- Better logging and error handling.
- Add option to change sample rate and number of channels.
- Add support for more formats and codecs. Mainly ogg, flac, and opus.
- Add hls support.
- Add autostart (for sources that are not on-demand) and autorestart scripts.
- Add support for more configuration options (like authentication, etc).
- Other ideas? Feel free to open an issue or a PR!
Everyone is welcome to contribute to this project! Just open an issue or a PR so we can discuss it.
This project is licensed under the MIT License - see the LICENSE file for details.