Edge node 1:
# the config for srs to remux rtmp to flv live stream.
# @see https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHttpStream
# @see full.conf for detail config.
listen 1935;
max_connections 1000;
pid srs.flv.1935.pid;
daemon on;
srs_log_tank file;
srs_log_file srs.log;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api{
enabled on;
listen 1985;
}
vhost __defaultVhost__ {
cluster {
mode remote;
origin 192.168.26.42:1936;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
play {
time_jitter full;
mix_correct on;
}
}
Edge node 2:
# the config for srs to remux rtmp to flv live stream.
# @see https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHttpStream
# @see full.conf for detail config.
listen 1935;
max_connections 1000;
pid srs.flv.1935.pid;
daemon on;
srs_log_tank file;
srs_log_file srs.log;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api{
enabled on;
listen 1985;
}
vhost __defaultVhost__ {
cluster {
mode remote;
origin 192.168.26.42:1936;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
play {
time_jitter full;
mix_correct on;
}
}
Core node:
# the config for srs to remux rtmp to flv live stream.
# @see https://github.com/ossrs/srs/wiki/v2_CN_DeliveryHttpStream
# @see full.conf for detail config.
listen 1936;
max_connections 1000;
daemon on;
srs_log_tank file;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api{
enabled on;
listen 1985;
}
vhost __defaultVhost__ {
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
play {
time_jitter full;
mix_correct on;
}
}
Replay
The streaming address in the log is (http://192.168.26.31:8080/live/2.flv); the above log is for edge node 1, according to the SRS log, the basic process is as follows:
Step 1: The client pulls the stream from edge node 1.
Step 3: Start streaming (corresponding to the log at 16:00:52.372)
Step 4: Client pulls the stream (corresponding to the log at 16:01:03.820)
ps: At this time, the client is the same as the one in Step 1 (reconnected)
Step 5: Client stream disconnection (corresponding to the log at 16:01:09.637)
Step 8: Stop streaming (corresponding to the log at 16:02:17.452)
Expect
In Step 7, the "clients" field of the edge node 1, which has the "name": "2", should be 2 (streaming clients and playback clients); this issue occasionally occurs.
There is another step where the inaccurate "clients" field always appears, but it is uncertain if it is the same issue:
Step 1: Choose any edge node for streaming.
Step 2: Fetch the streaming video.
Step 3: Call the /api/v1/streams endpoint, at this point the "clients" field is 2.
Step 4: Stop the playback.
Step 5: Call the /api/v1/streams endpoint, at this point the "clients" field is 0 (it should be 2-1=1).
Description
The number of clients in the '/api/v1/streams' interface is incorrect.
SRS Version: 4.0.251
SRS Log:
Replay
The streaming address in the log is (http://192.168.26.31:8080/live/2.flv); the above log is for edge node 1, according to the SRS log, the basic process is as follows:
Step 1: The client pulls the stream from edge node 1.
Step 2: Call the /api/v1/streams interface of edge node 1 and edge node 2 separately (16:00:47.426) Edge node 1: { "code": 0, "server": "vid-6565k44", "streams": [{ "id": "vid-081733f", "name": "3", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668847408, "clients": 0, "frames": 1149, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }, { "id": "vid-31re7qf", "name": "2", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668847408, "clients": 1, "frames": 0, "send_bytes": 13156322, "recv_bytes": 360, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "746uwkxf" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-3bdps75", "name": "5", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668847408, "clients": 1, "frames": 0, "send_bytes": 441128, "recv_bytes": 360, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "n2k32338" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-i5b4045", "name": "11", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668847408, "clients": 0, "frames": 2185, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }, { "id": "vid-l40l38d", "name": "4", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668847408, "clients": 2, "frames": 1020, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "z9o1288h" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }] } Edge node 2: { "code": 0, "server": "vid-6s6p9o9", "streams": [{ "id": "vid-025v181", "name": "3", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668847395, "clients": 1, "frames": 0, "send_bytes": 9738359, "recv_bytes": 360, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "8t40l827" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-1f737zo", "name": "5", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668847395, "clients": 2, "frames": 171918, "send_bytes": 1709871839, "recv_bytes": 1452830413, "kbps": { "recv_30s": 1832, "send_30s": 3729 }, "publish": { "active": true, "cid": "94l4s062" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-69920hv", "name": "4", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668847395, "clients": 1, "frames": 0, "send_bytes": 14294130, "recv_bytes": 360, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "o13t06kh" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-77q359k", "name": "2", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668847395, "clients": 0, "frames": 1821, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }] }
Step 3: Start streaming (corresponding to the log at 16:00:52.372)
Step 4: Client pulls the stream (corresponding to the log at 16:01:03.820) ps: At this time, the client is the same as the one in Step 1 (reconnected) Step 5: Client stream disconnection (corresponding to the log at 16:01:09.637)
Step 6: Client pulls the stream (corresponding to the log at 16:01:11.984) ps: At this time, the client is the same as the one in Step 4 (reconnected) Step 7: Call the /api/v1/streams interface of edge node 1 and edge node 2 respectively (16:01:18.420) Edge node 1: { "code": 0, "server": "vid-6565k44", "streams": [{ "id": "vid-5258f20", "name": "2", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668878391, "clients": 1, "frames": 670, "send_bytes": 1754798, "recv_bytes": 360, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": true, "cid": "81w3e01p" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-537fz8o", "name": "6", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668878391, "clients": 0, "frames": 916, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }, { "id": "vid-g7l51sn", "name": "3", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668878391, "clients": 0, "frames": 128, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }, { "id": "vid-i5b4045", "name": "11", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668878391, "clients": 0, "frames": 2185, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }, { "id": "vid-v21yy65", "name": "4", "vhost": "vid-95llyg7", "app": "live", "live_ms": 1682668878391, "clients": 0, "frames": 792, "send_bytes": 0, "recv_bytes": 0, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }] } Edge node 2: { "code": 0, "server": "vid-6s6p9o9", "streams": [{ "id": "vid-1f737zo", "name": "5", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668878393, "clients": 2, "frames": 172810, "send_bytes": 1718685902, "recv_bytes": 1461815832, "kbps": { "recv_30s": 1858, "send_30s": 2078 }, "publish": { "active": true, "cid": "94l4s062" }, "video": { "codec": "H264", "profile": "High", "level": "Other", "width": 128, "height": 2144 }, "audio": { "codec": "AAC", "sample_rate": 44100, "channel": 2, "profile": "LC" } }, { "id": "vid-b2x7417", "name": "1", "vhost": "vid-44mkq32", "app": "live", "live_ms": 1682668878393, "clients": 1, "frames": 537, "send_bytes": 4050, "recv_bytes": 5455822, "kbps": { "recv_30s": 0, "send_30s": 0 }, "publish": { "active": false, "cid": "" }, "video": null, "audio": null }] }
Step 8: Stop streaming (corresponding to the log at 16:02:17.452)
Expect
In Step 7, the "clients" field of the edge node 1, which has the "name": "2", should be 2 (streaming clients and playback clients); this issue occasionally occurs.
There is another step where the inaccurate "clients" field always appears, but it is uncertain if it is the same issue:
Step 1: Choose any edge node for streaming. Step 2: Fetch the streaming video. Step 3: Call the /api/v1/streams endpoint, at this point the "clients" field is 2. Step 4: Stop the playback. Step 5: Call the /api/v1/streams endpoint, at this point the "clients" field is 0 (it should be 2-1=1).
TRANS_BY_GPT3