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

nginx: [emerg] unknown directive "rtmp" in /etc/nginx/conf.d/rtmp.conf:1 #4

Closed
ddif opened this issue May 18, 2012 · 25 comments
Closed

Comments

@ddif
Copy link

ddif commented May 18, 2012

It gives error below:

nginx: [emerg] unknown directive "rtmp" in /etc/nginx/conf.d/rtmp.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

nginx version: nginx/1.2.0
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
TLS SNI support disabled
configure arguments: --add-module=/usr/local/src/arut-nginx-rtmp-module/ --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -m64 -mtune=generic'

content of rtmp.conf

rtmp {
server {

    listen 1935;

    chunk_size 4000;

    max_buf 1M;


  application fullhd {
        live on;

        # Pull all streams from remote machine
        # and play locally
        pull localhost:1934;
    }

}

http {

server {

    listen 8080;

    # This URL provides RTMP statistics in XML
    location /stat {
        rtmp_stat all;

        # Use this stylesheet to view XML as web page
        # in browser
        rtmp_stat_stylesheet stat.xsl;
    }

    location /stat.xsl {
        # XML stylesheet to view RTMP stats.
        # Copy stat.xsl wherever you want
        # and put the full directory path here
        root /home/film;
    }
}

}

@arut
Copy link
Owner

arut commented May 18, 2012

rtmp.conf is included in nginx.conf.
please show nginx.conf to see the context

probably it's included in http context.

@ddif
Copy link
Author

ddif commented May 18, 2012

yes it was i moved outside but it gives that error atm :

nginx: [emerg] unknown directive "max_buf" in /etc/nginx/conf.d/rtmp.conf:6

@ddif
Copy link
Author

ddif commented May 18, 2012

and
nginx: [emerg] unknown directive "http" in /etc/nginx/conf.d/rtmp.conf:18

@arut
Copy link
Owner

arut commented May 18, 2012

thanks for your report.
this directive is deprecated.
I've removed it from README

@arut
Copy link
Owner

arut commented May 18, 2012

about http error:
you missed a closing bracket to close rtmp{} before opening http{}

@ddif
Copy link
Author

ddif commented May 18, 2012

I need to send that requests to flash media server and send it to client whitch running on another on same matchine. Module works but it dont sending requests to fms server. Application name is live

I tried both that config it didnt works.

rtmp {
server {

    listen 1935;
    chunk_size 4000;

max_buf 1M;

  application live/ {
        live on;
        push 127.0.0.1:1940;
    }

}

}

@arut
Copy link
Owner

arut commented May 18, 2012

  • remove slash after 'live' and try again
  • what application name does fms expect from you?

@ddif
Copy link
Author

ddif commented May 18, 2012

if i remove stats page not shows requests. I can see requests right now but it dont pushing to my flash media server.

RTMP #clients In bytes Out bytes In Kbps Out Kbps Size Frame Rate Video Audio State
140774 149619 5 5
live/
live streams 82
mp4:/Partli-Sistem/Drive.Angry.2011.720p/Drive.Angry.2011-p4.mp4 1 0 0 0 0 0x0 0
mp4:/Partli-Sistem/Thor.2011.720p/Thor2011-p1.mp4 3 0 0 0 0 0x0 0
mp4:/Partli-Sistem/Clash.Of.The.Titans.2010.720p/Clash.Of.The.Titans.2010-p2.mp4 3 0 0 0 0 0x0 0

@ddif
Copy link
Author

ddif commented May 18, 2012

Flash application name is live as well and running port 1940

@arut
Copy link
Owner

arut commented May 18, 2012

slash is not needed there since your app's name is 'live'.
if you have problems without it then your client (flash? ffmpeg?) seems to use the wrong app name.
check it first.

@ddif
Copy link
Author

ddif commented May 18, 2012

sir requests are correct. Problem is module didnt sending any requests to my fms. As i said i can see the file names corrent on your module page.

  application fullhd/ {
        live on;
        push 127.0.0.1:1940;
    }

is it right configuration for me ;?

@arut
Copy link
Owner

arut commented May 18, 2012

I see from this config your app name contains slash but from what you've said above it doesn't.
ok.

could you reconfigure nginx with --with-debug & send me your log?

@ddif
Copy link
Author

ddif commented May 18, 2012

2012/05/18 18:22:14 [error] 15234#0: *232 open() "/etc/nginx//html/fcs/ident2" failed (2: No such file or directory), client: 78.185.213.144, server: localhost, request: "POST /fcs/ident2 HTTP/1.1", host: "cdn02.test.com"
2012/05/18 18:22:14 [error] 15234#0: *233 open() "/etc/nginx//html/fcs/ident2" failed (2: No such file or directory), client: 78.187.224.246, server: localhost, request: "POST /fcs/ident2 HTTP/1.1", host: "cdn02.test.com"
2012/05/18 18:22:14 [error] 15234#0: *234 open() "/etc/nginx//html/open/1" failed (2: No such file or directory), client: 78.185.213.144, server: localhost, request: "POST /open/1 HTTP/1.1", host: "cdn02.test.com"
2012/05/18 18:22:14 [error] 15234#0: *235 open() "/etc/nginx//html/open/1" failed (2: No such file or directory), client: 78.187.224.246, server: localhost, request: "POST /open/1 HTTP/1.1", host: "cdn02.test.com"
2012/05/18 18:22:14 [error] 15234#0: *236 open() "/etc/nginx//html/fcs/ident2" failed (2: No such file or directory), client: 78.185.213.144, server: localhost, request: "POST /fcs/ident2 HTTP/1.1", host: "cdn02.test.com"

@arut
Copy link
Owner

arut commented May 19, 2012

this is not full debug log
you need to

  1. recofigure with --with-debug
  2. build again
  3. restart nginx
  4. make sure you have you have line like this in nginx.conf:
    error_log /var/log/nginx_error_log debug;

then please try again & send log.
there should be really A LOT of debug info in log.

Actually there CAN be a problem pushing to FMS from nginx-rtmp
(initially the code was intended to push from nginx-rtmp to nginx-rtmp).
FMS probably does more checks on RTMP handshake. We should make
sure the problem is there. If so, I'm ready to update the code but I need
FMS. If you give me access to yours I believe I could fix that in 1hr.
Anyway I must see log first.

@ddif
Copy link
Author

ddif commented May 19, 2012

Okay you can download it from http://178.33.230.89:81/aaaa.tar.gz.changeme . you need to change extension tar.gz for open

waiting your reply , thanks alot for helping.

@arut
Copy link
Owner

arut commented May 19, 2012

I see no publish requests in log.
I thought you were trying to PUSH data to FMS (receive live broadcast with nginx-rtmp and send it to FMS - that's exactly what push command does)
But now it seems to me you were trying to receive data from FMS and play it through nginx-rtmp, In this case you should use pull command.
Am I right?

@ddif
Copy link
Author

ddif commented May 19, 2012

i am trying to get video from
fms whitch is client requested not to send fms

@arut
Copy link
Owner

arut commented May 19, 2012

in this case you need to use 'pull' , not 'push'

@ddif
Copy link
Author

ddif commented May 19, 2012

it tried to change that push to pull it is not working eighter and makes % 100 cpu usage

@arut
Copy link
Owner

arut commented May 19, 2012

show the log

@ddif
Copy link
Author

ddif commented May 19, 2012

http://178.33.230.89/new.log.new you need to change extension tar.gz again.

Thank you

@arut
Copy link
Owner

arut commented May 21, 2012

I tried to connect to your server with application name from the log but FMS says 'Invalid uri'. You probably changed server conf (or external connections are forbidden). Please run the server so that I could test the connection. I have nginx-rtmp version with updated handshake & more detailed logging for testing.

@ddif
Copy link
Author

ddif commented May 21, 2012

Server ip address is 178.33.230.89 and port is 1935 . Application name is fullhd , you can test with that video detailed below :

rtmp://178.33.230.89/fullhd//mp4:/Partli-Sistem/Clash.Of.The.Titans.2010.720p/Clash.Of.The.Titans.2010-p1.mp4

@arut
Copy link
Owner

arut commented May 21, 2012

I've committed several updates to make pulling from FMS work. Please try the most recent code. On my laptop it worked (I saw the movie from your FMS in my flash player) but there were some problems which I think are caused by my network connection.

@sidarayam
Copy link

Hi,
i have built nginx with rtmp module and created rtmp.conf file in "/etc/nginx/conf.d/". i included it in /etc/nginx/nginx.conf file outside http block, but still i am getting " nginx: [emerg] unknown directive "rtmp" in /etc/nginx/conf.d/rtmp.conf.

Can you help me in this.
attached my nginx.conf file.
nginx.docx

DvdGiessen pushed a commit to DvdGiessen/nginx-rtmp-module that referenced this issue Jan 16, 2019
Don't truncate framerate for MPEG-DASH
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

3 participants