This is a small server that allows you to watch digital television on your computer and your local network.
- scan and configure TV channels
- browse your TV channels and EPG from a web browser
- view current EPG while browsing channels
- stream tv using RTSP 1.0
- Kodi support, see below
- watch simultaneously all channels in the same multiplex
- logical channel numbering (please note that this is not standard and may depend on your country)
wget https://github.com/phpbg/watchtv/releases/download/1.1.0/watchtv-1.1.0.tar.gz
tar xf watchtv-1.1.0.tar.gz
cd watchtv/
sudo ./install.sh
Use this map to know your broadcasting technology.
- This has been developed and tested on a DVB-T network only, with MPEG-4 (H.264) streams.
- It will probably work on DVB-T2 (not tested yet).
- It may work on other networks (Cable, Satellite, ATSC), but it is yet untested.
- Please open an issue or merge request to report your success or failure to improve this software.
You can run the server and the client on the same device if you want.
- Must be powerful enough to decode TV streams, that will probably be MPEG 2 (H.262) or MPEG 4 (H.264) or MPEG H (H.265).
- Desktop:
-
MPV (recommended)
-
VLC: expect troubles with VLC
- TCP does not work with VLC (it is supported but I didn't manage to make it work)
- UDP is the default and works, but glitches are expected, probably because TS stream should be converted to RTP? (if you know well RTSP and RTP please feedback wanted)
-
Kodi using IPTV Simple Client
Follow this guide
You can copy m3u and epg URLs from main channels page (links at bottom). I highly recommend you disable caching channels in IPTV plugin configuration and in kodi PVR settings
-
- Android
- MPV-android (recommended)
- VLC for Android (same limitations as VLC for desktop)
- Web browser if you want to lauch channels from it
- Linux
- PHP 7+
- A TV adapter
- ethernet network. Wifi works but please avoid wifi: wifi is not that reliable. I do not recommend you use wifi for the server side.
IMPORTANT: there is a bug in dvbv5 that may crash your raspberry sooner or later. Please wait for bug resolution before using this on your raspberries: bug report. If you experience the issue I highly suggest you install and use dvbjet from https://github.com/lightful/DVBdirect , it is faster and stable.
A raspberry zero-w is enough, although I recommend you something more reliable:
- the raspberry zero will be pushed at it's own limits (expect 80% to 100% CPU)
- it has wifi only (you may try USB attached ethernet adapter)
- some TV dongles require a lot of current, and some power supplies don't handle this corectly
- Raspberry pi does not have a reliable wifi (at least raspberry-zero and raspberry 3B have wifi troubles - raspberry 3B+ seems not to be affected). Discussion here and here
-
Install requirements :
- PHP cli
- DVB scanner
- Either this DVB tuner or this one, faster and simpler: dvbjet
Those requirements are already packaged in most ditributions: Ubuntu / raspbian
$ sudo apt install php-cli dvb-tools
Debian (as root)
# apt install php-cli dvb-tools
Archlinux
$ sudo pacman -S php v4l-utils
Fedora (as root)
# dnf install php-cli v4l-utils
-
Download latest release package from https://github.com/phpbg/watchtv/releases
-
Extract it
$ tar xf watchtv-1.1.0.tar.gz
-
Test the server manually
$ cd watchtv $ php server.php
- Make sure there is no error.
- You will be instructed to open a browser (on local machine or from your local network) to finish the configuration
If you want the server to start automatically at boot, install it as a service.
- Edit
watchtv.service
- change
ExecStart
path, or copy the files extracted to/opt/watchtv
- change
User
andGroup
or create watchtv user withuseradd -U watchtv -M -G video
- change
- Copy
watchtv.service
to/etc/systemd/system/
$ sudo cp watchtv.service /etc/systemd/system/
- Reload systemd daemon
$ sudo systemctl daemon-reload
- Start the service
$ sudo systemctl start watchtv
- Enable the service at boot
$ sudo systemctl enable watchtv
To check logs run $ journalctl -u watchtv
See here for a complete list of DVB digital devices that should be compatible. Tested:
- TerraTec Cinergy T Stick+: OK
- RTL SDR v2: OK but some glitches appears after a few hours (when the dongle is hot)
- Raspberry TV HAT should work. If you have one please open an issue or a merge request to report the status (try to run it for many hours to check longterm stability). Note: this device use SPI at 55Mhz. I don't know yet if this is sufficient to watch all channels within a multiplex...
Your video may be interlaced.
With mpv, try pressing d
to activate deinterlace
If it works, you can make it permanent with deinterlace=yes
in ~/.config/mpv/mpv.conf
When you use the web interface with edge, you need to tell windows to open channel with, for example, mpv.
- Download this file
- Make sure mpv is installed here:
C:\\Program Files\\mpv\\mpv.exe
or update the downloaded file with the correct path - Run the file (double click on it)
- Packaging for common linux distributions
- Support Fedora and arch in install script
- live update web interface to reflect avaliable channels when a stream is already running
- multiple adapter support
- pause (live recording)
- scheduled recording
- remote
- performance improvements (starting a channel is way too slow)
- watch TV directly in the browser with HTTP_Live_Streaming
After cloning the project run:
git submodule init
git submodule update
Build a release
#Make sure log level is set to INFO in server.php
composer install --no-dev --optimize-autoloader
cd ..
tar --exclude='watchtv/.git' --exclude='watchtv/.idea' --exclude='watchtv/channels.conf' -czf watchtv.tar.gz watchtv/