public async void flvToMp4(string videoUrl, ConvertCallBack call)
        {
            string  param = string.Format("-i {0} -b 1024k -acodec copy -f mp4 {1}", videoUrl, videoUrl + ".mp4");
            Process p     = new Process();

            p.StartInfo.FileName        = ffmpegCom;
            p.StartInfo.Arguments       = param;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.CreateNoWindow  = false;
            await Task.Run(() =>
            {
                p.Start();
                p.WaitForExit();
                p.Close();
                call(true);
            });
        }
Example #2
0
        private static List <T> ConvertToList <T>(System.Collections.IEnumerator ienum, ConvertCallBack <T> callback)
        {
            List <T> result = new List <T> {
            };

            while (ienum.MoveNext())
            {
                XmlNode node = ienum.Current as XmlNode;
                T       ret;
                if (callback(node, out ret))
                {
                    result.Add(ret);
                }
            }
            return(result);
        }