Ffmpeg
Get the file
After the download, the first is to configure the environment variables
I downloaded it in the D disk and the catalogue.
d:oracleproduct10.2.0client_1bin;d:oracleproduct10.2.0db_1bin;%systemroot%system32;%systemroot%;%systemroot% System32wbem; C:Program Filesjavajdk1.7.0bin; C:Program Filesati technologiesati.acecore-static; C:Program FilesCommon filesthunder Networkkankancodecs;d:program filestortoisesvnbin; C:Program FilesMicrosoft SQL Server90toolsbinn;d:ffmpeg
It's a little bit more, and the last one is my ffmpeg.
After you've configured it, test it in DOS first.
Open the DOS interface input FFmpeg
If it succeeds, it will show a lot of orders.
If it fails, you are not entering an internal command or something.
If you fail, see if your environment variable is configured OK
OK after the test in DOS to successfully convert
First put a video in a directory
I put the Demo.avi video in the D disk and the directory and I'm going to convert to FLV
Input command: Ffmpeg-i D:/demo.avi D:/demo. flv
-I followed by the address of the file to be converted is where you want to convert the file and the corresponding file name and format
Enter the command and return to see if the corresponding directory appears with the converted file you need.
If the failure checks if the command is wrong.
command to perform transformations in PHP
Convert to FLV
function makeflv ($video _file, $flv _file)
{
To determine if a given file is normal
if (!is_file ($video _file)) {
return false;
}
Global $flv _msg;
$flv _cmd= "Ffmpeg-i". $video _file. " ". $flv _file;
EXEC ($flv _cmd, $flv _msg);
}
Create a picture of an FLV video
function Makeflvpic ($flv _file, $flv _pic_file)
{
Global $flv _msg;
$flv _pic_cmd= "Ffmpeg-i". $flv _file.
"-y-f Image2".
"-ss 1".
"-t 0.001".
"-S 350x240". $flv _pic_file;
EXEC ($flv _pic_cmd, $flv _msg);
}