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
Orchestrate Your AI Agents with Zenflow Icon
Orchestrate Your AI Agents with Zenflow

The multi-agent workflow engine for modern teams. Zenflow executes coding, testing, and verification with deep repo awareness

Zenflow orchestrates AI agents like a real engineering system. With parallel execution, spec-driven workflows, and deep multi-repo understanding, agents plan, implement, test, and verify end-to-end. Upgrade to AI workflows that work the way your team does.
Try free now
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