Exemplo n.º 1
0
        public OutputVideo ConvertToWmv(string input, int w, int h)
        {
            OutputVideo ou = new OutputVideo();

            //set up the parameters for getting a previewimage

            string filename  = System.Guid.NewGuid().ToString() + ".wmv";
            string finalpath = Path.Combine(this.AppPath, filename);

            string size = string.Format("{0}x{1}", w.ToString(), h.ToString());//

            string Params = string.Format(" -i \"{0}\" -s {1} -vcodec wmv2 -ar 22050 -acodec wmav2 -ab 56k -ac 2 -y \"{2}\"", input, size, finalpath);

            ou.RawOutput = RunProcess(Params);

            if (File.Exists(finalpath))
            {
                ou.VideoStream = LoadMemoryStreamFromFile(finalpath);
                try
                {
                    File.Delete(finalpath);
                }
                catch (Exception) { }
            }
            return(ou);
        }
Exemplo n.º 2
0
        public OutputVideo ConvertToWmv(VideoFile input)
        {
            if (!input.infoGathered)
            {
                GetVideoInfo(input);
            }
            OutputVideo ou = new OutputVideo();

            //set up the parameters for getting a previewimage

            string filename  = System.Guid.NewGuid().ToString() + ".flv";
            string finalpath = Path.Combine(this.AppPath, filename);

            string Params = string.Format("-i {0} -y -ar 22050 -ab 64 -f flv {1}", input.Path, finalpath);

            //
            ou.RawOutput = RunProcess(Params);

            if (File.Exists(finalpath))
            {
                ou.VideoStream = LoadMemoryStreamFromFile(finalpath);
                try
                {
                    File.Delete(finalpath);
                }
                catch (Exception) { }
            }
            return(ou);
        }
Exemplo n.º 3
0
        public OutputVideo ConvertToWmv(string input, int w, int h)
        {

            OutputVideo ou = new OutputVideo();

            //set up the parameters for getting a previewimage

            string filename = System.Guid.NewGuid().ToString() + ".wmv";
            string finalpath = Path.Combine(this.AppPath, filename);

            string size = string.Format("{0}x{1}", w.ToString(), h.ToString());//

            string Params = string.Format(" -i \"{0}\" -s {1} -vcodec wmv2 -ar 22050 -acodec wmav2 -ab 56k -ac 2 -y \"{2}\"", input, size, finalpath);
            ou.RawOutput = RunProcess(Params);

            if (File.Exists(finalpath))
            {
                ou.VideoStream = LoadMemoryStreamFromFile(finalpath);
                try
                {
                    File.Delete(finalpath);
                }
                catch (Exception) { }
            }
            return ou;
        }
Exemplo n.º 4
0
        public OutputVideo ConvertToWmv(VideoFile input)
        {
            if (!input.infoGathered)
            {
                GetVideoInfo(input);
            }
            OutputVideo ou = new OutputVideo();

            //set up the parameters for getting a previewimage

            string filename = System.Guid.NewGuid().ToString() + ".flv";
            string finalpath = Path.Combine(this.AppPath, filename);

            string Params =string.Format("-i {0} -y -ar 22050 -ab 64 -f flv {1}", input.Path, finalpath);
        //   
            ou.RawOutput = RunProcess(Params);

            if (File.Exists(finalpath))
            {
                ou.VideoStream = LoadMemoryStreamFromFile(finalpath);
                try
                {
                    File.Delete(finalpath);
                }
                catch (Exception) { }
            }
            return ou;
        }