All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
SQL,Server,2005—数据库管理10个最重要的特点_[SQL,Server教程]_0
序列化和反序列化XML应用程序设置类_[Asp.Net教程]
让GridView有新增记录的功能_[Asp.Net教程]
Asp.net中实现从弹出窗口中选择值_[Asp.Net教程]
C#,2.0中泛型编程思想分析_[Asp.Net教程]
asp.net实例:图片转换成字符_[Asp.Net教程]
PHP实例:用PHP简单实现多条件查询_php资料_编程技术
ASP.NET中Session的状态保持方式浅议_.net资料_编程技术
使用div仿javascript模态窗口_JavaScript技术_编程技术
c#编程中学习数据结构的必要性
Reading number is top 10 pictures
The hot big eye big breast beauty2
Fierce chengdu woman, street rape man
男人们都在想什么
Beauty Sun Feifei
壮丽的云彩1
The little woman's bright wire1
A man's favorite things2
接财神,大吉大利,财源滚滚来
中国处女图鉴1
原子弹轰炸长崎的珍贵照片
Download software ranking
Ashlynn Video5
Boxer's Top ten classic battle1
1400篇各类破解文章
Be there or be square
Tram sex maniac 2 (H) rar bag17
终极变速大师Speeder3.26
jdk1.6 for windows
卡丁车单机版
Boxer's Top ten classic battle2
双旗镇刀客A
归海一刀 published in(发表于) 2014/2/17 7:45:46 Edit(编辑)
用php将任何格式视频转为flv_[PHP教程]

用php将任何格式视频转为flv_[PHP教程]

用php将任何格式视频转为flv_[PHP教程]
define("ROOT_DIR",dirname(__FILE__));
class EcodeFlv {
var $fromFile; //上传来的文件
var $toFilePath; //保存文件路径
var $toPicPath; //保存图片路径
var $mpeg; //ffmpeg.exe文件的路径
var $mencode; //mencode.exe文件的路径
var $cmdToFile; //转换文件命令
var $cmdToPic; //转换图片命令
var $toFileName; //转换后的文件名
var $mpegComm; //ffmpeg.exe的转换命令
var $mencodeComm; //mencode.exe的命令
var $mpegType;
var $mencodeType;
var $midi; //mdi.exe的路径
var $cmdMidi; //mdi.exe的命令
//初始化类
function EcodeFlv($fromFile,$toFilePath,$toPicPath,$mpeg,$mencode,$midi) {
$this->mpegComm = false;
$this->mencodeComm = false;
$this->fromFile = $fromFile;
$this->toFilePath = $toFilePath;
$this->toPicPath = ROOT_DIR."/".$toPicPath;
$this->mpeg = ROOT_DIR.$mpeg;
$this->mencode = ROOT_DIR.$mencode;
$this->midi = ROOT_DIR.$midi;
$this->mpegType=array (
"audio/x-mpeg"=>".mp3",
"video/mpeg"=>".mpeg",
"video/3gpp"=>".3gp",
"video/x-ms-asf"=>".asf",
"video/x-msvideo"=>".avi"
);
$this->mencodeType = array(
"application/vnd.rn-realmedia"=>".rm",
"audio/x-pn-realaudio"=>".rmvb",
"audio/x-ms-wmv"=>".wmv",
);
}

//检查文件类型

function checkType() {
if(function_exists(mime_content_type)){
return false;
}else{
//$contentType = mime_content_type($this->fromFile);
$exe = "D:\server\php\extras\magic";
$handel = new finfo(FILEINFO_MIME, $exe);
$contentType = $handel->file($this->fromFile);
}
foreach($this->mpegType as $index=>$key){
if($contentType == $index){
$name = md5(date("Ymd").tiime());
$this->toFileName = $name;
$this->$mpegComm = true;
return true;
}
}
foreach($this->mencodeType as $index=>$key){
if($contentType == $index){
$name = md5(date("Ymd").time());
$this->toFileName = $name;
$this->mencodeComm = true;
return true;
}else{
return false;
}
}
}

//设置文件,图片大小
function setSize($flvSize,$picSize) {
$flvWidth = $flvSize[0];
$flvHeight = $flvSize[1];
$picWidth = $picSize[0];
$picHeight = $picSize[1];
$picName = $this->toPicPath.$this->toFileName.".jpg";
$flvName = $this->toFilePath.$this->toFileName.".flv";
$toMdi = ROOT_DIR."/".$flvName;
$size = $picWidth."x".$picHeight;
if($this->mpegComm){
$this->cmdToFile= "$this->mpeg -i $this->fromFile -y -ab 56 -ar 22050 -b 500 -r 15 -s $flvWith*$flvHeight $flvName";
}
elseif($this->mencodeComm){
$this->cmdToFile = "$this->mencode $this->fromFile -vf scale=$flvWidth:$flvHeight -ffourcc FLV1 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=70:acodec=mp3:abitrate=56:dia=-1 -ofps 25 -srate 22050 -oac mp3lame -o $flvName";
}
$this->cmdToPic = "$this->mpeg -i $toMdi -y -f image2 -ss 8 -t 0.003 -s $size $picName";
$this->cmdMidi = "$this->midi $toMdi /k";
echo $this->cmdToPic;
}

//开始转换
function toEcode() {
set_time_limit(0);
exec($this->cmdToFile,$flvStatus)
exec($this->cmdToPic,$picStatus);
exec($this->cmdMidi,$mStatus);
}

}
?>


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.