Merhaba ben php. Flv formatında video dosyalarını dönüştürmek zorunda. Vücudun herhangi bir herhangi bir basit komut varsa bana verin.
Bu check out .. bu kod çalışır
<?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 as new mandler();
$rootpath =""; $nputpath = $rootpath."/Default"; $outputpath = $rootpath. "/FLV"; $ThumbPath = $rootpath. "/Thumbs";
if($_POST){ //Save original video in Default folder.
$source = $_FILES['file1']['tmp_name']; $name = $_FILES['file1']['name']; $fileSize = $_FILES['file1']['size']; $filetype = $_FILES['file1']['type']; $dest = '';
Kopya (. $ kaynak, $ inputPath $ isim);
/ / FLV formatına dönüştürmek
$ Outfile = $ _objMda-> convert_media ($ isim, $ RootPath, $ inputPath, $ OutputPath, 320, 240, 32, 22050);
Ben ur sınıf ama hiçbir sonuç efendim kullanılır. Bunu yaparken benim phpini herhangi bir şeyi ayarlayabilirsiniz?