I found an internet radio station, but I would like to re-encode it to Opus 32kbps to fit on my unlimited data plan. How would I achieve this?
The source radio uses MP3 @ 160kbps, which is over my unlimited data bandwidth of 128kbps.
I found an internet radio station, but I would like to re-encode it to Opus 32kbps to fit on my unlimited data plan. How would I achieve this?
The source radio uses MP3 @ 160kbps, which is over my unlimited data bandwidth of 128kbps.
You need a publicly reachable host that you can run Icecast on and a host (possibly the same machine) to run the reencoder process on. Given the low bitrate you are aiming for, an average residential connection would suffice, if you control the public side of it. IOW if you are behind a CGNAT, and don't have IPv6 on either your home connection and or your mobile device.
server
sudo apt install icecast2
/etc/default/icecast2
to sayENABLE=true
/etc/icecast2/icecast.xml
and change all passwords - do not make other changes!systemctl start icecast2.service
encoder
sudo apt install ffmpeg
ffmpeg -re -i http://origin.example.com/stream.mp3 -c:a opus -b:a 32k -application audio -vbr on -content_type application/ogg icecast://source:[email protected]:8000/test.opus
The latter is just an example using ffmpeg as the transcoder. I'm not sure how stable it is nowadays. At the very least you would want to wrap it into a while true loop. Other options like liquidsoap or ezstream could be evaluated.
Exposing the Icecast port through a CPE/Router is outside of this scope and 'port forwarding' is a well covered topic in general. Obviously doesn't apply if you decide to run it 'somewhere in the cloud'.