CmdDemo.ffmpeg.RunFlv C# (CSharp) Méthode

RunFlv() private static méthode

轉換為Flv文件
private static RunFlv ( string fullName, string path, int FlvWidth, int FlvHeight ) : bool
fullName string
path string
FlvWidth int
FlvHeight int
Résultat bool
        private static bool RunFlv(string fullName, string path,int FlvWidth,int FlvHeight)
        {
            //ffmpeg -i F:\01.wmv -ab 56 -ar 22050 -b 500 -r 15 -s 寬x高 f:\test.flv
            if (System.IO.File.Exists(fullName))
            {
            string flvName = System.IO.Path.ChangeExtension(fullName, ".flv");
            if (!String.IsNullOrEmpty(path))
            {
                string lastChar = path.Substring(path.Length - 1);
                if (lastChar == @"\" || lastChar == @"/") path = path.Substring(0, path.Length - 1);
                flvName = path + @"\" + GetFileName(flvName);
            }
            string args;
            if (FlvWidth!=0 && FlvHeight!=0)
            {
                // -ab 56 -ar 22050 -b 500 -r 15 -s
                args = String.Format("-i {0}  -y  -ab 64 -ar 22050   -s {1}*{2}  {3}", fullName, FlvWidth, FlvHeight, flvName);
            }
            else
            {
                args = String.Format("-i {0}  -y  -ab 64 -ar 22050  {1} ", fullName, flvName);
            }
            RunCmd(args);
            }
            return true;
        }