arut / nginx-rtmp-module

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

Configuring json support in location /stat #1716

Open asinorum opened 1 year ago

asinorum commented 1 year ago

I have Nginx installed with RTMP module installed on an Ubuntu machine:

nginx version: nginx/1.22.1 built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) built with OpenSSL 1.1.1 11 Sep 2018 TLS SNI support enabled configure arguments: --with-http_ssl_module --with-http_stub_status_module --with-http_secure_link_module --with-http_flv_module --with-http_mp4_module --add-module=../headers-more-nginx-module-master --add-module=../nginx-rtmp-module-master --with-debug --with-cc-opt=-Wimplicit-fallthrough=0

when I configure access to stat.xls in nginx.conf file:

    location /stat {
        rtmp_stat all;
        rtmp_stat_stylesheet stat.xsl;
    }

I have no problems, but if I change the configuration to support JSON, according to what I understand from #815 using the directive rtmp_stat_format in nginx.conf file like the following :

   location /stat {
        rtmp_stat all;
        rtmp_stat_format json;
    }

But it gives me an error: unknown directive "rtmp_stat_format" in /usr/local/nginx/conf/nginx.conf:112

What is the correct way to configure JSON support?

HeyJupiter commented 1 year ago

As I know, this module has not supported JSON statistics. Maybe nginx-http-flv-module will help you. It works well for me.

campones commented 1 year ago

would you say it's worth switching to this fork? because here, it's not maintained anymore so..

campones commented 1 year ago

actually it doesn't work for me anymore (I decided to move on the http-flv fork ) I don't see the point of setting up the json stat as it's not humanly readable and also since I have switched to php8.1 and ubuntu 22 so I m not quite sure where stand the issue. Basically no issue at all with nginx using the typical config for /stat but simply nothing is being displayed. Maybe I m missing a php module or something is wrong?

stat

campones commented 1 year ago

@asinorum do you have the json support in php?

I have no issue with the new fork and json rtmp stat , just the old way it's not working

[PHP Modules] bcmath calendar Core ctype curl date dom exif FFIfileinfo filter ftp gd gettext hash iconv imagick imap intl json ldap libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix pspell readline Reflection session shmop SimpleXML soap sockets sodiumSPL sqlite3 standard sysvmsg sysvsemsysvshm tidy tokenizer xml xmlreader xmlrpc xmlwriter xsl Zend OPcache zip zlib