# Несколько источников в Acestream

**URL:** <https://forum.acestream.media/t/neskolko-istochnikov-v-acestream/3196>\
**Category:** Рекомендации\
**Created:** [27.Июнь.2015 19:18:55 UTC](https://forum.acestream.media/t/neskolko-istochnikov-v-acestream/3196 "2015-06-27T19:18:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimonil](https://forum.acestream.media/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@dimonil](https://forum.acestream.media/u/dimonil)\
**Post date:** [27.Июнь.2015 19:18:55 UTC](https://forum.acestream.media/t/neskolko-istochnikov-v-acestream/3196/1 "2015-06-27T19:18:55Z")

</div>

Приветствую всех!  
Хороший проект создали, с перспективой. Вопрос сразу по теме - как правильно запустить сразу много источников, ну например 100-200 каналов? Как пример, я сегодня пользуюсь IPTV проектом Astra. Там это реализовано следующим образом.

make\_channel({name = “Первый канал”, input = {input1 … “1”, input2 … “1”, input3 … “1”, matrac}, output = {conf1 … “ch1” … conf2}})  
make\_channel({name = “Россия 1”, input = {input1 … “2”, input2 … “2”, input3 … “2”, matrac}, output = {conf1 … “ch2” … conf2}})  
make\_channel({name = “РОССИЯ 2”, input = {input1 … “5”, input2 … “5”, input3 … “5”, matrac}, output = {conf1 … “ch3” … conf2}})

```auto
make_channel({name = "ТВЦ", input = {input1 .. "3", input2 .. "3", input3 .. "3", matrac}, output = {conf1 .. "ch4" .. conf2}})
make_channel({name = "НТВ", input = {input1 .. "4", input2 .. "4", input3 .. "4", matrac}, output = {conf1 .. "ch5" .. conf2}})
make_channel({name = "ТНТ", input = {input1 .. "6", input2 .. "6", input3 .. "6", matrac}, output = {conf1 .. "ch6" .. conf2}})
make_channel({name = "РЕН ТВ", input = {input1 .. "7", input2 .. "7", input3 .. "7", matrac}, output = {conf1 .. "ch7" .. conf2}})
make_channel({name = "СТС", input = {input1 .. "8", input2 .. "8", input3 .. "8", matrac}, output = {conf1 .. "ch8" .. conf2}})
make_channel({name = "Дождь", input = {input1 .. "151",input2 .. "151",input3 .. "151",matrac}, output = {conf1 .. "ch9" .. conf2}})
make_channel({name = "Пятница!", input = {input1 .. "9", input2 .. "9", input3 .. "9", matrac}, output = {conf1 .. "ch10" .. conf2}})
make_channel({name = "Шансон ТВ", input = {input2 .. "67", input2 .. "67", input3 .. "67", matrac}, output = {conf1 .. "ch11" .. conf2}})
make_channel({name = "Комедия ТВ", input = {input1 .. "26", input2 .. "26", input3 .. "26", matrac}, output = {conf1 .. "ch12" .. conf2}})
make_channel({name = "Zone Reality", input = {input1 .. "27", input2 .. "27", input3 .. "27", matrac}, output = {conf1 .. "ch13" .. conf2}})
make_channel({name = "World Fashion", input = {input1 .. "50", input2 .. "50", input3 .. "50", matrac}, output = {conf1 .. "ch14" .. conf2}})
make_channel({name = "Россия К", input = {input1 .. "59", input2 .. "59", input3 .. "59", matrac}, output = {conf1 .. "ch15" .. conf2}})
make_channel({name = "Спас", input = {input1 .. "60", input2 .. "60", input3 .. "60", matrac}, output = {conf1 .. "ch16" .. conf2}})
make_channel({name = "ТВ 3", input = {input1 .. "66", input2 .. "66", input3 .. "66", matrac}, output = {conf1 .. "ch17" .. conf2}})

```

Я этот скрипт написал сам, поэтому прокомментирую. Создаётся канал, с определённым названием, далее на входе имеем три источники для отказоустойчивости, плюс источник выдающий ролик в случае отказа сразу трёх подобных источников. На выходе имеем конфигурацию, которая описана в conf1, ну и на последок номер канала.

На выходе имеем ссылку вида [http://127.0.0.1:14441/ch1](http://127.0.0.1:14441/ch1)

Написал я так же простенький скрипт для запуска Acestream

```auto
#!/bin/sh
pid_file="/var/run/acestream.pid"
tranc="acestreamengine"
conf1=" --duration 00:10:00 --publish-dir /var/www/html/streams --cache-dir /tmp/streams"
conf2="--quality SD --category informational --permanent --log-stdout"

case "$1" in
 start)
    echo "Запущен торрент сервер";
    echo `killall -9 $tranc`;
  $tranc --stream-source --name "Первый канал1" --title "Первый канал" --source "http://185.18.205.10:14441/ch1" --bitrate 150000 $conf1 --port 7767 $conf2 &
  $tranc --stream-source --name "Первый канал2" --title "Россия 1" --source "http://185.18.205.10:14442/ch2" --bitrate 150000 $conf1 --port 7768 $conf2 &
        ch_pid=$!
    echo $ch_pid
    echo $ch_pid > $pid_file
    echo `( >>/dev/null )&`;
         ;;
 stop)
    echo "Остановлен торрент сервер";
    echo `killall -9 $tranc`;
         ;;
        *)
    echo "Usage: /etc/init.d/$tranc {start|stop}"
         exit 1
         ;;
 esac

exit 0

```

Направьте пожалуйста, может есть более правильное решение для создания таких списков?
