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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start 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