arut / nginx-rtmp-module

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

exec not working #1189

Open Ponjimon opened 6 years ago

Ponjimon commented 6 years ago

I know, another issue to this topic. I've browsed through all available topics in this repo but couldn't find any solution for this issue.

I'm using nginx 1.13.8

server {
        listen 1935;
        notify_method post;
        chunk_size 4096;
        allow play all;

        application live {
                live on;
                record off;

                allow publish all;
                allow play all;

                exec_push /etc/nginx/announcer.sh;
                exec_push ffmpeg -re -i rtmp://localhost/$app/$name -c:v copy -an -f rtp rtp://<someIp> -c:a libopus -b:a 196k -vn -f rtp rtp://<someIp>
        }
}

This is the rtmp config.

If I use the exec_push parameters, not only are they simply not executed, the regular rtmp stream is not even working as well (tested with https://www.wowza.com/testplayers). If I remove them, the rtmp stream works again, but obviously I need to have this transcoding.

arsimajro commented 6 years ago

Try exec_static.

lzqdename commented 3 years ago

exec_static /usr/bin/sh shelll_script_file_name; It works, I have test it!