简体   繁体   English

nginx rtmp-module 无法执行 ffmpeg

[英]nginx rtmp-module can't execute ffmpeg

I am having an issue with nginx-rtmp-module exec ffmpeg command.我在使用 nginx-rtmp-module exec ffmpeg 命令时遇到问题。 i have followed the example on www.github.com/arut/nginx-rtmp-module我遵循了 www.github.com/arut/nginx-rtmp-module 上的示例

/home/junaid/bin/ffmpeg -f video4linux2 -i /dev/video1 -c:v libx264 -an -f flv rtmp://127.0.0.1:1935/myapp/mystream

the command is working fine in terminal该命令在终端中工作正常

Config file:配置文件:

rtmp {
server {
    listen 1935;
    ping 30s;
    notify_method get;

    application myapp {
    live on;
    allow play all;
    exec_static /home/junaid/bin/ffmpeg -f video4linux2 -i /dev/video1 -c:v libx264 -an -f flv rtmp://127.0.0.1:1935/myapp/mystream;      
 }
}

Error log: http://www.codepad.org/enD4wlZ9错误日志: http : //www.codepad.org/enD4wlZ9

I have tried:我试过了:

  • nginx running as root (have permission to execute ffmpeg)以root身份运行的nginx(有权限执行ffmpeg)
  • using ip instead of localhost使用 ip 而不是 localhost
  • using complete path to ffmpeg使用 ffmpeg 的完整路径
  • executing bash file (having ffmpeg and echo commands: echo commands execute just fine) from nginx从 nginx 执行 bash 文件(具有 ffmpeg 和 echo 命令:echo 命令执行得很好)

please help me resolve this issue请帮我解决这个问题

got it. 得到它了。 the problem was permission error to /dev/video0 just changed /dev/video0 to rtsp address of camera 问题是/ dev / video0的权限错误,只是将/ dev / video0更改为摄像机的rtsp地址

exec 命令需要将程序放在 PATH envs 中,因此只需安装 ffmpeg,或添加

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM