I would like to find a solution to this problem: I have a list of images that i want to convert into a video on the server. I've created a virtual machine with centOS and installed ffmpeg to test that. Everything working well when I type myself this line in the terminal
sudo ffmpeg -r 10 -i img%03d.png -c:v libx264 -preset veryslow -crf 0
video.mp4
What I want is to call this when I click on a button. Here is the code:
Javascript:
$(document).ready(function(){
$("#ffmpeg").click(function(){
$.get('ffmpegBooklet.php', function (data) {
console.log(data);
});
});
});
PHP:
echo shell_exec("/usr/local/bin/ffmpeg -r 10 -i /img%03d.png -c:v
libx264 -preset veryslow -crf 0 video.mp4 2>&1");
What i get in the console of the browser is : the log from ffmpeg and at the end --> Permission denied
I've tried with a static build (after reading on internet) but I have the same problem. Is there any solution to do this without the sudo rights? I don't want to do this as sudo or to some tricky command to give sudo permissions through php because I think it's not secure.
Any helps is welcome! Thanks for reading it :)