Using ffmpeg, PHP and beanstalk

后端 未结 1 1063
别跟我提以往
别跟我提以往 2021-01-03 14:21

I am very new to ffmpeg and beanstalk and I need a little help. I want to use beanstalk to queue files for ffmpeg to convert. I\'ve downloaded, installed and started beansta

相关标签:
1条回答
  • 2021-01-03 14:46

    Beanstalk just passes messages around. You put something into the queue in one place, and take it out somewhere else, later.

    You could put a filename into a tube called 'ffmpeg-convert'. A PHP script running from the command line reserves the next item from the queue, and does what it needs to, putting the finished file in an appropriate place.

    If you needed more information (for example, where to put the finished file, quality settings or a new output filename), you can encode the information - an array of information converted into a Json string (with json_encode($array)) is a good choice. You put the encoded string into Beanstalk, and the cli-script decodes the string, and does the work.

    Running the worker as a command-line based script usually avoids any timeout issues. Unlike a webpage request, there is not a default timeout, also there is more latitude regarding memory use.

    0 讨论(0)
提交回复
热议问题