Closed duduathz closed 4 years ago
docker image registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.17 also has the same performance.
TRANS_BY_GPT3
https://github.com/ossrs/srs/issues/307#issuecomment-602193458
Be careful to modify the configuration file.
TRANS_BY_GPT3
The running docker has already been changed to CANDIDATE, but I still see the stun timeout being displayed in the logs using docker ip.
TRANS_BY_GPT3
Where is the configuration file? './objs/srs -c conf/srs.conf'. The configuration in it doesn't have rtc. Please provide more complete information.
TRANS_BY_GPT3
Run command
docker run -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp --env CANDIDATE=192.168.2.132 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.17 objs/srs -c conf/rtc.conf
Configuration file
listen 1935;
max_connections 1000;
srs_log_tank console;
srs_log_file ./objs/srs.log;
daemon off;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api {
enabled on;
listen 1985;
}
stats {
network 0;
}
rtc_server {
enabled on;
# Listen at udp://8000
listen 8000;
#
# The $CANDIDATE means fetch from env, if not configed, use default * as bellow.
#
# The * means using IP of network interface stats.network,
# For example, if stats.network=0, then use IP of eth0 as candidate.
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
rtc {
enabled on;
bframe discard;
}
}
Server log
[2020-04-04 18:40:43.041][Trace][1][982] rtc session=172.17.0.1:57372_P7GYPLL1:a+MR, stun timeout
[2020-04-04 18:40:44.046][Trace][1][983] rtc session=172.17.0.1:44715_xxubYLLe:BgJK, stun timeout
[2020-04-04 18:40:47.059][Trace][1][984] rtc session=172.17.0.1:53883_d4Jqum73:3V1b, stun timeout
TRANS_BY_GPT3
Can you provide the complete log of 982 instead of always giving a little bit of information...
TRANS_BY_GPT3
Also please try whether the 4.0.20 mirror has any issues.
TRANS_BY_GPT3
Also, please bother to capture the package with Wireshark, and provide the information from Chrome's log chrome://webrtc-internals/.
WebRTC is super complex and requires a lot of things. Just a few logs won't be enough to pinpoint the issue.
TRANS_BY_GPT3
Can RTMP play?
TRANS_BY_GPT3
Run command
docker run -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp --env CANDIDATE=192.168.2.132 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.17 objs/srs -c conf/rtc.conf
Configuration file
listen 1935; max_connections 1000; srs_log_tank console; srs_log_file ./objs/srs.log; daemon off; http_server { enabled on; listen 8080; dir ./objs/nginx/html; } http_api { enabled on; listen 1985; } stats { network 0; } rtc_server { enabled on; # Listen at udp://8000 listen 8000; # # The $CANDIDATE means fetch from env, if not configed, use default * as bellow. # # The * means using IP of network interface stats.network, # For example, if stats.network=0, then use IP of eth0 as candidate. # @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124 candidate $CANDIDATE; } vhost __defaultVhost__ { rtc { enabled on; bframe discard; } }
Server logs
[2020-04-04 18:40:43.041][Trace][1][982] rtc session=172.17.0.1:57372_P7GYPLL1:a+MR, stun timeout [2020-04-04 18:40:44.046][Trace][1][983] rtc session=172.17.0.1:44715_xxubYLLe:BgJK, stun timeout [2020-04-04 18:40:47.059][Trace][1][984] rtc session=172.17.0.1:53883_d4Jqum73:3V1b, stun timeout
docker run -p 1935:1935 -p 8080:8080 -p 1985:1985 -p 8000:8000/udp --env CANDIDATE=192.168.2.132 registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v4.0.17 objs/srs -c conf/rtc.conf
Please note that the CANDIDATE=ip here should be filled with your public IP address.
TRANS_BY_GPT3
Can you stream RTMP?
RTMP can be streamed.
TRANS_BY_GPT3
@xiaozhihong I shouldn't need a public IP for testing within the internal network. The same procedure works in the company environment.
TRANS_BY_GPT3
Please also try using the 4.0.20 image to see if there is any issue.
Last night I also tested 4.0.20 and encountered the same issue. I'm wondering if it is related to the version of Docker, because yesterday I tested on two computers - one was my local MacBook Pro and the other was a CentOS 7 server - and both had the same problem. However, when I tested it at the office, everything worked fine.
TRANS_BY_GPT3
Can you provide the complete log of 982, instead of always giving bits of information...
I'm not sure which log you're referring to.
TRANS_BY_GPT3
webrtc_internals_dump.txt webrtc_internals_dump (1).txt
Information about Chrome logs chrome://webrtc-internals/
TRANS_BY_GPT3
Can you give the complete log of 982, instead of providing it little by little?
I'm not sure which log you're referring to.
[2020-04-04 18:40:43.041][Trace][1][982] rtc session=172.17.0.1:57372_P7GYPLL1:a+MR, stun timeout
This [1][982]
is the log of this session. You can grep out this 982.
TRANS_BY_GPT3
If RTMP can play, it means the network is connected. Can you capture the packets with Wireshark? When capturing, filter ports 1985 and 8000, you can set the capture filter.
tcp port 1985 or udp port 8000
TRANS_BY_GPT3
In Answer, I see that the server has returned the address as '192.168.2.132 8000', and CANDIDATE is effective.
type: answer, sdp: v=0
o=SRS/4.0.17(Leo) 18355360 2 IN IP4 0.0.0.0
s=live_play_session
t=0 0
a=ice-lite
a=group:BUNDLE 0 1
a=msid-semantic: WMS live/livestream
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=ice-ufrag:P7GYPLL1
a=ice-pwd:2Byy9I7PchRkPd8dNfaWXoRegf5i8gB8
a=ice-options:trickle
a=fingerprint:sha-256 8C:E5:5E:2E:5D:01:B1:81:21:66:6B:BF:66:91:C7:AF:46:68:50:76:F7:FE:38:5E:D4:46:70:F7:68:DE:AD:6B
a=setup:passive
a=mid:0
a=sendonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=ssrc:1 cname:test_sdp_cname
a=candidate:10 1 udp 2115783679 192.168.2.132 8000 typ host generation 0
m=video 9 UDP/TLS/RTP/SAVPF 102
c=IN IP4 0.0.0.0
a=ice-ufrag:P7GYPLL1
a=ice-pwd:2Byy9I7PchRkPd8dNfaWXoRegf5i8gB8
a=ice-options:trickle
a=fingerprint:sha-256 8C:E5:5E:2E:5D:01:B1:81:21:66:6B:BF:66:91:C7:AF:46:68:50:76:F7:FE:38:5E:D4:46:70:F7:68:DE:AD:6B
a=setup:passive
a=mid:1
a=sendonly
a=rtcp-mux
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=ssrc:2 cname:test_sdp_cname
a=candidate:10 1 udp 2115783679 192.168.2.132 8000 typ host generation 0
TRANS_BY_GPT3
Network capture data
Your package does not contain packets for 1985 and 8000.
TRANS_BY_GPT3
Where is the complete SRS log? Are you pushing a different stream? Can you try using the built-in doc/source.200kbps.768x320.flv
with SRS first?
TRANS_BY_GPT3
Where is the complete SRS log? Are you pushing a different stream? Can you try with the built-in
doc/source.200kbps.768x320.flv
first?
The issue indeed lies with the streaming file. The streaming works fine when using this file instead.
The problematic stream is as follows: I directly capture from the camera and push it to SRS using the following command:
ffmpeg -f avfoundation -video_size 640x480 -framerate 30 -i 0:0 -vcodec libx264 -preset veryfast -f flv rtmp://192.168.199.100/live/livestream
Docker SRS logs
docker log.txt
TRANS_BY_GPT3
@winlinvip @duduathz I checked the audio and video format of the file 'doc/source.200kbps.768x320.flv'. Only need to set the video stream encoding format to yuv420p, and my streaming test below passed. (Really regretful, the ARM version needs webrtc function, spent two days on it, still unsuccessful)
ffmpeg.exe -f dshow -i audio="virtual-audio-capturer" -f dshow -i video="screen-capture-recorder" -vcodec libx264 -acodec aac -s 1920*1080 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -r 15 -f flv rtmp://192.168.2.175/live/livestream
TRANS_BY_GPT3
Let me add one more thing here, WebRTC supports H.265, but RTMP protocol does not support H.265 protocol.
TRANS_BY_GPT3
@sevenzoe This parameter is indeed useful. I want to ask, how did you check the format?
TRANS_BY_GPT3
Remember to change the configuration file.
What needs to be modified in the configuration file? I am also using the default configuration and streaming with OBS. However, when using the official rtc player, I found that it cannot play and the log reports: Playing RTMP is working fine.
TRANS_BY_GPT3
Your IP settings are incorrect, you can configure the server (refer to the documentation), or add a parameter eip for playback.
http://ossrs.net/players/rtc_player.html?autostart=true&eip=39.100.214.73
Remember to replace eip with the IP address of your server. This IP address should be accessible from your browser.
TRANS_BY_GPT3
Description
Replay
Expected Behavior:
Confirm solution to the problem.
TRANS_BY_GPT3