Welcome! Log In Create A New Profile

Advanced

push directive is forcing local stream to fail

Vieri via nginx
April 12, 2018 03:26AM
Hi,

I have RTMP clients streaming to my local nginx-rtmp server so others can view the stream via HTTP (HLS and DASH). I also push the RTMP stream to Youtube on a live channel.

Pushing the stream to Youtube should be optional, in my case. In other words, if that fails for whatever reason, the client should still be able to publish to my local nginx server. Today, for some reason the youtube service failed, and the client stopped publishing.

I have two questions regarding this scenario.

1) Is it possible to silently and automatically by-pass the push to youtube, and keep streaming "locally"?

2) How can I set up two "applications" in nginx.conf so that both do exactly the same, except one streams (pushes) to youtube while the other doesn't? HLS and DASH settings (as well as paths) should be the same. Also, I currently cannot use ffmpeg to, eg., stream copy from one "application" context to another. Is there a way to do this without ffmpeg?

Here's part of my nginx.conf:

rtmp {

    server {

 [...]
       application live {

            live on;

            record all;
[...]
            allow publish 10.215.145.120;
            allow publish 10.215.248.68;
            allow publish 10.215.248.54;
            allow publish 10.215.144.116;
            allow publish 127.0.0.1;
            deny publish all;

            allow play all;

            hls on;
 [...]

            dash on;
[...]

            push rtmp://a.rtmp.youtube.com/live2/mystreamname;

[...]
       }

Here's the error log:

2018/04/12 08:24:02 [info] 29518#0: *1 client connected '10.215.145.120'
2018/04/12 08:24:02 [info] 29518#0: *1 connect: app='live' args='' flashver='' swf_url='' tc_url='rtmp://10.215.144.91:1935/live' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:02 [info] 29518#0: *1 createStream, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:02 [info] 29518#0: *1 publish: name='SHH' args='' type=live silent=0, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:02 [info] 29518#0: *1 exec: starting unmanaged child '/opt/custom/scripts/run/scripts/streaming/nginx_notifier.sh', client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:02 [info] 29518#0: *1 relay: create push name='SHH' app='' playpath='' url='a.rtmp.youtube.com/live2/streamname', client: 10..215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:02 [notice] 29518#0: signal 17 (SIGCHLD) received from 1186
2018/04/12 08:24:02 [notice] 29518#0: unknown process 1186 exited with code 0
2018/04/12 08:24:02 [info] 29518#0: epoll_wait() failed (4: Interrupted system call)
2018/04/12 08:24:02 [info] 29518#0: *2 handshake: digest not found, client: a.rtmp.youtube.com/live2/streamname, server: ngx-relay
2018/04/12 08:24:11 [info] 29518#0: *1 deleteStream, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:11 [info] 29518#0: *1 exec: starting unmanaged child '/opt/custom/scripts/run/scripts/streaming/nginx_notifier.sh', client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:11 [info] 29518#0: *1 exec: starting unmanaged child '/opt/custom/scripts/run/scripts/streaming/index_flv.sh', client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:11 [info] 29518#0: *2 disconnect, client: a.rtmp.youtube.com/live2/streamname, server: ngx-relay
2018/04/12 08:24:11 [info] 29518#0: *2 deleteStream, client: a.rtmp.youtube..com/live2/streamname, server: ngx-relay
2018/04/12 08:24:11 [info] 29518#0: *1 disconnect, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:11 [info] 29518#0: *1 deleteStream, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:11 [notice] 29518#0: signal 17 (SIGCHLD) received from 1238
2018/04/12 08:24:11 [notice] 29518#0: unknown process 1238 exited with code 1
2018/04/12 08:24:11 [info] 29518#0: epoll_wait() failed (4: Interrupted system call)
2018/04/12 08:24:11 [notice] 29518#0: signal 17 (SIGCHLD) received from 1237
2018/04/12 08:24:11 [notice] 29518#0: unknown process 1237 exited with code 0
2018/04/12 08:24:11 [info] 29518#0: epoll_wait() failed (4: Interrupted system call)
2018/04/12 08:24:12 [info] 29518#0: *3 client connected '10.215.145.120'
2018/04/12 08:24:12 [info] 29518#0: *3 connect: app='live' args='' flashver='' swf_url='' tc_url='rtmp://10.215.144.91:1935/live' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [info] 29518#0: *3 createStream, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [info] 29518#0: *3 publish: name='SHH' args='' type=live silent=0, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [info] 29518#0: *3 exec: starting unmanaged child '/opt/custom/scripts/run/scripts/streaming/nginx_notifier.sh', client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [info] 29518#0: *3 relay: create push name='SHH' app='' playpath='' url='a.rtmp.youtube.com/live2/streamname, client: 10.215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [error] 29518#0: connect() to [2a00:1450:401f:7::c]:1935 failed (101: Network is unreachable)
2018/04/12 08:24:12 [error] 29518#0: *3 relay: push failed name='SHH' app='' playpath='' url='a.rtmp.youtube.com/live2/streamname', client: 10..215.145.120, server: 0.0.0.0:1935
2018/04/12 08:24:12 [notice] 29517#0: signal 17 (SIGCHLD) received from 29518
2018/04/12 08:24:12 [alert] 29517#0: worker process 29518 exited on signal 11
2018/04/12 08:24:12 [notice] 29517#0: start worker process 1284
2018/04/12 08:24:12 [notice] 29517#0: signal 29 (SIGIO) received

Thanks,

Vieri

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

push directive is forcing local stream to fail

Vieri via nginx April 12, 2018 03:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 240
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready