ASP.NET 以 FFlib.NET 轉換 Video 檔 為 mp4 格式既 Video 檔
Form1.aspx.cs |
using System; using Softpae.Media; private void Video_Rendering(String SourceFileName, String DestinationFileName) { Job2Convert myJob = new Job2Convert(); MediaServer ms = new MediaServer(); string strAppDir = Server.MapPath("/"); myJob.pszSrcFile = strAppDir + "\\" + SourceFileName; myJob.pszDstFile = strAppDir + "\\" + DestinationFileName; myJob.pszDstFormat = "mp4"; myJob.pszAudioCodec = "aac"; myJob.nAudioChannels = 2; myJob.nAudioBitrate = -1; myJob.nAudioRate = -1; myJob.pszVideoCodec = "h264"; myJob.nVideoBitrate = -1; myJob.nVideoFrameRate = -1; myJob.nVideoFrameWidth = -1; myJob.nVideoFrameHeight = -1; bool ret = ms.ConvertFile(myJob); } |