Как мы можем конвертировать видео файлы в формат .flv в php

Привет, мне нужно преобразовать видеофайлы в формат .flv в php. любой орган имеет какие-либо простые скрипты, пожалуйста, дайте мне.

Solutions Collecting From Web of "Как мы можем конвертировать видео файлы в формат .flv в php"

с помощью exec () и ffmpeg

проверьте это. Этот код должен работать

<?php class media_handler { function convert_media($filename, $rootpath, $inputpath, $outputpath, $width, $height, $bitrate, $samplingrate) { $outfile = ""; // root directory path, where FFMPEG folder exist in your application. $rPath = $rootpath."\ffmpeg"; // which shows FFMPEG folder exist on the root. // Set Media Size that is width and hieght $size = $width."x".$height; // remove origination extension from file adn add .flv extension, becuase we must give output file name to ffmpeg command. $outfile =$filename; $out=explode(".",$outfile); // Media Size //$size = Width & "x" & Height; // remove origination extenstion from file and add .flv extension , becuase we must give output filename to ffmpeg command. $outfile = $out[0].".flv"; // Use exec command to access command prompt to execute the following FFMPEG Command and convert video to flv format. $ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -ar " .$samplingrate." -ab ".$bitrate." -f flv -s ".$size." ".$outputpath."/".$outfile; //$ffmpegcmd1 = "/usr/local/bin/ffmpeg -i ".$inputpath."/".$filename. " -b 500 -r 25 -s 320×240 -hq -deinterlace -ab 56 -ar 22050 -ac 1 ".$outputpath."/".$outfile." 2>&1"; $ret = shell_exec($ffmpegcmd1); // return output file name for other operations return $ffmpegcmd1; } } ?> 

include_once ( "media_handler.php");

$ _objMda = new mandler (); // $ _ objMda как новый mandler ();

$ rootpath = ""; $ nputpath = $ rootpath. "/ Default"; $ outputpath = $ rootpath. "/ FLV"; $ ThumbPath = $ rootpath. "/ Большие пальцы";

if ($ _ POST) {// Сохранить исходное видео в папке по умолчанию.

$ source = $ _FILES ['file1'] ['tmp_name']; $ name = $ _FILES ['file1'] ['name']; $ fileSize = $ _FILES ['file1'] ['size']; $ filetype = $ _FILES ['file1'] ['type']; $ dest = '';

copy ($ source, $ inputpath. $ name);

// Преобразуем его в формат FLV

$ outfile = $ _objMda-> convert_media ($ name, $ rootpath, $ inputpath, $ outputpath, 320, 240, 32, 22050);

Я использовал ур-класс, но не сэр. могу ли я установить любую вещь на моем phpini для этого?