小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

ffmpeg.exe與mencoder.exe實(shí)例轉(zhuǎn)換操作

 悟靜 2013-03-09

using System.Diagnostics;


string ffmpegPath = Configure.ffmpegPath();              //ffmpeg.exe文件所在位置
string mencoderPath = Configure.mencoderPath();    //mencoder.exe文件所在位置

 

string orginalFile = strBaseLocation + @"old/" + fileName;   //轉(zhuǎn)換前文件所在全路徑
string targetFile = strBaseLocation + itemID + ".flv";           //轉(zhuǎn)換后文件所在全路徑

 

string argu = "";
if(fileName.ToUpper().EndsWith(".FLV"))  //不同文件類型使用不同轉(zhuǎn)換參數(shù)


                argu = "-i /"" + orginalFile + "/" -ab 56 -ar 22050 -b 500 -r 15 -s 500x350 /"" + targetFile + "/"";

else if (fileName.ToUpper().EndsWith(".WMV"))


                argu = @"-ffourcc FLV1 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=300:acodec=mp3:abitrate=56 -vf scale=320:290,expand=320:290:::1,crop=320:290:0:0 -ofps 18 -srate 22050 " + orginalFile + " -o " + targetFile;

else if (fileName.ToUpper().EndsWith(".AVI"))


                argu = "-i " + orginalFile + " -f flv -vcodec flv -ab 56 -ar 22050 -b 100 -r 15 -s 500x350 -qscale 7 " + targetFile;

 

//根據(jù)不同類型的文件進(jìn)行不同的轉(zhuǎn)換

if (!fileName.ToUpper().EndsWith(".FLV"))

{
        if (fileName.ToUpper().EndsWith(".WMV"))    //利用mencoder.exe將wmv文件轉(zhuǎn)換成flv文件
                              
                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(mencoderPath, argu);
                        startInfo.WindowStyle = ProcessWindowStyle.Hidden;

                        System.Diagnostics.Process.Start(startInfo);
        }

        if (fileName.ToUpper().EndsWith(".AVI"))     //利用ffmpeg.exe將avi文件轉(zhuǎn)換成flv文件
        {
                        System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(ffmpegPath, argu);
                        startInfo.WindowStyle = ProcessWindowStyle.Hidden;

                        System.Diagnostics.Process.Start(startInfo);    //隱藏dos轉(zhuǎn)換頁面
       }
}

else
{
         System.IO.File.Copy(orginalFile, targetFile);
}

 

if (System.IO.File.Exists(targetFile) && (new System.IO.FileInfo(targetFile)).Length > 10000)
{
       return "成功";

}
else

{

      return "失敗";

}

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請遵守用戶 評(píng)論公約

    類似文章 更多