예제 #1
0
        public bool GetImage(string outFileName, TimeSpan time, int width = -1, int height = 150)
        {
            string outFile = Path.Combine(_outFolder, outFileName);
            string args    = string.Format("-i \"{0}\" -ss {1} -vcodec mjpeg -vframes 1 -an -vf scale={2}:{3} \"{4}\"",
                                           _sourceFile, DateTimeFormatter.ToHHMMSSFFF(time, '.'), width, height, outFile);

            return(RunCommand(args));
        }
예제 #2
0
        public bool Cut(string outFileName, TimeSpan from, TimeSpan to)
        {
            string outFile = Path.Combine(_outFolder, outFileName);

            string args = string.Format("-i \"{0}\" -ss {1} -to {2} -c:v copy -c:a copy \"{3}\"",
                                        _sourceFile, DateTimeFormatter.ToHHMMSSFFF(from, '.'),
                                        DateTimeFormatter.ToHHMMSSFFF(to, '.'), outFile);

            return(RunCommand(args));
        }