0

I'm using FFMPEG to upload videos to my server,

I've tested on 1MB file and another one 5MB and it is working correctly, but then I've tested on 6MB and 50MB file and it try to upload but still with "processing" status with no change.

Here is the code which I use

exec("/usr/local/bin/ffmpeg -i ../uploadedvideo/".$image_name." -ab 56 -ar 44100 -b 200 -r 15 -s 240x180 -fs 314572800 -f flv ../uploadedvideo/".$image_namew.".flv"); 

What could be the problem?

Emii Khaos
  • 9,983
  • 3
  • 34
  • 57
  • Connection timeout most likely, server will disconnect after a certain amount of time if a response is not sent back. – reptilicus Jan 15 '16 at 21:37
  • Long running processes should not be handled in requests like this, offload it to a background task. – reptilicus Jan 15 '16 at 21:37
  • 2
    There is also a configurable upload size limit: http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size – reptilicus Jan 15 '16 at 21:39
  • @reptilicus I think that's the right answer, but I also suggest doing the encoding in a separate process. It can be done with sending a message to a work queue, and worker code listening to that queue. – Yaşar Şentürk Jan 15 '16 at 23:58
  • @reptilicus I'm still beginner with ffmpeg, how to make the process run in the background task ? – Yasser Hossam Jan 16 '16 at 00:09
  • @YaşarŞentürk How can we do that? Is there any tutorial for this specific point? – Yasser Hossam Jan 16 '16 at 00:11
  • @YasserHossam, you can upload the file as you are doing already. You can have a message queue system, like RabbitMQ. You can submit a message into a queue on RabbitMQ. That message can have information about the file, and parameters to ffmpeg. You can write another script that listens the same queue on RabbitMQ, and when it gets the message, you can execute the ffmpeg. See here: http://www.rabbitmq.com/getstarted.html – Yaşar Şentürk Jan 16 '16 at 00:22

0 Answers0