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

Control Module returns error 500 #1739

Open
vanlueckn opened this issue Oct 9, 2023 · 0 comments
Open

Control Module returns error 500 #1739

vanlueckn opened this issue Oct 9, 2023 · 0 comments

Comments

@vanlueckn
Copy link

I have this nginx rtmp config. Requests to the control module with curl are returning error 500. Goal of my config is to show a static image if stream is offline.

My nginx.conf:

user www-data;
worker_processes 1;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
error_log /var/log/nginx/error_log info;

events {
        worker_connections 1024;
        use epoll;
}

http {
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        log_format main
                '$remote_addr - $remote_user [$time_local] '
                '"$request" $status $bytes_sent '
                '"$http_referer" "$http_user_agent" '
                '"$gzip_ratio"';

        ignore_invalid_headers on;

        server {
                listen 80;
                server_name stream;

                access_log /var/log/nginx/stream.access_log main;
                error_log /var/log/nginx/stream.error_log info;

                root /var/www/stream;

                location /control {
                        rtmp_control all;
                }
        }
}


rtmp
{
    server
    {
        listen 1935;
	chunk_size 4096;
        ping 30s;
        notify_method get;

        application program
        {
            live on;

            pull rtmp://127.0.0.1/switcher/offline name=livefeed static;
            push rtmp://fra06.contribute.live-video.net/app/HIDDEN;
        }

        application switcher
        {
            live on;

            pull rtmp://127.0.0.1/stillstore/pause name=offline;
            pull rtmp://127.0.0.1/publish/converted name=online;
        }

        application stillstore
        {
            live on;
            wait_video on;
            wait_key on;
            exec_options on;

            exec_pull ffmpeg -f image2 -loop 1 -re -i /root/pause.jpg -c:v libx264 -preset superfast -tune zerolatency -pix_fmt yuv420p -s 1920x1080 -aspect 16:9 -r 25 -f flv -rtmp_live live rtmp://127.0.0.1/stillstore/pause name=pause;
        }

        application publish
        {
            live on;
            wait_video on;
            wait_key on;
            exec_options on;
	
	    exec ffmpeg -i rtmp://127.0.0.1/$app/$name -threads 2 -vcodec libx264 -profile:v high -b:v 6000k -preset ultrafast -c:a copy -b:a copy -a:r copy -tune zerolatency -s 1920x1080 -r 30 -bufsize 35000 -frames:v 30 -aspect "16:9" -f libx264 rtmp://127.0.0.1:1935/publish/converted;
            exec_publish curl "http://127.0.0.1/control/redirect/subscriber?app=switcher&newname=online";
            exec_publish_done curl "http://127.0.0.1/control/redirect/subscriber?app=switcher&newname=offline";
        }
    }
}

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

1 participant