This version (2025/10/24 11:21) was approved by obel1x.The Previously approved version (2025/08/27 18:29) is available.
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Docker: TVHeadend
Very good community- Project to watch tv over network. Supports IPTV and DVB-S, like my Astra 19.2 Satellite Dash.
Forum/Docs: https://tvheadend.org/
IPTV- Channels Worldwide: https://github.com/iptv-org/iptv
or Kodinerds: https://github.com/jnk22/kodinerds-iptv
Satellite Dash Astra 19.2
Server- Web GUI TvHeadend (HTTP-Port 8891 and Stream 9982)
Clients can connect with E.g. Kodi and HTS- Addon on Port 9982 using the User, which can be created at first setup.
Hardware
I bought the PCIe/Twin-/ DVB-S- Card „Cine V7“ of Digital Devices, which i consider best choice for Linux.
Check with lspci „03:00.0 Multimedia controller: Digital Devices GmbH Cine V7“, it should be autoloaded with Kernel-Module STV0910.
Access to DVB- Inputs
Install linux- drivers video4linux:
- v4l-conf
- v4l-tools
- v4l-utils
- w_scan
If you have your DVB- Card in /dev/dvb, check if the settings allow user access like this:
pcserver2023:~ # sudo ls -l /dev/dvb/adapter* /dev/dvb/adapter0: total 0 crwxrwxrwx 1 root video 212, 0 Aug 27 18:22 demux0 crwxrwxrwx 1 root video 212, 1 Aug 27 18:22 dvr0 crwxrwxrwx 1 root video 212, 3 Aug 27 18:22 frontend0 crwxrwxrwx 1 root video 212, 2 Aug 27 18:22 net0 /dev/dvb/adapter1: total 0 crwxrwxrwx 1 root video 212, 4 Aug 27 18:22 demux0 crwxrwxrwx 1 root video 212, 5 Aug 27 18:22 dvr0 crwxrwxrwx 1 root video 212, 7 Aug 27 18:22 frontend0 crwxrwxrwx 1 root video 212, 6 Aug 27 18:22 net0
If not, you need a new udev-rule. Create a file to look like this:
pcserver2023:~ # cat /etc/udev/rules.d/75-dvb.rules SUBSYSTEM=="dvb", MODE:="0777"
Mind the : after Mode, otherwise this will not work!
After a restart, your DVB- Devices should look like above and TVHeadend will work.
Adjusting Dash to Sattelite
In my setup, i am using Astra 19.3E as sattelite. For signal- checking, you can use simple linux- tools like this:
First, check if your Hardware and drivers are working by using w_scan:
docker@pcserver2023:~/docker_compose> w_scan -fs -s S19E2 -cDE -X> ~/channels.conf
This should at least try to find signals. Stop with CRTL+C if scanning basically works (but will not find anything when your dish is not adjusted right).
Now, create only one Channel in your channel-list (you need to now one working channel).
docker@pcserver2023:~/docker_compose> echo "RTL Television(CBC):12187:h:0:27500:163:106:12003"> ~/channels.conf
Start some application, to try to watch that channel - e.g. VLC - of course frist, no Signal will be found.
You now can try to find the sattelite while leaving VLC running and moving your dish around.
When you found the Channel and your signal seems ok, turn on Signal metering with:
docker@pcserver2023:~/docker_compose> dvb-fe-tool -m
Check out the Value of S/R (or C/N in English) in your output and try to find the largest Value for it:
Sperre (0x1f) Signal= -33,56dBm S/R= 11,70dB preBER= 0
Mind, that the dish maybe tilted to get the best results.
The Value should be somewhere from 11-13. Values under 10 are not good.
Now you have the best alignment to your sattelite.
Docker Compose
This is WIP (but works!)
Source for Docs: https://github.com/tvheadend/tvheadend/blob/master/README.Docker.md
You need
- Docker rootless as described in docker
- Caddy as described in docker-caddy
As docker-user:
Create a Folder in docker_compose named tvheadend and a Folder for Records:
docker@pcserver2023:~/docker_compose> mkdir -p /home/docker/docker_compose/tvheadend docker@pcserver2023:~/docker_compose> mkdir -p /home/docker/videorecords
Mind, that the Folder for recordings MUST have the same uid and gid than the HTS- User in the container, which may not be known users to the host.
So after docker- service is started, double check the permissions. As reference, you can check the File on your volume (after docker is running):
docker@pcserver2023:~/docker_compose> sudo ls -l /home/docker/.local/share/docker/volumes/pcserver2023_tvheadend/_data [ ... ] drwxrwxr-x 2 166530 166530 6 22. Aug 22:36 recordings [ ... ]
These permissions must be the same on /home/docker/docker_compose/tvheadend !
Create the file docker-compose.yml in docker_compose/tvheadend folder.
Currently the content looks like that:
services:
tvheadend:
# Bug in current image (20250823): https://github.com/tvheadend/tvheadend/issues/1901
# After resolve, the latest Tag should be used!
# image: ghcr.io/tvheadend/tvheadend:latest
image: ghcr.io/tvheadend/tvheadend:master-debian
cap_drop:
- all
ulimits:
nproc: 256
nofile:
soft: 8192
hard: 65535
devices:
- /dev/dvb/
# See Volumes/localtime
# environment:
# TZ: Europe/Berlin
volumes:
- tvheadend:/var/lib/tvheadend:rw
- /home/docker/videorecords:/var/lib/tvheadend/recordings:rw
- /etc/localtime:/etc/localtime:ro
networks:
- default
ports:
- "9981-9982:9981-9982/tcp"
command: --config '/var/lib/tvheadend' --nosatip --firstrun
restart: unless-stopped
#Not working on master-debian:
# healthcheck:
# test: wget -O - -q 'http://dockerstack-tvheadend-1:9981/ping' | grep -q 'PONG'
# Still needs to be defined while without it won't enable ipv6
networks:
default:
driver: bridge
enable_ipv6: true
volumes:
tvheadend:
You can now statup that container with docker compose up -d and navigate to http://localhost:9981 to set up TVheadend for the first start.
Caddy Service
After getting an Domainname and setting up DyDNS, add the Service to you Caddyfile ( https://obel1x.de/dokuwiki/doku.php?id=content:serverbasics:docker-caddy#caddy_configuration )
Add to Caddyfile:
# TVHeadend
https://tvheadend.domain.tld:443 {
header Strict-Transport-Security max-age=31536000;
reverse_proxy pcserver2023-tvheadend-1:9981
}
Mind, that this will only open the administration web-gui for TVH.
Watching TV with e.g. Kodi needs port 9982 opened at your firewall. You may *not* want that port to be reached from the Internet (or will you??? - well its up to you).
