Giter Club home page Giter Club logo

porch's Introduction

Porch

Usage

Examples tested on raspberry pi 3 model B:

# Run this on source:
$ ./sender.sh -i libcamerasrc -o 192.168.1.10 -p 12345
...
# and on receiver:
cd ./streamrs
cargo run
# Run this on source
$ libcamera-vid -n -t 0 -o - | ./sender.sh -i fdsrc -o 192.168.1.10 -p 12345
...
# and on receiver
cd ./streamrs
cargo run

porch's People

Contributors

ethandmd avatar m-shoberg avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

m-shoberg

porch's Issues

Profiling

We need some instrumentation to understand how our code is performing. Not only do we need profiling instrumentation but we need some metrics to care about! Some general areas I want to know about are:

  • receiving video stream in streamrs and encoding it for sending to client browser
  • receiving video stream in inference server and preprocessing it for model inference
  • capturing video and serving it / sending it to downstream services.

Some tools of interest are:

Web video format

Currently the streamrs crate does the bare minimum and sends h264 frames to streamrs which in turn streams each frame (mjpeg) to client browsers by encoding every frame as jpeg! This is certainly not the end all be all of video encoding and decoding. Without worrying too much about what the camera source is running (we currently assume raspberry pi with the awesome built-in libcamera-vid or raspicam-vid) we should explore serving video from streamrs to clients with

  • sending h264 over websockets
  • DASH
  • HLS

Streaming camera source

Currently, the camera source runs this command or something similar to send data to streamrs or the inference server:

libcamera-vid -n -t 0 -o - | gst-launch-1.0 fdsrc fd=0 ! h264parse ! rtph264pay config-interval=1 ! udpsink host=$HOST port=$PORT

This is convenient, however the camera should really be running a server (like gstreamer-rs rtsp-server). The reason why the camera feed currently shoots frames to a udp sink is that I was unhappy with the latency I noticed in the live stream via an RTSP server to the streamrs http server / camera feed receiver. Wanting to get something going, I was pretty happy with the latency I saw just chucking frames over udp, so here we are.

There are a few problems with this approach:

  • security / secure transport
  • network bandwidth usage: the camera will 5ever send frames to the sink, even when streamrs doesn't require it)
  • multiplexing the stream to many clients: currently I run a proxy server (nginx) that solves this but how do we handle:
  • multiple camera sources, one sink: how can one instance of streamrs process and serve feeds from multiple cameras?
    one way to handle this is to use sticky load balancing based on camera source IP, but this seems like it could be more troublesome than just making client requests to an RTSP/RTP server.

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.