-
Notifications
You must be signed in to change notification settings - Fork 579
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
Add ALSA support inside docker #403
Comments
Here's the addon (it's extremely basic) /~https://github.com/dbuezas/microphone-stream-addon |
(updated the ffmpeg command, I had pasted the wrong one) |
|
Right, that would be perfect, but alsa doesn't work for me in the frigate nor go2rtc AddOns (because of missing packages I believe) |
Have you tried go2rtc hardware version (Debian linux)? Maybe it support alsa out of box. Looks like your example for Alpine. |
I have not, I'll give it a try. Unfortunately frigate seems to crash often (and even crash the computer due to full ram) when using go2rtc 1.4.x |
With go2rtc hardware:
|
I tried making a local add on with go2rtc so I could add the missing packages but I couldn't manage to get it to build the image (not fluent in docker). I think that addinig these should suffice:
|
Was added to main and to hardware docker containers |
Great! Will test&report tonight then |
It worked! 🎉 webcam:
- ffmpeg:device?video=/dev/video2&input_format=yuyv422&video_size=640x480#video=h264#hardware
- exec:ffmpeg -f alsa -ac 1 -i default -c:a libopus -ar:a 16000 -ac:a 1 -af adelay=0ms -rtsp_transport tcp -b:a 32k -listen 1 -reconnect 1 -f rtsp {output} |
It's perfect! |
If this is coming from the add on as a suggestion for the microphone, I suggest to also add: libopus has much better latency (for me at least). The |
Since I didn't manage to get the audio stream from the microphone, I made a local addon that runs this command:
updated: had pasted the wrong command
And I have a stream called
webcam
in the go2rtc config with only video. When I open it i the webrtcard, it magically picks up both video and audio. Is this the right way of doing it?I also tried creating the final stream with both video and audio from my addon, but then I don't have where to send it to (since no stream is defined in go2rtc)
What would be the right way of doing this?
Btw, in my local addon I have these packages:
RUN apk add --no-cache \ alsa-plugins-pulse=1.2.7.1-r0 \ alsa-utils=1.2.8-r0 \ pulseaudio-utils=16.1-r6 \ ffmpeg
and in the config.yaml, I added:
Maybe adding alsa and pulseaudio to the go2rtc docker container would allow for using the mic?
The text was updated successfully, but these errors were encountered: