MonaSolutions / MonaServer

A lightweight RTMFP, RTMP, WebSocket and HTTP server!
http://monaserver.ovh
GNU General Public License v3.0
708 stars 213 forks source link

repeatedly publishing stream to monaserver #62

Closed cybertxt closed 6 years ago

cybertxt commented 7 years ago

When restart the ffmpeg publishing, connection seems not working well.

./ffmpeg -re -stream_loop 1 -i ~/Videos/Kq1R6Ur9cq4.mp4 -vcodec libx264 -r 30 -threads 0 -f flv -y rtmfp://192.168.26.234/live;

Sever Side

RTMFP/RTMFPSession.h[82] Client failed, failed on client side
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 2 unfound for acknowledgment on session RTMFP session 1
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 3 unfound for acknowledgment on session RTMFP session 1
RTMFP\RTMFProtocol.cpp[47] Unknown RTMFP session 4
RTMFP/RTMFPSession.h[82] Client failed, failed on client side
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 2 unfound for acknowledgment on session RTMFP session 1
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 3 unfound for acknowledgment on session RTMFP session 1
RTMFP\RTMFProtocol.cpp[47] Unknown RTMFP session 4
RTMFP/RTMFPSession.h[82] Client failed, failed on client side
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 2 unfound for acknowledgment on session RTMFP session 1
RTMFP\RTMFPSession.cpp[401] RTMFPWriter 3 unfound for acknowledgment on session RTMFP session 1

Publishing Side

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/Videos/Kq1R6Ur9cq4.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2017-01-12T05:47:11.000000Z
  Duration: 00:03:05.27, start: 0.000000, bitrate: 1445 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 1315 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2017-01-12T05:47:11.000000Z
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2017-01-12T05:47:11.000000Z
      handler_name    : ISO Media file produced by Google Inc.
20:20:03.9 [INFO] Peer ID : 
01fab4c8a826ff6c1ae6f2141f7d031f7bde71a52b919d8acae1359696414814
20:20:03.9 [INFO] RTMFPSession is now connected to 192.168.26.234
onStatusEvent : NetConnection.Connect.Success - Connection succeeded
20:20:04.0 [INFO] Sending peer info (port : 40733 - port ipv6 : 59141)
RTMFP Connect called : 1
20:20:04.0 [INFO] Creation of the publisher stream 1
20:20:04.0 [INFO] Set Keepalive timer : server period=10000ms - peer period=15000ms
20:20:04.0 [INFO] Initialization of the publisher live (audioReliable : true - videoReliable : true)
onStatusEvent : NetStream.Publish.BadName - live is already publishing
20:20:04.0 [INFO] Session 192.168.26.234 is closing
20:20:23.0 [INFO] Deleting connection 1...
thomasjammet commented 7 years ago

Hi,

It looks like you already have a publisher with publication name "live" ("NetStream.Publish.BadName - live is already publishing"), can you try with a new one? Also it is possible that a publication doesn't close directly on the server side if the publisher close the connection abruptly. In this case the server will wait at least 2 minutes before deleting the session and the publication.

I have tried with latest version of ffmpeg & librtmfp, it's working well.

cybertxt commented 6 years ago

@thomasjammet Thanks for your info!