【问题标题】:run ffprobe via shell_exec on php give no output but the main command itself在 php 上通过 shell_exec 运行 ffprobe 没有输出,但主命令本身
【发布时间】:2019-11-05 10:38:14
【问题描述】:

从 php 执行 ffprobe 命令(在 windows 主机上)没有输出任何想法如何解决这个问题?

$batexec = ("C:\\Users\\Administrator\\Desktop\\nginx\\nginx\\ffmpeg\\bin\\ffprobe.exe ffprobe -v quiet -print_format json -show_streams -show_format rtmp://example.com/live/live");

shell_exec($batexec);

echo $batexec;

【问题讨论】:

    标签: php exec shell-exec ffprobe


    【解决方案1】:

    在使用ffprobe 时,您必须指明 .exe 文件的路径,而不需要重复 ffprobe 部分,例如在您应该使用的情况下

    $result = shell_exec("C:\\Users\\Administrator\\Desktop\\nginx\\nginx\\ffmpeg\\bin\\ffprobe.exe -v quiet -print_format json -show_streams -show_format rtmp://example.com/live/live");
    
    print("result :: $result");
    

    使用您拥有的示例,您将 ffprobe 作为参数传递给 ffprobe.exe

    【讨论】:

    • 返回空无结果
    • 您的示例正在运行,我只需将 \\ 添加到 ffprobe.exe 路径,现在它正在运行,因此请编辑您的答案以批准它
    • 这个 ** C:\Users\Administrator\Desktop\nginx\nginx\ffmpeg\bin\ffprobe.exe 的输出是什么 **
    • 如果路径只有一个反斜杠,则无输出。如果您添加双反斜杠,您的代码是正确的
    猜你喜欢
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    • 1970-01-01
    • 2020-08-14
    • 2013-01-01
    • 1970-01-01
    • 2011-05-21
    • 2017-07-15
    相关资源
    最近更新 更多