RTSPtoWebRTC icon indicating copy to clipboard operation
RTSPtoWebRTC copied to clipboard

h264 other stream support

Open czk630597526 opened this issue 3 years ago • 0 comments

in this system, we just can play the normal h264 stream like I p p p I,in some situations,we get stream like i slice i slice i slice ...do you want to figure them? i just write a version including this under test

czk630597526 avatar Nov 17 '21 08:11 czk630597526

Yes, needed for WebRTC as you've confirmed.

allenporter avatar Dec 14 '23 03:12 allenporter

It seems possible its not needed, but then you need to figure out how to expose all the ports needed by WebRTC -- not sure how tractable that is.

allenporter avatar Dec 14 '23 03:12 allenporter

@allenporter thanks for your reply.

I think if we use --network=host, we can use docker host ip to access the WebRTC endpoint.

Will do a research on it and post the result here :).

Ehsan-Home avatar Dec 14 '23 17:12 Ehsan-Home

try add to compose.yml ports like this: - 0.0.0.0:50000-50009:50000-50009/udp

and add min max webRTC ports into config.json

"webrtc_port_max": 50009,
"webrtc_port_min": 50000

example compose.yml:

services:
  RTSPtoWeb:
    image: ghcr.io/deepch/rtsptoweb
    container_name: camera-server
    ports:
      - 0.0.0.0:8089:8083
      - 0.0.0.0:50000-50009:50000-50009/udp
      - 0.0.0.0:5541:5541

example config.json:

{
  "channel_defaults": {},
  "server": {
    "debug": true,
    "http_debug": false,
    "http_demo": true,
    "http_dir": "web",
    "http_login": "demo",
    "http_password": "demo",
    "http_port": ":8083",
    "https": false,
    "https_auto_tls": false,
    "https_auto_tls_name": "",
    "https_cert": "server.crt",
    "https_key": "server.key",
    "https_port": ":443",
    "ice_credential": "",
    "ice_servers": [],
    "ice_username": "",
    "log_level": "debug",
    "rtsp_port": ":5541",
    "token": {
      "backend": "http://127.0.0.1/test.php",
      "enable": false
    },
    "webrtc_port_max": 50009,
    "webrtc_port_min": 50000
  },
  "streams": {
    "test": {
      "channels": {
        "0": {
          "debug": true,
          "url": "<url_to_rtsp_stream>"
        }
      },
      "name": "test"
    }
  }
}

Sanit93 avatar Feb 05 '24 07:02 Sanit93

try add to compose.yml ports like this: - 0.0.0.0:50000-50009:50000-50009/udp

and add min max webRTC ports into config.json

"webrtc_port_max": 50009,
"webrtc_port_min": 50000

example compose.yml:

services:
  RTSPtoWeb:
    image: ghcr.io/deepch/rtsptoweb
    container_name: camera-server
    ports:
      - 0.0.0.0:8089:8083
      - 0.0.0.0:50000-50009:50000-50009/udp
      - 0.0.0.0:5541:5541

example config.json:

{
  "channel_defaults": {},
  "server": {
    "debug": true,
    "http_debug": false,
    "http_demo": true,
    "http_dir": "web",
    "http_login": "demo",
    "http_password": "demo",
    "http_port": ":8083",
    "https": false,
    "https_auto_tls": false,
    "https_auto_tls_name": "",
    "https_cert": "server.crt",
    "https_key": "server.key",
    "https_port": ":443",
    "ice_credential": "",
    "ice_servers": [],
    "ice_username": "",
    "log_level": "debug",
    "rtsp_port": ":5541",
    "token": {
      "backend": "http://127.0.0.1/test.php",
      "enable": false
    },
    "webrtc_port_max": 50009,
    "webrtc_port_min": 50000
  },
  "streams": {
    "test": {
      "channels": {
        "0": {
          "debug": true,
          "url": "<url_to_rtsp_stream>"
        }
      },
      "name": "test"
    }
  }
}

This didn't work for me, did you manage to get it working?

When I looked into the SDP header it returns

a=candidate:3306701121 1 udp 2130706431 172.20.0.2 50004 typ host
a=candidate:3306701121 2 udp 2130706431 172.20.0.2 50004 typ host

So its not even on the correct IP range...

Wolfleader101 avatar Feb 28 '24 03:02 Wolfleader101

Is there any updates on this ,or is there a way to know all the ports used by WebRTC?

josemiguely avatar Mar 08 '24 14:03 josemiguely

Is there any updates on this ,or is there a way to know all the ports used by WebRTC?

If you are running your docker on windows then no it doesn't seem possible. I had to run mine thru docker via WSL.

Wolfleader101 avatar Mar 09 '24 05:03 Wolfleader101

Try to restart container after change in confing.json. Even that, I recommend using mode type "host".

Sanit93 avatar Mar 11 '24 09:03 Sanit93

Is there any updates on this ,or is there a way to know all the ports used by WebRTC?

If you are running your docker on windows then no it doesn't seem possible. I had to run mine thru docker via WSL.

I am using WSL2 instead of Windows. Is there a way to run WebRTC without type "host" and only exposing the necessary ports?

josemiguely avatar Mar 11 '24 14:03 josemiguely