winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.75k stars 571 forks source link

two questions for me about control record #265

Closed BinaryRyan closed 3 months ago

BinaryRyan commented 3 months ago

1:calling control record api and no content response like this curl 'http://127.0.0.1:1056/control/record/start?app=live&name=4c9ce73065a644fb87867bcede069219&rec=rec' 2:how to enable log for NGX_LOG_DEBUG_RTMP,I configure log with this directive error_log logs/rtmp_control.log debug;but I cannot get any useful message from this log file,and I have checked some source code in the functionngx_rtmp_record_make_path:

......
ngx_log_debug2(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
                   "record: %V path: '%V'", &rracf->id, path);

where's logs?

Expected behavior (期望行为)

return the record path that in the server

Actual behavior (实际行为)

no content

OS and Nginx version (操作系统和 Nginx 版本号)

Linux Centos8 nginx 1.22

Configuration file (配置文件)

        listen       1056; 
        server_name  localhost;
        lua_need_request_body on; 
        gzip  on; 
        gzip_min_length  1k; 
        gzip_types  text/plain;
        gzip_comp_level  5;  
        add_header  Access-Control-Allow-Origin *;
        add_header  Access-Control-Allow-Credentials true;
        add_header  Access-Control-Allow-Headers *;
        add_header  Access-Control-Allow-Methods PUT,POST,GET,DELETE,OPTIONS;
        if ($request_method = OPTIONS) {
               return 204;
        }   
        location /stat {  
            rtmp_stat all;
        }   

        location /control { 
            rtmp_control all;
        }   
        location / { 
            root   html;
            index  index.html index.htm;
        }   

        location /video {
            root /data;
        }

Steps to reproduce the behavior (复现问题步骤)

Error log if any (错误日志)

winshining commented 3 months ago
  1. DEBUG level log is eliminated by default, adding --with-debug option in configure step will make sense.
  2. if you run nginx in multi-processes mode, record will not function when control requests arrive at a process which is not the publisher.