Giter Club home page Giter Club logo

homewatch's Introduction

Homewatch

Homewatch is a lightweight self-hosted media server.

The idea is to have media files stored on a computer or a remote server, and use a remote device (namely, a phone) to browse the library and play some files. The main use case is for watching movies without leaving the bed or the sofa.

Features

  • Browse a local or remote media library
  • Control a remote VLC player
  • Sleep mode with modular hooks
  • Keep a viewing history
  • Keep playlists, play them in order or shuffled
  • Integrate with Google Chromecast
  • Linux and Windows support
  • Self-hosted: no data collection, no subscription plan, total control
  • Lightweight: the media library is based on the existing file system

Getting Started

Hardware

Homewatch relies on three logical components: a media server, a video player and a control remote. You can use the same machine for all of them, or one machine per component, as you like. Here are two basic setup ideas:

Bedroom setup

  • A computer acts as the media server and the video player, using local video files
  • A phone remotely controls the video player on the computer

Home setup

  • A local server (e.g. a Raspberry Pi) acts as a media server, using local video files
  • A computer acts as the video player, streaming medias from the local network
  • A phone remotely controls the video player on the computer

Note that I tried using a Raspberry Pi 3B+ as a video player, but performances were to low for it to be reliable.

Each machine hosting either the media server or the video player (or both) requires an installation of Homewatch and a specific configuration. See instructions below.

Prerequisite

You'll need Python 3 and:

  • FFmpeg on the media server,
  • VLC on the video player.

Installation

  1. Clone this repository
    git clone https://github.com/ychalier/homewatch
  2. Install dependencies in requirements.txt
    pip install -r requirements.txt
  3. Edit the settings in homewatch/settings.py, everything is explained in the comments

Usage

Call the main script homewatch.py with the runserver argument:

python homewatch.py runserver

Open a web browser to http://127.0.0.1:8000/, and you should see your media library.

Home Setup Scenario

Here is an example scenario, to get an idea of how Homewatch can be used.

A Raspberry Pi has media files stored on a hard drive. Install Homewatch on it, set SERVER_MODE to library, LIBRARY_MODE to local and LIBRARY_ROOT to the hard drive path, e.g. /mnt/usb/. As Homewatch server is a WSGI application, it can be embedded within an Apache server, e.g. with mod_wsgi. Here is a configuration sample:

WSGIScriptAlias / /path/to/homewatch/wsgi.py

Alias /static/ /path/to/homewatch/homewatch/static/
<Directory /path/to/homewatch/homewatch/static>
    Require all granted
</Directory>

Alias /media/ /mnt/usb/
<Directory /mnt/usb>
    Require all granted
</Directory>

Then, on a computer, install Homewatch again, set SERVER_MODE to player, LIBRARY_MODE to remote and LIBRARY_ROOT to the Raspberry Pi URL, e.g. http://192.168.1.42/library/. Start Homewatch with the following command:

python homewatch.py --qrcode 192.168.1.69:8000

The --qrcode flag is used to print a QR code in the terminal, that can be scanned with the phone to get redirected to the control remote. 192.168.1.69 is the local IP address of the laptop.

On the phone, go to http://192.168.1.69:8000 (or scan the QR code), and voilà!

Built With

Chromecast integration is adapted from maxwellito/apachecast.

Sample video files are Sintel and Big Buck Bunny from the Blender Foundation.

Contributing

Contributions are welcomed. Push your branch and create a pull request detailling your changes.

Authors

Project is maintained by Yohan Chalier.

License

This project is licensed under the GNU GPLv3 license.

Troubleshooting

This project is still in an early stage. Submit bug reports and feature suggestions in the issue tracker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.