Good day! Problem when converting from avi to flv.

<?php $input = "video.avi"; $output = "video.flv"; $ffmpeg = new ffmpeg_movie($input); system("ffmpeg -i $input -ar 44100 -f flv $output"); ?> 

The call system and ffmpeg occurs, because if you specify the wrong name in the $ input , then php swears, they say, the file is not found. However, the video.flv file is not created. What cant, I do not understand! And which is better FLV or SWF?

  • In a sense, you pass a non-existent file name to $input and want something ( video.flv ) to appear anyway? - drdaeman pm

3 answers 3

  1. Run the ffmpeg -i source -ar 44100 -f flv target command in the terminal.
  2. Run the previous command from the same user as the script, and in the same folder.
  3. Run the script with the full path to ffmpeg and with rights to the recording folder 777.
  • And how to start the terminal (command line) on the local server? I use Denwer + Apache - this is not pure * nix. - waterman

check whether the folder where you want to save the file is open for writing.

    As an option, you can write commands directly in the php-script. exec () returns text (response to the result of the command execution)