Examples usage of various codecs with FFMpeg.
- flac.sh : An Icecast Source Client
- for Windows (Cygwin is required)
- and macOS (
brew install ffmpeg
)
- another_examples.sh : Samples
- FFMpeg can push to Icecast2 in various formats: Opus/Vorbis/AAC/MP3
- this script shows optimal format, container and codec combinations.
- Recommended settings for stable streaming with good quality:
- HE-AAC (aac_he): 48k-64k
- HE-AACv2 (aac_he_v2): 32k-48k
- LC-AAC VBR 3-4
- Higer is good quality, increases bitrate
- if you want to use CBR, set 96k-128k. (not recommended)
- Opus VBR 48k-64k
- CBR is not recommended
- Vorbis q3
- Higer is good quality, increases bitrate
- MP3 V6-V4
- Lower is good quality, increases bitrate
- if you want to use CBR, set 128k-160k
@keiya Thanks alot for your prompt reply!
actually I am tuning icecast2 server in my LAN with goal to reduce delay between source and output voice. at first I thought if I can reduce the source bitrate then I can reduce size of data transmitted which can reduce latency.
in my case the voice quality is does'nt matter, as long as the end point can recognize the conversation then it is fine, maybe like AM radio quality.
I tested opus and libspeex like command below, it can transmit as lowest as 8kbps and still recognizeable.
ffmpeg -ac 1 -f alsa -i hw:0,0 -c:a libopus -vbr on -b:a 8k -content_type 'audio/ogg' -vn -f opus icecast://source:PASSWORD@HOSTNAME:8000/STREAM_NAME
ffmpeg -ac 1 -f alsa -i hw:0,0 -c:a libspeex -b:a 8k -content_type 'audio/ogg' -vn -f spx icecast://source:PASSWORD@HOSTNAME:8000/STREAM_NAME
however the delay still same.. around 16 seconds between source and output.
audio player in output side is VLC.