テレビチューナー API サーバー「Mirakurun」をインストールに先立ちディレクトリの作成
mkdir -p /mnt/data/docker/mirakurun/conf /mnt/data/docker/mirakurun/data cd /mnt/data/docker/mirakurun/
docker-compose.yml の作成
nano /mnt/data/docker/mirakurun/docker-compose.yml
services:
mirakurun:
image: chinachu/mirakurun:latest
container_name: mirakurun
restart: "no"
privileged: true
network_mode: host
group_add:
- video
volumes:
- ./server.yml:/app-config/server.yml
- ./tuners.yml:/app-config/tuners.yml
- ./channels.yml:/app-config/channels.yml
- ./data:/app-data
- /usr/bin/recisdb:/usr/local/bin/recisdb:ro
devices:
- /dev/px4video0:/dev/px4video0
- /dev/px4video1:/dev/px4video1
- /dev/px4video2:/dev/px4video2
- /dev/px4video3:/dev/px4video3
- /dev/px4video4:/dev/px4video4
- /dev/px4video5:/dev/px4video5
- /dev/px4video6:/dev/px4video6
- /dev/px4video7:/dev/px4video7
tuners.yml の作成
nano /mnt/data/docker/mirakurun/tuners.yml
- name: PX-Q3U4-S0
types:
- BS
- CS
command: recisdb tune --device /dev/px4video0 --channel <channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-S1
types:
- BS
- CS
command: recisdb tune --device /dev/px4video1 --channel <channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-S2
types:
- BS
- CS
command: recisdb tune --device /dev/px4video4 --channel <channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-S3
types:
- BS
- CS
command: recisdb tune --device /dev/px4video5 --channel <channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-T0
types:
- GR
command: recisdb tune --device /dev/px4video2 --channel T<channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-T1
types:
- GR
command: recisdb tune --device /dev/px4video3 --channel T<channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-T2
types:
- GR
command: recisdb tune --device /dev/px4video6 --channel T<channel> -
decoder: arib-b25-stream-test
isDisabled: false
- name: PX-Q3U4-T3
types:
- GR
command: recisdb tune --device /dev/px4video7 --channel T<channel> -
decoder: arib-b25-stream-test
isDisabled: false
server.yml の作成
nano /mnt/data/docker/mirakurun/server.yml
logLevel: 2 path: /var/run/mirakurun.sock port: 40772 bindIPv4: '0.0.0.0' epgGatheringJobSchedule: '0 3,15 * * *' epgRetrieveEventRange: 50000 allowIPv4CidrRanges: - 10.0.0.0/8 - 127.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 - 100.64.0.0/10
entrypoint.sh の作成
nano /mnt/data/docker/mirakurun/entrypoint.sh
#!/bin/bash exec npm start
コンテナ起動、チャンネルスキャン
docker compose up -d # 起動確認(8 of 8 tuners loadedが出ればOK) docker compose logs -f #チャンネルスキャンの順番が重要!必ず地デジ→BSの順で実行、type指定なしのスキャンは地デジのみスキャンされBSが上書き消去される。 # Step1: 地デジスキャン(type=GR指定推奨) curl -X PUT "http://localhost:40772/api/config/channels/scan?type=GR" # Step2: BSスキャン(地デジ完了後に実行) curl -X PUT "http://localhost:40772/api/config/channels/scan?type=BS" # スキャン完了後にバックアップを取得 cp /mnt/data/docker/mirakurun/channels.yml /mnt/data/docker/mirakurun/channels.yml.bak # サービス数確認(地デジ+BS合わせて100件以上が目安) curl -s http://localhost:40772/api/services | python3 -m json.tool | grep -c 'serviceId' # BSチャンネル数確認 cat channels.yml