illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.91k stars 1.51k forks source link

Stream data getting lost #480

Open nickm89 opened 2 years ago

nickm89 commented 2 years ago

Hi @illuspas I am facing this issue in some of my streams at random. The stream data is getting lost partially or completely. I am saving the stream to MP4 video named stream.mp4 using the tasks in app.js with the help of FFmpeg. In some cases when the stream.mp4 is played it either starts from in-between (losing the stream content from the beginning) or gets completely blank.

Here are the access logs from one such connection-

8/19/2021 06:23:35 1496 [INFO] [rtmp connect] id=0J2P4DDP ip=::ffff:34.221.25.126 app=main args={"app":"main","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; Lavf58.20.100)","swfUrl":"","pageUrl":"","tcUrl":"rtmp://IP:PORT/main"}
[NodeEvent on postConnect] id=0J2P4DDP args={"app":"main","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; Lavf58.20.100)","swfUrl":"","pageUrl":"","tcUrl":"rtmp://IP:PORT/main"}
[NodeEvent on prePublish] id=0J2P4DDP StreamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f args={}
8/19/2021 06:23:36 1496 [INFO] [rtmp publish] New stream. id=0J2P4DDP streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f streamId=1
[NodeEvent on postPublish] id=0J2P4DDP StreamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f args={}
8/19/2021 06:23:36 1496 [INFO] [Transmuxing MP4] /main/887309d048beef83ad3eabf2a79a64a389ab1c9f to /var/www/mb-stream-store/main/887309d048beef83ad3eabf2a79a64a389ab1c9f/stream.mp4
8/19/2021 06:23:36 1496 [INFO] [Transmuxing HLS] /main/887309d048beef83ad3eabf2a79a64a389ab1c9f to /var/www/mb-stream-store/main/887309d048beef83ad3eabf2a79a64a389ab1c9f/index.m3u8
8/19/2021 06:23:37 1496 [INFO] [rtmp publish] Handle audio. id=0J2P4DDP streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 1ch
8/19/2021 06:23:37 1496 [INFO] [rtmp publish] Handle video. id=0J2P4DDP streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f frame_type=1 codec_id=7 codec_name=H264 544x960
[NodeEvent on preConnect] id=UQ5SEAW5 args={"app":"main","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:2053/main","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
8/19/2021 06:23:37 1496 [INFO] [rtmp connect] id=UQ5SEAW5 ip=::ffff:127.0.0.1 app=main args={"app":"main","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:2053/main","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
[NodeEvent on postConnect] id=UQ5SEAW5 args={"app":"main","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:2053/main","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
[NodeEvent on prePlay] id=UQ5SEAW5 StreamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f args={}
[NodeEvent on postPlay] id=UQ5SEAW5 StreamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f args={}
8/19/2021 06:23:37 1496 [INFO] [rtmp play] Join stream. id=UQ5SEAW5 streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f  streamId=1
8/19/2021 06:24:04 1496 [INFO] [rtmp publish] Close stream. id=0J2P4DDP streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f streamId=1
[NodeEvent on donePublish] id=0J2P4DDP StreamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f args={}
8/19/2021 06:24:04 1496 [INFO] [rtmp disconnect] id=0J2P4DDP
[NodeEvent on doneConnect] id=0J2P4DDP args={"app":"main","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; Lavf58.20.100)","swfUrl":"","pageUrl":"","tcUrl":"rtmp://IP:PORT/main"}
8/19/2021 06:24:06 1496 [INFO] [rtmp play] Close stream. id=UQ5SEAW5 streamPath=/main/887309d048beef83ad3eabf2a79a64a389ab1c9f streamId=1
8/19/2021 06:24:06 1496 [INFO] [rtmp disconnect] id=UQ5SEAW5
[NodeEvent on doneConnect] id=UQ5SEAW5 args={"app":"main","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:2053/main","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
8/19/2021 06:24:06 1496 [INFO] [Transmuxing end] /main/887309d048beef83ad3eabf2a79a64a389ab1c9f

Please let me know if there is something we could do to avoid it. Thanks

mtugrulesin commented 2 years ago
Oct 21 14:22:37 raspberrypi bash[6638]: [NodeEvent on donePlay] id=FCNE53CU StreamPath=/live/cam4 args={}
Oct 21 14:22:37 raspberrypi bash[6638]: 21/10/2021 14:22:37 6642 [INFO] [rtmp play] Close stream. id=FCNE53CU streamPath=/live/cam4 streamId=1
Oct 21 14:22:37 raspberrypi bash[6638]: 21/10/2021 14:22:37 6642 [INFO] [rtmp disconnect] id=FCNE53CU
Oct 21 14:22:37 raspberrypi bash[6638]: [NodeEvent on doneConnect] id=FCNE53CU args={"app":"live","flashVer":"LNX 9,0,124,2","tcUrl":"rtmp://127.0.0.1:1935/live","fpad":false,"capabilities":15,"audioCodecs":4071,"videoCodecs":252,"videoFunction":1}
Oct 21 14:22:41 raspberrypi bash[6638]: 21/10/2021 14:22:41 6642 [INFO] [Transmuxing end] /live/cam4

I have same issue.

nickm89 commented 2 years ago

Hi @illuspas @mtugrulesin Do you guys found any solution to fix this issue?

mtugrulesin commented 2 years ago

I am trying to different method if it work , i will write on question.

nickm89 @.***>, 31 Oca 2022 Pzt, 17:03 tarihinde şunu yazdı:

Hi @illuspas https://github.com/illuspas @mtugrulesin https://github.com/mtugrulesin Do you guys found any solution to fix this issue?

— Reply to this email directly, view it on GitHub https://github.com/illuspas/Node-Media-Server/issues/480#issuecomment-1025770557, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFY45KYQO43GPK2C7TQOHODUY2JE3ANCNFSM5CODQKUQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- Saygılarımla

Mehmet Tuğrul EŞİN