in reply to Executing program with arguments from cgi script

I need to run ffmpeg from a CGI script, of course with arguments

This is a very dangerous thing to do. See Calling External Commands More Safely for why, and for some modules that you could use to make the risk smaller. Assuming this is on a *NIX system, at the very least, you must use the system LIST form, for example system($ffmpeg,'-i',$video,'-i',$watermark,...), and you should additionally validate the variables you're passing to the command.

Nothing works.

I suspect there is an error happening that you're not seeing. See the documentation of system on how to check for errors; the same advice from that documentation on inspecting $? applies to backticks as well.

Replies are listed 'Best First'.
Re^2: Executing program with arguments from cgi script
by natol44 (Sexton) on Jan 26, 2021 at 17:42 UTC
    I finally solved it using system. Risks seem low as the script is working in cron from a non-accessible place from users. Thank you all for your help :)
      Risks seem low

      History is littered with the corpses of those who said just that.

      At least run in taint mode: a low-impact way to remove a lot of the remaining danger.


      🦛