📜 ⬆️ ⬇️

Smart Relay [wget> fifo> ices0> icecast]

Let's talk a little bit about smart mp3 streaming?
There was a need to make high-quality mp3 relay from four unstable sources (which broadcast the same thing), mostly for themselves.
Take, for example, KissFM. There are 4 sources that periodically fall off (three streams of sound are equally good and one is worse).

At the moment, the implementation is as follows:
#!/bin/sh

# , . kisswget symlink wget,
pkill ices
pkill kisswget

# fifo ( - , )
rm /home/random2/ices/kiss

# fifo
mkfifo /home/random2/ices/kiss
# ices, /home/random2/ices/kiss, stream icecast
ices -c /home/random2/ices/ices.conf

# : wget (kisswget) /home/random2/ices/kiss
# "" , 403/404,

while :
do
/home/random2/ices/kisswget htt://195.138.217.65:8000/kissfm -O /home/random2/ices/kiss
/home/random2/ices/kisswget htt://media.wnet.ua:8000/kissfm -O /home/random2/ices/kiss
/home/random2/ices/kisswget htt://217.20.164.164:8000/kissfm -O /home/random2/ices/kiss
done


The disadvantages that I see at the moment:

A small reference: “FIFO” (first in, first out) is a special type of file that allows two independent processes to operate with it. One process opens the fifo file for writing, and another for reading, after which the data “floats” through it. On * nix systems, create with the mkfifo command.

')

Source: https://habr.com/ru/post/66930/


All Articles