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.72k stars 567 forks source link

[bug]exec_options在windows下编译出的Nginx里不起作用 #212

Closed gesong2077 closed 2 years ago

gesong2077 commented 2 years ago

Expected behavior / 期望行为

像Linux中Nginx的行为一样,当输入播放地址请求播放时,执行exec_pull里的命令

Actual behavior / 实际行为

Linux下正常,Windows下完全不起作用,试过不同的路径写法 \ /,添加环境变量,全都不起作用

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

操作系统:Windows 10 Nginx版本号:1.20.1

Configuration file / 配置文件

RTMP Settings

rtmp { out_queue 4096; out_cork 16; max_streams 128;

wait_video on;

#wait_key on;
server {
    listen 1389;
    chunk_size 4096;

    application live_udp {

        live on;

                   # self-control
        exec_options on;

                   exec_pull D:\\Nginx-Build\\nginx-1.20.1-build-with-rtmp\\ffmpeg.exe -discard nokey -i rtsp://admin:12345@xx.xx.xx.xx -b:v 1.5M -vcodec copy -an -f flv rtmp://127.0.0.1:1389/live_udp/$name name=test1;
    }
}

}

Steps to reproduce the behavior / 复现问题步骤

windows下将rtmp或http-flv模块编译到nginx中,编译完后运行,直播功能正常,exec_pull不起作用,无论是使用相对路径,绝对路径或是环境变量,用VLC播放流rtmp://127.0.0.1:1389/live_udp/test1时,无法正常播放。把exec_pull后的指令单独拿命令行执行后,VLC可播放。Linux下无此问题。

winshining commented 2 years ago

windows-limitations 根本原因是 Windows 没有 exec 函数族。 The root cause is that there are not exec functions in Windows.