0

I am trying to get ffmpeg to run as a background task in linux, I have been trying to do it like this

ffmpeg -i input.mkv -loglevel panic output.mp4 &

But whenever I run the program it halts in the beginning until I put it as a foreground task fg $1 and then I can leave the task and it runs in the background just fine, how can I make it run from the beginning as a background task without having to put it as a foreground task temporarily? I have also tried this and it didn't work

ffmpeg -i input.mkv -loglevel panic output.mp4 2> /dev/null &
Colby Quinn
  • 148
  • 1
  • 7

1 Answers1

1

I just needed to supply some sort of input to ffmpeg so it would run, I just piped nothing into ffmpeg and it runs as a background task, done like so

echo "" | ffmpeg -i input.mkv -loglevel panic output.mp4 2> /dev/null &

Edit: This same effect can be done by adding -nostdin as a flag to ffmpeg, as demonstrated below

ffmpeg -i input.mkv -nostdin -loglevel panic output.mp4 2> /dev/null &
Colby Quinn
  • 148
  • 1
  • 7