通过PHP的FFMPEG - 没有生成缩略图或日志输出

I'm trying to get my head around command line syntax in the form of FFMPEG via PHP.

I've successfully installed it and I can use it fine, until I try to:

  • run background tasks
  • generate output to a log

This code attempts to create a thumbnail from a video. And it does, if I make it synchrnous, i.e. remove everything from onwards </dev....

shell_exec($i = 'ffmpeg -y -i '.$fp.' -ss '.$secs.' -vframes 1 '.$dirs_path.'/thumb.png  </dev/null >/dev/null 2>/ffmpeg.txt &');

I've derived the background part of this command from this page on the official FFMPEG site.

($secs is an integer denoting a seconds point within the video duration, and $fp is the save path of the video. Both are valid.)

So the thumb doesn't get generated, and there's no ffmpeg.txt created, either in the place where the script runs, or in the server root or anything. I may be looking in the wrong place... I'm unsure what all this is relative to.

Any help appreciated.