icecast-mpv-sink is a lightweight service designed to continuously stream audio from an Icecast server to local audio output using MPV. It runs as a systemd service, ensuring automatic restart on interruptions and enabling seamless background operation.
- Continuous Streaming: Streams audio from Icecast sources directly to your local machine.
- Enhanced Error Handling: Automatically handles network interruptions, minimizing disruptions in streaming.
- Broader MPV Configuration Options: Flexible configuration through
/etc/icecast-mpv-sink/icecast-mpv-sink.conf, allowing customization of MPV playback settings. - Systemd Integration: Runs as a
systemdservice, with automatic restart and resilience to interruptions. - Configurable Setup: Customize settings via the configuration file in
/etc/icecast-mpv-sink/icecast-mpv-sink.conf. - Easy Installation: Available as a
.debpackage, simplifying installation and setup.
-
Download the Latest Release:
- Go to the Releases page and download the latest
.debpackage.
- Go to the Releases page and download the latest
-
Install the Package:
sudo apt install ./icecast-mpv-sink_<version>.deb
-
Adjust Configuration (Optional):
- Modify
/etc/icecast-mpv-sink/icecast-mpv-sink.confto set your Icecast server URL and other preferences.
- Modify
-
Enable and Start the Service:
sudo systemctl enable icecast-mpv-sink.service sudo systemctl start icecast-mpv-sink.service
The configuration file is located at /etc/icecast-mpv-sink/icecast-mpv-sink.conf. Here, you can specify:
stream.url: URL of the Icecast stream.[mpv]options: Additional MPV settings, such as volume and video options.
Example configuration:
[stream]
ICECAST_IP=your-icecast-server-url
ICECAST_URL=http://your-icecast-server-url:8000/stream
[mpv]
no_video=true
volume=75These settings allow you to customize playback parameters without modifying the service file.
After installation, the service will automatically start and connect to the Icecast server specified in the configuration file. You can check its status or control the service with systemctl:
# Check status
sudo systemctl status icecast-mpv-sink.service
# Restart the service
sudo systemctl restart icecast-mpv-sink.serviceThe service includes enhanced error handling:
- Network Interruptions: Automatically waits for network availability before starting playback, reducing errors due to network drops.
- Automatic Restart: The service will automatically restart on MPV failure or network disconnection.
Common Commands:
- Check Service Status: Run
sudo systemctl status icecast-mpv-sink.serviceto see logs. - Network Check: Ensure the Icecast server address is reachable.
- Configuration Updates: After updating
/etc/icecast-mpv-sink/icecast-mpv-sink.conf, restart the service:sudo systemctl restart icecast-mpv-sink.service
To build the .deb package locally:
- Clone the repository and navigate into the directory.
- Run the following command:
dpkg-deb --build icecast-mpv-sink
Contributions are welcome! Please open an issue to discuss any changes or improvements.
This project is licensed under the MIT License.