Forked from libraplanet/transcode to Icecast2 from RTMP using ffmpeg and systemd.
Created
December 26, 2020 05:33
-
-
Save Kick4U2/ea0fd4d59cdff23610be4e9f35546dce to your computer and use it in GitHub Desktop.
transcode to Icecast2 from RTMP using ffmpeg and systemd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[put transcode script] | |
PATH:/root/transcode/transcode.sh | |
[register and start service.] | |
PATH:/etc/systemd/system/transcode.radio.service | |
# systemctl enable transcode.service | |
# systemctl start transcode.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=transcode service | |
After=network.target | |
Wants=icecast.service | |
[Service] | |
Type=simple | |
Restart=always | |
ExecStart=/bin/sh /root/transcode/transcode.sh | |
ExecReload=/bin/kill -HUP $MAINPID | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ffmpeg -re -i rtmp://****/****/**** \ | |
-vn -codec:a libmp3lame -b:a 128k -ar 44100 -f mp3 \ | |
-ice_name "stream name" \ | |
-ice_description "stream description" \ | |
-ice_genre "stream genre" \ | |
-ice_public "1" \ | |
-ice_url "http://localhost/" \ | |
icecast://source:huckme@localhost:8000/mountpoint \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment