1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ffmpeg file conversion.

Discussion in 'Server Configuration and Hosting' started by suasive, Jan 22, 2015.

  1. suasive

    suasive Active Member

    I have a PHP File uploader, like this one
    Every time I upload a file it gives me this error.
    I've tried this set of code,
    echo "Starting ffmpeg...\n\n";
    shell_exec("ffmpeg -y -i input.avi output.avi </dev/null >/dev/null 2>/var/log/ffmpeg.log &");
    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: Jan 22, 2015
  2. WSWD

    WSWD Well-Known Member

    What is the ffmpeg error? It's not a PHP error, and "Could not convert video file" is not useful in the slightest.
  3. Jim Boy

    Jim Boy Well-Known Member

    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.
  4. suasive

    suasive Active Member

    I could, but I wouldn't know where to start from there.
  5. WSWD

    WSWD Well-Known Member

    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.

Share This Page