RTSPtoWebRTC icon indicating copy to clipboard operation
RTSPtoWebRTC copied to clipboard

dockerizing this failed

Open meizushooter opened this issue 4 years ago • 13 comments

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?)

meizushooter avatar Feb 15 '21 15:02 meizushooter

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.

danbao12138 avatar Feb 19 '21 10:02 danbao12138

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 avatar Apr 26 '21 19:04 maddanio

@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)

tfmeneses avatar May 13 '21 12:05 tfmeneses

Any updates?

stovv avatar Sep 04 '21 06:09 stovv

I solved this with another package by basically remuxing the h264 stream.

maddanio avatar Sep 04 '21 10:09 maddanio

@maddanio can you tell us in more detail what you did to fix this error?

stovv avatar Sep 04 '21 11:09 stovv

I used some other libs i think. I will try to remember to outline it on monday

maddanio avatar Sep 04 '21 19:09 maddanio

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 :).

maddanio avatar Sep 09 '21 11:09 maddanio

open sourced it: https://github.com/pixelwise/rtsp_to_webrtc

maddanio avatar Sep 09 '21 11:09 maddanio

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.

Apokalypzx avatar Sep 21 '21 05:09 Apokalypzx

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

maddanio avatar Sep 21 '21 07:09 maddanio

Any update on this?

massile avatar Mar 15 '22 08:03 massile

try use https://

deepch avatar Mar 15 '22 14:03 deepch