Giter Club home page Giter Club logo

Comments (10)

FingerRec avatar FingerRec commented on June 2, 2024 1

I solved this problem by adding below in first line of nginx.conf.
user root
It's Ridha Ben Njima's answer.

https://stackoverflow.com/questions/42388727/ffmpeg-exec-command-not-running-in-nginx-rtmp/45880931#45880931

from nginx-rtmp-module.

Elbandi avatar Elbandi commented on June 2, 2024

I got this issue too. I wrote a workaround: start the ffmpeg a bit later:
Elbandi/nginx-rtmp-module@4abde8a

from nginx-rtmp-module.

arut avatar arut commented on June 2, 2024

Exec is currently disabled on freebsd. If you help me to test it I'll enable it. I cannot do it right now since I'm away from city. You can comment ifdef linux in exec_module file and report what happens. ------ Первонач. сообщение ------От: [email protected]Дата: 02.08.2012 13:11:39Кому: Roman ArutyunyanТема: [nginx-rtmp-module] Exec not working in master ? (#37) Here is my simple config for current master branch on FreeBSD 9.x :

I have tried to mimic the "big & small" setup but without luck.

rtmp {
  server {
       listen 1.2.3.4:1935;
       chunk_size 128;
       publish_time_fix off;
       application proxy {
           live on;
           exec /usr/local/bin/ffmpeg -re -i rtmp://1.2.3.4:1935/$app/$name -vcodec flv -acodec copy -s 32x32 -f flv rtmp://1.2.3.4:1935/720p/$name;
           hls on;
           hls_path /home/stream/hls;
           hls_fragment 15s;
       }
       application 720p {
               live on;
       }
       application 480p {
               live on;
       }
       application 360p {
               live on;
       }
       application 240p {
               live on;
       }
   }
}

If I run the following command outside nginx in a shell ..:

/usr/local/bin/ffmpeg -re -i rtmp://1.2.3.4:1935/proxy/test -vcodec flv -acodec copy -s 32x32 -f flv rtmp://1.2.3.4:1935/720p/test;

It works as expected

What would you advise checking ?
(Note HLS works fine)


Reply to this email directly or view it on GitHub:
#37

from nginx-rtmp-module.

kelexel avatar kelexel commented on June 2, 2024

I'ld be glad to help
Recompiling right now.
Is there an event I could use to only filter from debug logs the rtmp_exec part ?

from nginx-rtmp-module.

kelexel avatar kelexel commented on June 2, 2024

Got the linux part commented, and nginx running.

I have error_log set to debug.

Doing a simple

tail -f error.log | grep -B 40 -A 40 exec

I only see the following

2012/08/02 11:21:07 [debug] 90027#0: *1 exec: run 1 command(s)

But no other log that seems to me related to exec in the 40 lines before and after that one..

Again, I do not know how to filter exec specific log infos .. Maybe there is a more appropriate way to do so ?

Ps: also tried adding "sleep 3 && " at the beginning of the exec, but no luck

from nginx-rtmp-module.

arut avatar arut commented on June 2, 2024

Was command executed actually? If not then I should debug that code. I'll do that when I come back to Moscow. ------ Первонач. сообщение ------От: [email protected]Дата: 02.08.2012 15:22:46Кому: Roman ArutyunyanТема: Re: [nginx-rtmp-module] Exec not working in master ? (#37) Got the linux part commented, and nginx running.

I have error_log set to debug.

Doing a simple

tail -f error.log | grep -B 40 -A 40 exec

I only see the following

2012/08/02 11:21:07 [debug] 90027#0: *1 exec: run 1 command(s)

But no other log that seems to me related to exec in the 40 lines before and after that one..

Again, I do not know how to filter exec specific log infos .. Maybe there is a more appropriate way to do so ?

Ps: also tried adding "sleep 3 && " at the beginning of the exec, but no luck


Reply to this email directly or view it on GitHub:
#37 (comment)

from nginx-rtmp-module.

kelexel avatar kelexel commented on June 2, 2024

I used a simple

exec echo foo > /home/stream/logs/test;

but the file /home/stream/logs/test is not created, so I assume the command is not run by nginx.

sure no problem, hope you're enjoying a vacation ;)

Ps: when you have time pls check the Wirecast related ticket too - I'm dying for that one ;)

from nginx-rtmp-module.

arut avatar arut commented on June 2, 2024

You use shell syntax which is obviously not supported. Run bash or use another command like touch. ------ Первонач. сообщение ------От: [email protected]Дата: 02.08.2012 16:12:27Кому: Roman ArutyunyanТема: Re: [nginx-rtmp-module] Exec not working in master ? (#37) I used a simple

exec echo foo > /home/stream/logs/test;

but the file /home/stream/logs/test is not created, so I assume the command is not run by nginx.

sure no problem, hope you're enjoying a vacation ;)


Reply to this email directly or view it on GitHub:
#37 (comment)

from nginx-rtmp-module.

kelexel avatar kelexel commented on June 2, 2024

Woops, I'm sorry, I was so eager to provide feedback that I did not think clearly.
I was previously using my .sh script that invokes ffmpeg, and bluntly tried to susbsitute it with a few shell commands, this was wrong.
So, I remade the tests, this time using a dead-simple shell script:

/home/stream/test.sh

#!/bin/sh
echo "foo" > /home/stream/logs/test

and in nginx:

exec /home/stream/test.sh;

but same result... no "/home/stream/logs/test" file .. so I'm assuming the exec command is not triggered..

from nginx-rtmp-module.

arut avatar arut commented on June 2, 2024

I've tested & committed exec feature on FreeBSD 6.3. Everything works perfectly. ffmpeg starts normally. Closing the issue.

from nginx-rtmp-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.