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
exec does not kill previous command when reconnecting #1084
Comments
There's a lot of confusion in your post:
|
The only issue I'm seeing is that the I was looking if |
It didn't get any better.
I still don't understand the whole data flow. PS. SDP over TCP it's really another story. It doesn't meet any standards. |
I am sorry if the flow is confusing, I admit that this bticino intercom is quite exotic in its setup.
Everything starts out with a receiver calling Once the SIP call is established internally, it will (re)stream the The receiver binds on UDP ports So to summarize - hopefully a little more clear:
|
OK. I'll try to reproduce your situation about reconnecting issue. |
Thank you! If it's any help, this is the command I use to simulate packets sent from the intercom to the receiver:
Replace You will see that ffmpeg spits out an SDP which matches the SDP that gets returned by the socket server on port 50000. In theory ffmpeg doesn't care if the SDP is provided from a local file (with The following snippet runs the socket server on nodejs to simulate the SDP serving on port 50000.
|
My doorbell publishes an RTP UDP stream which disconnects every minute.
When the stream disconnects, the (previous) underlying exec process is not killed before the reconnect occurs.
Basically I am using a TCP socket which provides SDP to ffmpeg:
This writes the following SDP to the socket:
I can see the stream working as expected on the streams page. After a while the servers stops sending packets to ports 5000 and 5002 and a reconnect will occur which will lead to a
bind failed
error.This reconnects happens here:
https://github.com/AlexxIT/go2rtc/blob/master/internal/streams/producer.go#L174
The error is quite logical because it will try to bind() to UDP ports 5000 and 5002 using the following underlying command
ffmpeg -hide_banner -i tcp://192.168.0.20:50000 -c:v copy -c:a pcm_alaw -ar:a 8000 -ac:a 1 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/61351096f0e2c54e7b8c0c1725be6ebb
.Locally I hacked around this by doing the following (but I am sure a better solution is at hand), which seems to fix the issue:
This is happens here:
https://github.com/AlexxIT/go2rtc/blob/master/internal/exec/exec.go#L71
This is on 1.9.0 on Mac Intel
The text was updated successfully, but these errors were encountered: