Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtmp 推流使用不同的域名,但app和Stream一致时,通过配置两个sever,每个 server下配置不同的server_name、serverid和hls_path,当对两个域名同时推rtmp流时发现只能推一个域名的流,另一个会提示"Server error: Already publishing",不知道是配置的原因还是RTMP模块本身就不支持这种方式? #1

Open
wangjjxuer opened this issue Aug 13, 2020 · 0 comments

Comments

@wangjjxuer
Copy link

rtmp.conf:

rtmp {
fast_reload on;

 server{
     listen        1935 so_keepalive=on;
     serverid server1;
     server_name push.b.com;
	 
     rtmp_auto_pull on;
     rtmp_auto_pull_port unix:/home/orsjitp/nginx/sbin/rtmp;
     max_connections 10240;
     timeout       60s;
     ping          3m;
     ping_timeout  30s;
     max_streams   32; 
     ack_window 5000000;
     chunk_size 4096;
     max_message 10M;
     buflen  1000ms;

    application *{
         hevc_codecid  12;
         hls_fragment_slicing plain;
         hls_continuous on;
         live on;
         hls on;
         hls_path /dev/shm/rtmp/b;
         hls_fragment 10s;
         hls_playlist_length 60s;
         hls_nested on;
         allow publish all;
         allow play all;
         exec_options off;
         meta   on;
         interleave on;             
         wait_key    on;
         wait_video  on;
         publish_notify  on;
         drop_idle_publisher 10s;
         sync  10ms;
         play_restart off;
         idle_streams on;
    }
}

 server{
     listen        1935 so_keepalive=on;
     serverid server2;
     server_name push.m.com;

     rtmp_auto_pull on;
     rtmp_auto_pull_port unix:/home/orsjitp/nginx/sbin/rtmp;
     max_connections 10240;
     timeout       60s;
     ping          3m;
     ping_timeout  30s;
     max_streams   32; 
     ack_window 5000000;
     chunk_size 4096;
     max_message 10M;
     buflen  1000ms;

    application *{
         hevc_codecid  12;
         hls_fragment_slicing plain;
         hls_continuous on;
         live on;
         hls on;
         hls_path /dev/shm/rtmp/m;
         hls_fragment 10s;
         hls_playlist_length 60s;
         hls_nested on;
         allow publish all;
         allow play all;
         exec_options off;
         meta   on;
         interleave on;             
         wait_key    on;
         wait_video  on;
         publish_notify  on;
         drop_idle_publisher 10s;
         sync  10ms;
         play_restart off;
         idle_streams on;
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant