Skip to content
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

Neither sending nor receiving video #23

Closed
azhar1038 opened this issue Nov 7, 2020 · 6 comments
Closed

Neither sending nor receiving video #23

azhar1038 opened this issue Nov 7, 2020 · 6 comments

Comments

@azhar1038
Copy link

I am using Docker on Windows to run the app. After pressing Start Webcam only webcam starts but noting happens. Same for Subscribe.
Screenshot (84)
Screenshot (87)

Nothing is printed to server console.

Chrome console says "mediasoup-client: Transport connection state changed to disconnected"

Help please :)

@azhar1038
Copy link
Author

Also I was able to run the mediasoup-demo without problem. But this one is not working and this is my config.js file:

module.exports = {
  listenIp: '0.0.0.0',
  listenPort: 3000,
  sslCrt: '/service/certs/fullchain.pem',
  sslKey: '/service/certs/privkey.pem',
  mediasoup: {
    // Worker settings
    worker: {
      rtcMinPort: 10000,
      rtcMaxPort: 10100,
      logLevel: 'warn',
      logTags: [
        'info',
        'ice',
        'dtls',
        'rtp',
        'srtp',
        'rtcp',
        // 'rtx',
        // 'bwe',
        // 'score',
        // 'simulcast',
        // 'svc'
      ],
    },
    // Router settings
    router: {
      mediaCodecs:
        [
          {
            kind: 'audio',
            mimeType: 'audio/opus',
            clockRate: 48000,
            channels: 2
          },
          {
            kind: 'video',
            mimeType: 'video/VP8',
            clockRate: 90000,
            parameters:
              {
                'x-google-start-bitrate': 1000
              }
          },
        ]
    },
    // WebRtcTransport settings
    webRtcTransport: {
      listenIps: [
        {
          ip: '127.0.0.1',
          announcedIp: '192.168.43.225',
        }
      ],
      maxIncomingBitrate: 1500000,
      initialAvailableOutgoingBitrate: 1000000,
    }
  }
};

@azhar1038 azhar1038 changed the title Neither sending nor receiving video or audio Neither sending nor receiving video Nov 7, 2020
@mkhahani
Copy link
Owner

mkhahani commented Nov 7, 2020

Except the server is behind NAT or proxy you don't need to set the announcedIp and setting the ip with the server IP would be enough.

@azhar1038
Copy link
Author

I changed the config.js with this:

     listenIps: [
        {
          ip: '192.168.43.225',
          announcedIp: null,
        }
      ],

192.168.43.225 is my local IP and definitely it is not behind a NAT or proxy but now I am getting this error in server console:

Error: port bind failed due to address not available [transport:udp, ip:'192.168.43.225', port:10001, attempt:1/101]
    at Channel._processMessage (/service/node_modules/mediasoup/lib/Channel.js:199:37)
    at Socket.Channel._consumerSocket.on (/service/node_modules/mediasoup/lib/Channel.js:61:34)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

@azhar1038
Copy link
Author

Sorry! My mistake. I forgot to forward the rtc min and max port for docker.

@azhar1038
Copy link
Author

azhar1038 commented Nov 8, 2020

Also it works only when I set listenIps to something like:

      listenIps: [
        {
          ip: '0.0.0.0',
          announcedIp: '192.168.43.225',
        }
      ],

Can you please give some insight about Ip and announcedIp?
I thought announcedIp is where others will receice stream.

Use ip: '0.0.0.0' and announcedIp: HOST_PUBLIC_IP when creating a transport.

I found this in FAQ of mediasoup

@mkhahani
Copy link
Owner

mkhahani commented Nov 8, 2020

ip is the network address that server starts listening on it and announcedIp is the IP address that client connects to. When the server has a public IP and the client is direct to it, then setting the announcedIp is unnecessary, although setting both ip and announcedIp with the same public IP works too.

When the server has several IPs then 0.0.0.0 matches all addresses in the IPv4 address space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants