majestic icon indicating copy to clipboard operation
majestic copied to clipboard

RTMP push from Majestic to nginx RTMP module: size 0x0, fps 0, connection interrupts after some time

Open iGraveD opened this issue 1 year ago • 1 comments

Required information

  • Camera board id: ISVP, T31X
  • OpenIPC version: 2.4.08.19-lite
  • installation method: Majestic version which came with OpenIPC

Issue description

I installed nginx with RTMP module on my server. I set up my OpenIPC camera to push RTMP stream to the server. In the statistics table, I see, that nginx recieves the stream, shows correct codec and bits/s. But in size and fps columns, it shows 0x0 and 0 respectively. Connection interrupts after some time.

Expectations

Nginx shows correct values in size and fps columns. Connection does not interrupt.

Steps to reproduce

I followed these instructions to set up nginx. Below, I will provide necessary steps only.

On my Raspberry Pi server with Debian GNU/Linux 12 (bookworm), I installed nginx version 1.22.1 with RTMP module:

sudo apt install nginx libnginx-mod-rtmp

In the end of /etc/nginx/nginx.conf file, I added:

rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                application live {
                        live on;
                        record off;
                }
        }
}

I created file /etc/nginx/sites-available/rtmp with the following contents and linked it to /etc/nginx/sites-enabled/rtmp:

server {
    listen 8080;
    server_name  localhost;

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

    location /stat.xsl {
        root /var/www/html/rtmp;
    }

    # rtmp control
    location /control {
        rtmp_control all;
    }
}

I created the directory structure for the new site and reloaded nginx:

sudo mkdir /var/www/html/rtmp
sudo wget https://raw.githubusercontent.com/arut/nginx-rtmp-module/master/stat.xsl -P /var/www/html/rtmp
sudo service nginx restart

On my camera, I installed OpenIPC and connected to its web interface. In Majestic > Settings > Outgoing, I turned on Enable outgoing streams, entered rtmp://<my server IP>/live/test in Address for outgoing stream, saved the configuration and restarted Majestic.

On my server, I opened http://localhost:8080/stat with my browser. In the statistics table, I see, that nginx recieves the stream, shows correct codec and bits/s. But in size and fps columns, it shows 0x0 and 0 respectively. Connection interrupts after some time.

iGraveD avatar Sep 09 '24 07:09 iGraveD

Might be related #189

skilurius avatar Sep 17 '24 23:09 skilurius