ffmpeg file conversion.

suasive

Active member
I have a PHP File uploader, like this one
3s0HH5r.png

Every time I upload a file it gives me this error.
TdvqhnN.png

I've tried this set of code,
PHP:
<?php
    echo "Starting ffmpeg...\n\n";
    echo shell_exec("ffmpeg -y -i input.avi output.avi </dev/null >/dev/null 2>/var/log/ffmpeg.log &");
    echo "Done.\n";
?>
But it isn't working.
I'm trying to get the server to convert the video in the background
I would love to develop something for this, any help would be much appreciated.
Ps: I already have ffmpeg install on the server
 
Last edited:
What is the ffmpeg error? It's not a PHP error, and "Could not convert video file" is not useful in the slightest.
 
why in the background? Does it need to be very speedy? Could you take a different approach, eg save the file to disk and let a cronjob take of it? Or better still, use inotify.
 
why in the background? Does it need to be very speedy? Could you take a different approach, eg save the file to disk and let a cronjob take of it? Or better still, use inotify.
I could, but I wouldn't know where to start from there.
 
I could, but I wouldn't know where to start from there.

You can safely ignore that. There is absolutely nothing wrong with running it in the background like you're trying to do. I do something very similar with video on one of the sites I run.

The PHP code appears to be just fine. Something odd is obviously happening during the conversion process. You're going to want to start in SSH and troubleshoot the actual ffmpeg commands, to see where the error is occuring snd why.
 
Top Bottom