dockerizing this failed
I dockerized this, and it can pull the RTSP steam but when i access the website, the video does not run.
Is it related to any network issue? e.g. WebRTC ICE/signalling process requires the server to know its own ip? (but inside docker, it fails to get its ip?)
I have the same problem. It can be accessed normally on the host computer where the docker container is deployed, but the video does not run on other computers in the same LAN.
I try to solve this problem by adding stun and turn services
modify http.go
peerConnection, err := api.NewPeerConnection(webrtc.Configuration{ ICEServers: []webrtc.ICEServer{ { URLs: []string{"turn:192.158.29.39:3478?transport=udp"}, Username:"28224511:1379330808", Credential:"JZEOEt2V3Qb0y27GRntt2u2PAYA=", }, { URLs: []string{"turn:192.158.29.39:3478?transport=tcp"}, Username:"28224511:1379330808", Credential:"JZEOEt2V3Qb0y27GRntt2u2PAYA=", }, }, })
modify web/static/js/app.js
let config = { iceServers: [ { urls: ["turn:192.158.29.39:3478?transport=tcp"], username:"28224511:1379330808", credential:"JZEOEt2V3Qb0y27GRntt2u2PAYA=" }, { urls: ["turn:192.158.29.39:3478?transport=udp"], username:"28224511:1379330808", credential:"JZEOEt2V3Qb0y27GRntt2u2PAYA=" }, ] };
I think it can work in theory, but it didn't work.
any luck? I guess our problem is similar: we need to put this behind an apache proxy. also I am wondering: can the video data be transported through websocket? that should make stun/turn obsolete?
@maddanio can you try this fix (https://github.com/deepch/RTSPtoWebRTC/issues/77)? I basically installed the PION/turn locally and all works fine without dependencies with external STUN/TURN. (Sorry my english)
Any updates?
I solved this with another package by basically remuxing the h264 stream.
@maddanio can you tell us in more detail what you did to fix this error?
I used some other libs i think. I will try to remember to outline it on monday
Ok, so I ended up using github.com/pion/webrtc/v3 for webrtc and also being h264 specific in adding start codes to the h264 nalus in the stream. so its a bit hacky right now :).
open sourced it: https://github.com/pixelwise/rtsp_to_webrtc
I had the same problem and got it working using "network_mode: host" in my docker compose file (same as "--network host" on the docker run command line.)
I suspect it has to do with the RTSP protocol needing access to certain ports to actually receive the RTP stream.
It serms like the whole nat traversal doesn't fully work? I had to set up a turn server in my case, but still only could get my version to work
Any update on this?
try use https://