首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx rtmp conf使用参数

nginx rtmp conf使用参数
EN

Stack Overflow用户
提问于 2020-01-07 22:17:52
回答 1查看 754关注 0票数 0

我使用nginx - rtmp插件模块配置服务器。

问题出在rtmp发布上。

rtmp插件模块支持on_publish_done命令。

https://github.com/arut/nginx-rtmp-module/wiki/Directives#on_publish_done

我想要这样。

on_publish_done http://MY_SERVER/$APP/$NAME ;

在nginx配置文件(nginx.conf)中可以使用$arg_XXX值。

但是我的conf-file不能观察到值。注意字符串"$arg_app","$arg_name“。

如何观察$arg_app,$arg_name ??

这是我的conf文件。

代码语言:javascript
复制
# HTTP can be used for accessing RTMP stats
http {
    access_log /Users/steve/dev/workspace/nginx/logs/access.log;
    server {
    listen      8080;
      location /local_redirect {
        rewrite ^.*$ newname? permanent;
    }
      location /cast {
        # Serve HLS fragments
        types {
          application/vnd.apple.mpegurl m3u8;
          video/mp2t ts;
        }
        root /Users/steve/dev/workspace/nginx/tmp;
        add_header Cache-Control no-cache;

      }
    }
}
rtmp {
    access_log /PATH/nginx/logs/rtmp-access.log;
    server {
      listen 1935;
      chunk_size 4000;
      application cast {
                live on;
                publish_notify on;
                hls on;
                hls_path /PATH/workspace/nginx/out;
                hls_nested on;
                hls_fragment 1s;
                hls_playlist_length 12s;
      }
      notify_method get;
      on_publish_done http://127.0.0.1:5000/$arg_app/$arg_name ; ##PROBLEM HERE!!
    }
}
EN

回答 1

Stack Overflow用户

发布于 2020-12-25 22:22:40

下图显示了一个下划线位于字符r和b之间的变量工作得很好!

对于我来说,下面的代码使用带有-c标志的bash命令就行了!试试看,兄弟

代码语言:javascript
复制
exec_publish_done bash -c "/var/hls/ex.sh ${name}";
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59630210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档