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
AI-powered service management for IT and enterprise teams Icon
AI-powered service management for IT and enterprise teams

Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity. Maximize operational efficiency with refreshingly simple, AI-powered Freshservice.
Try it 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