Code Monkey home page Code Monkey logo

Comments (5)

ivadim avatar ivadim commented on June 9, 2024 2

There are two problems with usb cameras on RaspberriPi and fruitnanny or more with WebRTC protocol in general:

  1. Not all of them produce h.264 stream and it may require transcoding which requires significant hardware resources
  2. Even if camera supports h.264 stream it needs to be transferred from usb to CPU and than back to the network. This may produces some load. In opposite to Raspberry Pi camera which doesn't load CPU at all.

As @phardy mentioned you need to change gstreamer pipeline to take the stream from usb device: command:

command: gst-launch-1.0 -v rpicamsrc name=src preview=0 exposure-mode=night fullscreen=0 bitrate=1000000 annotation-mode=time+date annotation-text-size=20 ! video/x-h264,width=960,height=540,framerate=12/1,profile=constrained-baseline ! queue max-size-bytes=0 max-size-buffers=0 ! h264parse ! rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=127.0.0.1 port=5004 sync=false

should be as easy as changing rpicamsrc to v4l2src (or similar). You may need to install additional dependencies into gstreamer container though...

P.s @phardy Congratulations 👋

from fruitnanny.

phardy avatar phardy commented on June 9, 2024 1

The short version is that a PSeye won't work with fruitnanny without significant changes.

The gstreamer pipeline that reads data from a camera and passes it to the webrtc gateway is specifically tailored for the Pi camera device, and how it works. If you're familiar with gstreamer and are able to use it to get h264 video from your PSeye, then you can modify the video container gst-launch command to work for your camera.

I'm currently doing a little bit of tinkering in a new branch, to overhaul how the gstreamer bits work, and make it easier to customise the gstreamer pipeline for things like USB cameras. But that's slow going (the baby I was building my fruitnanny system for arrived a lot sooner than expected :D ), and won't be perfect or come close to covering every possible use case. At the end of the day it'll still take some knowledge about how your particular camera works.

from fruitnanny.

rayrrr avatar rayrrr commented on June 9, 2024

Correct me if I'm wrong, @ivadim, but I don't think any of us FruitNanny-ers know the answer to this. The NoIR Raspberry Pi Cam is recommended. There are thousands of webcams under the sun. https://raspberrypi.stackexchange.com/questions/92156 seems to indicate that the PSeye may have stopped working w/RaspPi after a major OS update (this is known to happen with older proprietary/closed devices). See if you can get this all working with an older version of Raspbian, like Wheezy. That's my best advice. Please report back with results!

from fruitnanny.

mauricioduarte01 avatar mauricioduarte01 commented on June 9, 2024

Thank you both for the answers! @rayrrr I have other 3 raspies with motion + pseye cameras running streaming video that I use to control my cat without issues. But yeah, I agree with you and @phardy now just confirmed my fears that the PSeye won't work because this method only works with the Pi Camera sadly.
I may just go that route and buy the Pi Camera and use it. For one part I am happy that I finally found a solution to this (It's impossible to find much good answers/guide about streaming both audio+video successfully on the Pi) but also a bit sad that running the PSeye or any other USB camera doesn't works yet by this method.

Congratulations @phardy for your baby. My best wishes.
Thank you for everything.

from fruitnanny.

mauricioduarte01 avatar mauricioduarte01 commented on June 9, 2024

Thank you all.. I will see what I can do :)

from fruitnanny.

Related Issues (20)

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.