download this file

sudo chmod +x ffmpeg-pi.sh

sudo ./ffmpeg-pi.sh

For make PHP-FFMPEG :

First make folder on you php upload video

sudo mkdir /var/www/inputvideo/
sudo chmod 777 /var/www/inputvideo/
sudo mkdir /var/www/outputvideo/
sudo chmod 777 /var/www/outputvideo/

Make bash script

sudo nano /usr/local/sbin/convert
put this script on it

====== Script Bash ======
#/bin/bash/

in=/var/www/inputvideo/
out=/var/www/outputvideo/

cd $in;

for i in *.mp4 ; do
ffmpeg -i "$i" -threads 3 -c:v libx264 -preset superfast -crf 30 -c:a aac "$out${i%.*}.mp4" -y;
done
rm -f *.*
chown -c www-data:www-data /var/www/outputvideo/*.mp4

======= End Script =======

sudo chmod +x /usr/local/sbin/convert

Make sure bash script working

Put vidoe file on $input
sudo convert

Now put php script on your php upload script

shell_exec('convert >> /dev/null 2>&1 &')

Enjoy...

Project Activity

See All Activity >

Other Useful Business Software
Easily Host LLMs and Web Apps on Cloud Run Icon
Easily Host LLMs and Web Apps on Cloud Run

Run everything from popular models with on-demand NVIDIA L4 GPUs to web apps without infrastructure management.

Run frontend and backend services, batch jobs, host LLMs, and queue processing workloads without the need to manage infrastructure. Cloud Run gives you on-demand GPU access for hosting LLMs and running real-time AI—with 5-second cold starts and automatic scale-to-zero so you only pay for actual usage. New customers get $300 in free credit to start.
Try Cloud Run Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of FFMPEG-Raspberry + PHP-FFMPEG!

Additional Project Details

Registered

2017-09-14