GithubHelp home page GithubHelp logo

goodrobots / visiond Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 3.0 110 KB

Python/Gstreamer based project to stream video from embedded system cameras in various ways

License: MIT License

Python 100.00%

visiond's People

Contributors

fnoop avatar samueldudley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

visiond's Issues

webrtc port hardcoded

zeroconf advertise port for webrtc hardcoded to 6011. Should either be set in config or try and read from janus websocket/http messages.

Detect/verify video modes

Currently there is no support for detecting and using video modes - it either takes what is given in the config file, or defaults to 640x480/30. Should detect and verify modes and drop back to a supported default otherwise.
goodrobots/maverick#640

Add parameter for config file path

Config file is currently hardcoded to /srv/maverick/config/vision/maverick-visiond.conf.
Add a -c parameter so the path to the config file can be specified, and set the default to the current directory of the visiond script.

Fix old python2 code

visiond has been migrated to python3, but some warnings remain over legacy code:

./visiond:29: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GObject.threads_init()
Starting maverick-visiond
./visiond:623: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.
  Config = ConfigParser.SafeConfigParser()
./visiond:436: PyGIDeprecationWarning: GObject.MainLoop is deprecated; use GLib.MainLoop instead
  GObject.MainLoop().run()

Add config options into config module

Currently the config module doesn't have any of the config options defined - it just takes whatever is defined in the config file. But the code refers to various config options throughout, and fails if the options are not present. The config file may not always have (often won't) all of the possible options.

Detect and broadcast janus streams over zeroconf

In addition to broadcasting visiond rtsp/rtp streams so clients such as GCS can find them, it should also broadcast janus streams so -discovery can find the webrtc endpoints and -web can pick them up automatically.

Add name parameter

Add a name parameter that allows a descriptive name to be set in config. This is useful as it will be passed on in zeroconf and hence -discovery -> -web.

Add option to choose h264 encoder

Currently encoder = h264 or autodetected h264 encoding runs through a series of hardware/gstreamer module checks to autodetect the 'best' available encoder, eg. raspberry/jetson hardware encoder.

These encoders don't always work, so it should be possible to choose the encoder (Eg. x264 software encoder).

Identify and test default webrtc-compatible settings

Currently we have to force certain rtp/rtsp conformity in Janus because the h264 stream from visiond isn't compatible with the browser webrtc support. Figure out what settings are compatible with widest set of browsers and set as default in the encoders.

RTSP server fails after first connection

Once a successful connection and stream is made, any subsequent connections fail:

Feb 09 17:04:13 maverick-raspberrylite python3[15446]: 2020-02-09 17:04:13,428 - Visiond - INFO - Creating RTSP factory element: <GstRtsp.RTSPUrl object at 0xb5520ab0 (GstRTSPUrl at 0x2105ad0)>
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_ghost_pad_new: assertion '!gst_pad_is_linked (target)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_pad_set_active: assertion 'GST_IS_PAD (pad)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_rtsp_stream_new: assertion 'GST_IS_PAD (pad)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_rtsp_stream_set_multicast_iface: assertion 'GST_IS_RTSP_STREAM (stream)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_rtsp_stream_set_profiles: assertion 'GST_IS_RTSP_STREAM (stream)' failed
Feb 09 17:04:13 maverick-raspberrylite python3[15446]: gst_rtsp_stream_set_protocols: assertion 'GST_IS_RTSP_STREAM (stream)' failed
Feb 09 17:04:13 maverick-raspberrylite systemd[1]: maverick-visiond.service: Main process exited, code=killed, status=11/SEGV
Feb 09 17:04:13 maverick-raspberrylite systemd[1]: maverick-visiond.service: Failed with result 'signal'.

rtsp fails on connection (raspberry)

Testing last night on the webrtc-dev branch
default settings
pi3b+ with picam

rtsp pipeline was created OK
rtsp pipeline fails on connection

Logs to come tonight

rtsp not working on pi zero

โžœ  ~ gst-launch-1.0 rtspsrc location=rtsp://maverick-raspberrylite.local:6010/video ! queue ! decodebin ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayCocoa\)\ gldisplaycocoa0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://maverick-raspberrylite.local:6010/video
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6318): gst_rtsp_src_receive_response (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive message. (Timeout while waiting for server response)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Support libgphoto

@fnoop Throwing this out there as an idea for comments. For maverick do we want visiond to be the one stop shop for all camera interfaces? E.g. when we start looking at supporting automated DSLR cameras or other machine vision cameras (point grey, ximea, etc) do you envision visiond doing this or a separate service?

Add zeroconf support - broadcast streams

visiond should broadcast available streams, so other clients can pick it up such as -api. I think camera-manager also does something similar - look at what they're broadcasting as they might have an established format that GCS will pick up.

zeroconf not broadcasting

webrtc service has to be restarted for visiond to pick up janus and broadcast zeroconf.

Also an error:

Apr 16 17:19:59 maverick-raspberrylite python3[686]: 2020-04-16 17:19:59,124 - zeroconf - WARNING - Exception occurred:
Apr 16 17:19:59 maverick-raspberrylite python3[686]: Traceback (most recent call last):
Apr 16 17:19:59 maverick-raspberrylite python3[686]:   File "/srv/maverick/software/python/lib/python3.7/site-packages/zeroconf/__init__.py", line 2638, in send
Apr 16 17:19:59 maverick-raspberrylite python3[686]:     bytes_sent = s.sendto(packet, 0, (real_addr, port))
Apr 16 17:19:59 maverick-raspberrylite python3[686]: OSError: [Errno 101] Network is unreachable

Refactor logging

Logging is currently output to file. Filepaths are set to /srv/maverick and need to be reset relative to script, or else change logging to output to stdout/stderr, or systemd/journald.

Service fails to exit

Testing last night on the webrtc-dev branch
pi3b+ with picam

Service fails to exit. Bug likely introduced during webrtc-dev work.

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.