0

Essentially, I have this code:

if(in_array($ext,$audio)&&($ext!=="flac")){
    exec("ffmpeg -i -loglevel 'verbose' ".$fileName.".".$ext." ".$fileName.".flac </dev/null >/dev/null 2>/var/www/resources/ffmpegAudio.log &",$ffmpegOutput);
    print_r($ffmpegOutput);
    $editApproveStatus="Audio entry approved. File converted.";
}

Ultimately, my goal is to convert files and show a live progress of the conversion (or at least something that updates every few seconds), and running in the background, so that the same page can be used to convert further files.

Now I'm already stuck, because the conversion just isn't working. I know that the preceding code should be fine, since it makes it all the way to this if statement above, and no errors are being throw up by the PHP. However, my log output shows:

ffmpeg version 0.8.10-6:0.8.10-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Feb  6 2014 20:59:46 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
-loglevel: No such file or directory

Which also leads me to another question: If ffmpeg is deprecated, and avconv is the way to do, can I still use the exec code in my PHP as is (replacing the ffmpeg bit with avconv)? From what I've seen so far on the avconv page, it looks similar, but I can't be certain that it's exactly the same.

So my two questions: Why isn't the file being converted, and is there any change in the syntax between avconv and ffmpeg?

user3331834
  • 41
  • 1
  • 6
  • Note that misleading messages refers to the fake, so-called "`ffmpeg`" from the fork Libav, not `ffmpeg` from FFmpeg where development is very active. – llogan Mar 16 '14 at 21:37
  • @LordNeckbeard So does this mean I installed the wrong ffmpeg? I simply did an apt-get install for ffmpeg. Or does it mean I can just simply ignore this? – user3331834 Mar 16 '14 at 21:41
  • See [Who can tell me the difference and relation between ffmpeg, libav, and avconv?](http://stackoverflow.com/a/9477756/1109017). First try your command manually, and then once it works as expected then try to integrate it into your PHP script. – llogan Mar 16 '14 at 21:52
  • Oh god, compiling! I'm not quite sure I'm feeling masochistic enough for that right now. I'll probably get around to it tomorrow then. Either way, I think the most important thing at this stage is to figure out why the conversion isn't happening to begin with. – user3331834 Mar 16 '14 at 22:00
  • Option placement matters. `-loglevel` is a global option: `ffmpeg [global options] [input options] -i input [output options] output` – llogan Mar 17 '14 at 00:34
  • Ended up going for the static build. Works perfectly. Now I just need to figure out how to show progress... – user3331834 Mar 17 '14 at 09:34
  • You can provide and accept an answer to your own question so others know that you found a solution. – llogan Mar 17 '14 at 17:43

0 Answers0