Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSEye support (audio works fine) #31

Open
mauricioduarte01 opened this issue Jan 26, 2020 · 5 comments
Open

PSEye support (audio works fine) #31

mauricioduarte01 opened this issue Jan 26, 2020 · 5 comments

Comments

@mauricioduarte01
Copy link

Dear @ivadim . Thank you a lot for this initiative.
I manage to get it working well using your new docker installation guide using my Pi3 with a PSeye Camera. The microphone is working great but the camera is not being detected by the device.
Any hint on how to make all of this working?
Thank you in advance.
Keep up the good work!

@rayrrr
Copy link

rayrrr commented Jan 28, 2020

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!

@phardy
Copy link
Contributor

phardy commented Jan 28, 2020

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.

@mauricioduarte01
Copy link
Author

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.

@ivadim
Copy link
Owner

ivadim commented Jan 28, 2020

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 👋

@mauricioduarte01
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants