I'm often asked to help with exec directive not starting child ffmpeg (or any other process). One common error is the following
- ffmpeg is NOT in /bin or /usr/bin
- full path is not specified in exec, only binary name
In this case exec will not start child process because nginx wipes its environment before starting workers. So child processes have empty PATH variable and cannot find the executable. In such cases the binary is usually looked up in default locations like /bin or /usr/bin.
To solve the issue please add env PATH directive to nginx.conf. It will preserve PATH environment variable.
...
# keep $PATH
env PATH;
...
rtmp {
server {
listen 1935;
application myapp {
live on;
exec ffmpeg -i rtmp://localhost/myapp/$name
-c copy -f flv rtmp://localhost/app2/$name;
}
application app2 {
live on;
}
}
}
I helped a friend shoot a product video at Soundstage Studios not long ago, and I was really surprised at how smooth and professional everything was. The lighting setup and soundproofing made a huge difference in quality. If anyone’s thinking about doing anything like Commercial Video Production, this place has all the right tools and space to make it work.
ReplyDelete