arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.46k stars 3.51k forks source link

on_play push redirect is pulling? #587

Open annexus opened 9 years ago

annexus commented 9 years ago

This is probably how it works, but I have a stream application in my config called test. It also has a on_play directive, like so:

http {
        server {
                listen 8080;
                location /remote_redirect {
                    rewrite ^.*$ rtmp://32.123.123.123:1931/stream? permanent;
                }
        }
}

rtmp {
        server {
                listen 1935;
                chunk_size 8192;

                application test {
                        live on;
            on_play http://32.123.123.123:8080/remote_redirect;
                        push rtmp://some.remoteserver/push/username?key=ab123456;
                }
        }
}

The logs then say:

[info] 16894#0: *1 relay: create push name='stream' app='' playpath='' url='some.remoteserver/push/username?key=ab123456', client: 32.123.123.123, server: 0.0.0.0:1935
[info] 16894#0: *2 notify: play '37.187.126.132:8080/play', client: some.remoteserver/push/username?key=ab123456, server: ngx-relay
[info] 16894#0: *2 notify: pull 'stream' from 'rtmp://37.187.126.132:1931', client: some.remoteserver/push/username?key=ab123456, server: ngx-relay
[info] 16894#0: *2 relay: create pull name='stream' app='' playpath='' url='37.187.126.132:1931', client: some.remoteserver/push/username?key=ab123456, server: ngx-relay

So it pushes the stream to rtmp://some.remoteserver/push/username?key=ab123456;. But it also tries to pull a stream via the redirect, from: rtmp://32.123.123.123:1931/stream.

What I really want is that the application test redirects and push the entire stream to the other URL rtmp://32.123.123.123:1931/stream.

Is this possible?

misiek08 commented 9 years ago

Push is for publishers, on_play is for viewers. You propably misunderstood something or your description of the problem is wrong.