Giter Club home page Giter Club logo

video_streaming's Introduction

Diagram

An image of what's happening here

Overview

This Repository contains the following:

  • a diagram ("software_diagram.png"), also found in FigmaJam
  • a frontend (vuejs + quasarjs)
  • a backend (python + websockets)
  • some configs (nginx, dnsmasq)

Installing

Install nginx, dnsmasq, npm, python3

npm install
pip install websockets

Add the .conf files to their correct places

(haven't tested this but the deps are that complicated here)

Running

systemctl restart nginx

# (may have to "systemctl stop systemd-resolved && pkill -f systemd-resolved")
# lsof -i:53 to check for services bound to DNS
systemctl restart dnsmask

cd backend && python server.py

# Then

cd stream_frontend && ./build.sh

How it works (roughly)

See diagram "software_diagram.png" for visuals

DNS

The DNSMASQ service (see config at ./dnsmask.conf) is a DNS server that translates domain names to IP addresses.

In the config file you can see the single relevant command:

address=/stream.me/127.0.0.1

This tells the web browser that the website "stream.me" should automatically redirect them to 127.0.0.1 (which is the address of the "raspberry pi", though this will change eventually)

NGINX

This is the "web server" running on the raspberry pi which listens for all incoming requests. (See ./nginx.conf -- specifically the "location" blocks towards the bottom of the file)

It essentially acts as a middleman between the browser and the backend services running on the Pi.

So when the browser goes to stream.me, it will return a webpage for them.

When the joystick controller wants to send position data, it will send it to stream.me/control, and nginx will automatically know to redirect that to the backend.

To pull the video data, it will request "stream.me/live", which nginx will automatically redirect it to the live video feed

Backend

The backend is a single python script (found in ./backend/server.py). This would be running on the Raspberry Pi

This brings up a server on port 9000 that listens for websocket connections.

The web page (where a viewer is watching the video stream) would send a websocket connection to this backend in order to establish communication (for example to send position commands to the Pi to move the camera).

Frontend

The frontend is essentially the webpage files that are sent to the viewer.

It contains the video container, joystick, battery icons, etc, and all the logic associated with those.

When loaded it will open a connection to the backend to enable two-way communication

video_streaming's People

Contributors

jfakult avatar

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.