Open
Description
Description
I have a working setup with a raspberry pi 3B+, bookworm OS and used the raspbian image script to install cncjs, and everything works well.
When I insert a USB-webcamera, I am able to see its video feed. Good so far.
However, I'm greedy. I figure the webcam has a microphone as well, and it would be helpful to also have audio alongside the video. This let me down a one-day-long-rabbithole, that as landed me in a semi-working setup. I feel I'm almost there.
So now, on the rpi-3b:
- I installed mediamtx
- I'm using ffmpeg to transcode the yuv frames and mic input into a rtsp stream using the below command:
ffmpeg -f v4l2 \
-framerate 5 \
-s 800x600 \
-i /dev/v4l/by-id/usb-046d_081b_44519B90-video-index0 \
-f alsa -channels 1 \
-sample_rate 16000 \
-i hw:2,0 \
-vcodec h264_v4l2m2m \
-b:v 400k \
-maxrate 400k \
-bufsize 400k \
-acodec opus \
-b:a 8k \
-strict experimental \
-f rtsp -rtsp_transport tcp \
rtsp://0.0.0.0:8554/stream
- Now, we have a rtsp stream containing audio+video going into mediamtx
- Opening a browser, I can see a webrtc stream in a standalone window. :8889Relevant debug messages below
INF MediaMTX v1.10.0
INF configuration loaded from /home/pi/mediamtx.yml
INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
INF [RTMP] listener opened on :1935
INF [HLS] listener opened on :8888
INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
INF [SRT] listener opened on :8890 (UDP)
...
...
INF [RTSP] [session 077fb4e5] created by 127.0.0.1:48084
INF [RTSP] [session 077fb4e5] is publishing to path 'stream', 2 tracks (H264, Opus)
INF [WebRTC] [session 879c13d9] created by 192.168.1.102:33030
INF [WebRTC] [session 879c13d9] peer connection established, local candidate: host/udp/192.168.1.106/8189, remote candidate: prflx/udp/192.168.1.102/55759
[WebRTC] [session 879c13d9] is reading from path 'stream', 2 tracks (H264, Opus)
- Now we come to the problem. When in the webcamera widget, I give as source
http://0.0.0.0:8889/stream
ORhttp://<rpi-ip-address>:8889/stream
, nothing shows up. Instead in the browser debug, I see the error.err:BLOCKED_BY_ORB
- I wonder if this is related to HTTPS support #672
- I have both options HLS & WebRTC, if either work, then I needn't open a separate browser window.
Versions
- CNCjs: 1.10.5
- Node.js: 18.19.0
- NPM: 9.2.0
How Do You Install CNCjs?
- NPM
- Download the CNCjs Desktop Application
CNC Controller
- Grbl
- Smoothieware
- TinyG/g2core
Hardware
- Raspberry Pi
- Desktop or Laptop
- Mobile Device
Operating System
- Not Applicable
- Windows
- Mac
- Linux
Metadata
Metadata
Assignees
Labels
No labels