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
Deliver trusted data with dbt Icon
Deliver trusted data with dbt

dbt Labs empowers data teams to build reliable, governed data pipelines—accelerating analytics and AI initiatives with speed and confidence.

Data teams use dbt to codify business logic and make it accessible to the entire organization—for use in reporting, ML modeling, and operational workflows.
Learn More
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