phpbg / watchtv

This is a small server that allows you to watch digital television on your computer and your local network.
MIT License
28 stars 5 forks source link

Watch TV

This is a small server that allows you to watch digital television on your computer and your local network.

Features

Quick installation (debian, raspbian, ubuntu)

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

Is is compatible in my country?

Use this map to know your broadcasting technology.

Requirements

You can run the server and the client on the same device if you want.

Client

Server

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:

Manual installation

  1. Install requirements :

    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
  2. Download latest release package from https://github.com/phpbg/watchtv/releases
  3. Extract it
    $ tar xf watchtv-1.1.0.tar.gz
  4. 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

Installing as a service with systemd (auto start at boot)

If you want the server to start automatically at boot, install it as a service.

  1. Edit watchtv.service
    • change ExecStart path, or copy the files extracted to /opt/watchtv
    • change User and Group or create watchtv user with useradd -U watchtv -M -G video
  2. Copy watchtv.service to /etc/systemd/system/
    $ sudo cp watchtv.service /etc/systemd/system/
  3. Reload systemd daemon
    $ sudo systemctl daemon-reload
  4. Start the service
    $ sudo systemctl start watchtv
  5. Enable the service at boot
    $ sudo systemctl enable watchtv

    To check logs run $ journalctl -u watchtv

FAQ

Is my TV adapter compatible

See here for a complete list of DVB digital devices that should be compatible. Tested:

Horizontal lines (more or less visible) on image

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

Make Windows 10 / Edge open channels in mpv

When you use the web interface with edge, you need to tell windows to open channel with, for example, mpv.

  1. Download this file
  2. Make sure mpv is installed here: C:\\Program Files\\mpv\\mpv.exe or update the downloaded file with the correct path
  3. Run the file (double click on it)

Ideas for future releases

Contributions

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/