简体   繁体   中英

nginx rtmp-module can't execute ffmpeg

I am having an issue with nginx-rtmp-module exec ffmpeg command. i have followed the example on 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

I have tried:

  • nginx running as root (have permission to execute ffmpeg)
  • using ip instead of localhost
  • using complete path to ffmpeg
  • executing bash file (having ffmpeg and echo commands: echo commands execute just fine) from nginx

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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