0

i have a code like this

 /home/ubuntu/bin/ffmpeg -re -v verbose -i rtmp://localhost:1935/live/title_event   \  
-http_persistent  1  -http_user_agent Custom-agent  -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type event  -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename   http://my-server/low/title_event/360p_%03d.ts http://my-server/low/title_event/index.m3u8  \ 
-http_persistent  1  -http_user_agent Custom-agent -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type event -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename  http://my-server/mid/title_event/480p_%03d.ts  http://my-server/mid/title_event/index.m3u8  

This code is working fine if i start it from terminal, but if i put it inside an "exec" in my nginx conf...it not works.

If I run nginx service status I can watch for few seconds the command, but then command disappear and appears again after few seconds.

I already used, before this edit, FFMPEG from NGINX and it works. I suppose problem can be "-http_persistent 1 -http_user_agent Custom-agent", maybe nginx manage this kind of things in a different way. I don't know :/

  • maybe nginx executes it with a different user, thus different permissions, you can try impersonating the nginx user (su) and try if it works – flagg19 Jun 4 at 15:41
  • Already tried using the same user i'm using from terminal, still nothing – tidpe Jun 5 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.