steveseguin / raspberry_ninja

Publish or capture VDO.Ninja streams with Python (Raspberry Pi, Linux, Mac, Windows WSL)
https://raspberry.ninja
144 stars 28 forks source link

RaspPi 4B + Logitech C920 - blank/black stream being sent to vdo.ninja #25

Closed gerbrent closed 1 year ago

gerbrent commented 2 years ago

Hello Steve!

Attempting to get the Raspberry Ninja image running via a Pi 4B - a setup we've been excited to try for a while now for our Linux Unplugged live stream!

The Issue

Hardware

Isolating the camera as the issue

v4l2-ctl -l returns useful camera data

v4l2-ctl --list-devices

HD Pro Webcam C920 (usb-0000:01:00.0-1.2): /dev/video0 /dev/video1 /dev/media1

vcgencmd get_camera

supported=1 detected=0, libcamera interfaces=0

lsusb

Bus 001 Device 003: ID 046d:082d Logitech, Inc. HD Pro Webcam C920

Motion

I was able to install Motion which "uses a video4linux device or network camera to detect motion" to successfully stream a local LAN webpage w video from the Pi+webcam as expected.

To present an image to Motion, the following was needed, presumably for this specific webcam: sudo apt install gstreamer1.0-plugins-good

However, upon satisfying that the camera->Pi link was working as intended, a video stream to vdo.ninja was still presenting as blank/black when invoking python3 publish.py --streamid fC1V89CWE8C2F --bitrate 4000

In fact, all seems as intended.....:

However, when visiting the stream as suggested at https://vdo.ninja/?password=false&view=fC1V89CWE8C2F the following via Firefox on Linux/Fedora:

image

Attempting a different browser - Chromium - exhibits the same behaviour.

Thoughts? I would be happy to do some testing and investigation with you @steveseguin

steveseguin commented 2 years ago

Thank you for the Github issue and all the detail.

Off hand, I'm not quite sure what the issue is. The peer to peer handshake seemed to initiate, but did not complete successfully perhaps.

If there is any PFSense firewall installed, it may be blocking the UDP traffic; the same would be true potentially if the Raspberry Pi was on a different sub-network of the LAN; it may have trouble finding the peer.

I'm assuming a normal VDO.Ninja call, between browser to browser, works on that system.

If using Chrome for the viewer, you can see detailed webRTC connection debug details at chrome://webrtc-internals There may be some hints to whether its a video/raspberry_ninja issue or general connection issue.

image

I'll dig out my C920 and pi4, and verify that the image works with the command line you used, as well as confirm it plays back on Ubuntu 18.04. If it works for me, I'd be more likely to think this is a local networking / firewall issue.

I'll write back when I get something to share.

steveseguin commented 2 years ago

Results of RPI 4 + Logitech C920 on USB 3.0 port /w 3A power supply and the v4.1 image of Raspberry_Ninja

Initial testing with Windows as a viewer is working, with two systems on a simple LAN together. Screen shots included.

image

image

image

If not a networking issue, I suppose it could be hardware decoding issue on the Linux system. It's possible to try VP8 as a codec (command line option for the publish.py script), which might verify if its an h264 decoding issue on that system. It might also be possible to disable hardware acceleration on your browsers, if a hardware decoder issue; unlikely though.

gerbrent commented 2 years ago

Will investigate, thank you!

gerbrent commented 1 year ago

(still blown away by your detailed investigations, hypotheses and suggestions above. Really impressive and inspiring for other budding maintainers! Thank you for all you do! Even if us users aren't always the best at following up..., in this case lost access to the hardware in question.)