Периодические реконнекты (1 раз, каждые 4 часа примерно)

132 views
Skip to first unread message

Alexey Zverev

unread,
Dec 12, 2013, 2:12:30 AM12/12/13
to nginx-...@googlegroups.com
Доброго времени суток, столкнулись с такой проблемой, раз в четыре часа реконнектится паблишер (Wirecast), им мы пушим на nginx/rtmp, затем с Nginxa ffmpeg демюксит rtmp в mpeg-ts.
Как можно избавиться от этих реконнектов? 

Nginx config:
worker_processes  1;

error_log  logs/error.log debug;

events {
    worker_connections  256;
}

rtmp_auto_push on;

rtmp {
    server {
    
        listen 1935;
        ping 20s ;

        #notify_method get;
 
chunk_size 8096;
        ack_window 100000000;
max_connections  100;
        max_message 6M;
max_streams 64;


        application tv {
            live on;
            meta on;
            respawn on;
            play_restart on;
            publish_notify on;  
        }
        
        
        
        application banglamung {
            live on;
            meta on;
            respawn on;
            play_restart on;
            publish_notify on;
        }
        

        application tepmani {
            live on;
            meta on;
            respawn on;
            play_restart on;
            publish_notify on;
        
        }


        application bannampe {
            live on;
            meta on;
            respawn on;
            play_restart on;
            publish_notify on;
        }

        
    }
}

#http {

#include       mime.types; 

#   default_type  application/octet-stream;



#   sendfile        on;

#   keepalive_timeout  65;
    #server {
    #    listen      8080; #61.91.47.202:8080;
#        server_name  mediatv;
#        location /stat {
#            rtmp_stat all;
#            rtmp_stat_stylesheet stat.xsl;
#        }
#
#        location /stat.xsl {
#            root /opt/www/;
#        }

        #location /control {
        #    rtmp_control all;
        #}

        #location /publish {
        #    return 201;
        #}

        #location /play {
        #    return 202;
        #}

        #location /record_done {
        #    return 203;
        #}

        #location /rtmp-publisher {
        #    root /opt/www/www;
        #}

        #location / {
        #    root /opt/www/www;
        #}
#    }
#}

Wirecast log при реконнекте:
Dec 12 13:13:53 N: Connection Status: 0
Dec 12 13:15:05 Connection rtmp://127.0.0.1:1935/tv//sop: INetStream queueLength over max = 5038
Dec 12 13:15:05 Connection rtmp://127.0.0.1:1935/tv//sop: INetStream queueLength too large. Requesting disconnect.Dec 12 13:15:05 A: Max Queue Limit Reached. Attempt disconnect
Dec 12 13:15:05 N: onStatus: code="NetConnection.Connect.Closed" type="status" desc="(null)" details="(null)"
Dec 12 13:15:05 V: Total drop count   : 0
Dec 12 13:15:05 A: Maximum flutter    : 23.1746 ms
Dec 12 13:15:05 A: Total drop count   : 0
Dec 12 13:15:05 M: Init ----------------
Dec 12 13:15:05 M: User Agent FMLE/3.0
Dec 12 13:15:05 N: Connect rtmp://127.0.0.1:1935/tv/
Dec 12 13:15:05 N: onStatus: code="NetConnection.Connect.Success" type="status" desc="Connection succeeded." details="FMS/3,0,1,123"
Dec 12 13:15:05 N: Sending Command releaseStream(sop)
Dec 12 13:15:05 N: Sending Command FCPublish(sop)
Dec 12 13:15:05 M: Publishing 'sop'
Dec 12 13:15:05 S: onStatus() : code:"Success" type:"status" desc:"StreamCreated" details:""
Dec 12 13:15:05 S: onStatus() : code:"NetStream.Publish.Start" type:"status" desc:"Start publishing" details:"(null)"
Dec 12 13:15:05 N: Send Meta Data OK
Dec 12 13:15:05 FlashNetStream::enqueueForStream - Waiting for Keyframe
Dec 12 13:15:05 FlashNetStream::enqueueForStream - Waiting for Keyframe
Dec 12 13:15:05 Transmit_H264 frame sendH264Header: composition time 0 millisecond timestamp 0.000000
Dec 12 13:15:05 V: Start OK
Dec 12 13:15:05 A: Start OK: sample=4, channels=1, type=2
Dec 12 13:15:06 N: Connection Status: 1

Nginx log при реконнекте: 
 
2013/12/12 13:14:53 [info] 1436#0: *1958 disconnect, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:53 [info] 1436#0: *1958 deleteStream, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:54 [info] 1436#0: *2176 client connected '110.78.162.54'
2013/12/12 13:14:54 [info] 1436#0: *2176 connect: app='tv' args='' flashver='MAC 10,0,32,18' swf_url='http://localhost/player/Player.swf' tc_url='rtmp://localhost/' page_url='' acodecs=3191 vcodecs=252 object_encoding=0, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:54 [info] 1436#0: *2176 createStream, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:54 [info] 1436#0: *2176 play: name='sop' args='' start=0 duration=0 reset=0 silent=0, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:56 [info] 1436#0: *2176 disconnect, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:56 [info] 1436#0: *2176 deleteStream, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:58 [info] 1436#0: *2177 client connected '110.78.162.54'
2013/12/12 13:14:58 [info] 1436#0: *2177 connect: app='tv' args='' flashver='MAC 10,0,32,18' swf_url='http://localhost/player/Player.swf' tc_url='rtmp://localhost/' page_url='' acodecs=3191 vcodecs=252 object_encoding=0, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:58 [info] 1436#0: *2177 createStream, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:14:58 [info] 1436#0: *2177 play: name='sop' args='' start=0 duration=0 reset=0 silent=0, client: 110.78.162.54, server: 0.0.0.0:1935
2013/12/12 13:15:05 [info] 1436#0: *1960 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2013/12/12 13:15:05 [info] 1436#0: *1960 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2013/12/12 13:15:05 [info] 1436#0: *2178 client connected '127.0.0.1'
2013/12/12 13:15:05 [info] 1436#0: *2178 connect: app='tv' args='' flashver='FMLE/3.0 (compatible; FMSc/1.0)' swf_url='' tc_url='rtmp://127.0.0.1:1935/tv/' page_url='' acodecs=1026 vcodecs=128 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2013/12/12 13:15:05 [info] 1436#0: *2178 createStream, client: 127.0.0.1, server: 0.0.0.0:1935
2013/12/12 13:15:05 [info] 1436#0: *2178 publish: name='sop' args='' type=LIVE silent=0, client: 127.0.0.1, server: 0.0.0.0:1935


Wirecast и nginx находятся на одном хосте, пушим по адресу rtmp://localhost/tv/sop, ffmpeg забирает rtmp поток и находится на другом хосте.  
Насколько я понимаю, причина реконнектов Wirecast`a в этом "INetStream queueLength over max = 5038".
Как можно, и можно ли вообще увеличить этот queueLength? 


Заранее спасибо.

Reply all
Reply to author
Forward
0 new messages