Stream Disconnections when Sending Static Images from ATEM Mini Pro to NMS
Using an ATEM Mini pro device, the HDMI captured footage is streamed via RTMP to NMS and converted into an HLS stream for client playback. If the captured footage content is static (for example, a computer desktop with no operation), the NMS stream will disconnect after about 1 minute and 50 seconds. The player loading the M3U8 file will report 404. After a short period of time, it will resume again.
I had the same issue here, but the disconnect is every 40 sec and it's very precise :)
BUT I tried with nginx-rtmp in the middle and it worked perfectly :/ I did a 44 minutes live without any single frame lost using my nginx conf above like this : Atem > rtmp to > nginx-rtmp > pushing via rtmp to > peertube
(nginx config at the end of this message)
no idea what it tells us, but to me it seems that there is something weird in ATEM RTMP client protocol, not frames / codecs since nginx-rtmp is not remuxing or transcoding anything ...
Then when I test directly with https://www.npmjs.com/package/node-media-server the log is :
process@indymotion:~/node_modules/.bin$ ./node-media-server
[14/05/2025 16:25:08] [INFO] Node-Media-Server v4.0.17
[14/05/2025 16:25:08] [INFO] Homepage: https://github.com/illuspas/Node-Media-Server
[14/05/2025 16:25:08] [INFO] License: Apache-2.0
[14/05/2025 16:25:08] [INFO] Author: Chen Mingliang
[14/05/2025 16:25:08] [INFO] Rtmp Server listening on port 0.0.0.0:1996
[14/05/2025 16:25:17] [INFO] RTMP session mao18wt7y3p0tguc 1.2.3.4:51916 start push /livetest/
[14/05/2025 16:25:57] [INFO] RTMP session mao18wt7y3p0tguc close
[14/05/2025 16:26:07] [INFO] RTMP session mao19zet5pvlw9p9 1.2.3.4:60977 start push /livetest/
[14/05/2025 16:26:47] [INFO] RTMP session mao19zet5pvlw9p9 close
[14/05/2025 16:26:57] [INFO] RTMP session mao1b208219iwilr 1.2.3.4:53650 start push /livetest/
[14/05/2025 16:27:37] [INFO] RTMP session mao1b208219iwilr close
[14/05/2025 16:27:47] [INFO] RTMP session mao1c4llpa8ra7zg 1.2.3.4:62706 start push /livetest/
it looks like there is some kind of timeout at 40sec. Of course, the timeout may be on ATEM side, which could expect something from the server and don't receive it. Or it could be on node-media-server waiting for something and not receiving it either :/ as of now : no idea.
How could we help debuging this one?
using this nginx conf it's working perfectly with no disconnection:
rtmp {
server {
listen 1995;
chunk_size 4096;
allow publish 127.0.0.1;
deny publish all;
application livetest123 {
allow publish all;
push rtmp://localhost.fr:1996/livetest123
live on;
access_log /var/log/nginx/rtmp_access.log;
}
}
I am affected by the same bug via PeerTube and can also provide more data if requested. I also am not sure what information would be needed. I think that we should probably capture both connections with Wireshark and look for differences.