Beispiel #1
0
        public VSPipeProcessor(VideoInfoJob j) : base()
        {
            // 获取VSPipe路径
            RegistryKey key    = Registry.LocalMachine;
            RegistryKey vskey  = key.OpenSubKey("software\\vapoursynth");
            string      vscore = vskey.GetValue("Path") as string;

            if (vscore == null)
            {
                throw new Exception("can't get vs install path");
            }

            FileInfo vspipeInfo = new FileInfo(new DirectoryInfo(vscore).FullName + "\\core64\\vspipe.exe");

            if (vspipeInfo.Exists)
            {
                this.executable = vspipeInfo.FullName;
            }

            videoInfo = new VSVideoInfo();

            StringBuilder sb = new StringBuilder();

            sb.Append("--info ");
            sb.Append("\"" + j.Input + "\" ");
            sb.Append("-");

            commandLine = sb.ToString();
        }
Beispiel #2
0
        public VSPipeInfo(string vsScriptPath, List <string> args)
        {
            VideoInfoJob j = new VideoInfoJob(vsScriptPath, args);

            VSPipeProcessor processor = new VSPipeProcessor(j);

            processor.start();

            videoInfo = processor.VideoInfo;
            UpdateVideoInfo();
        }
Beispiel #3
0
        public void UpdateVideoInfo()
        {
            VSVideoInfo vinfo = VideoInfo;

            totalFrames = vinfo.numFrames;
            // fps = vinfo.g
            fpsNum = vinfo.fpsNum;
            fpsDen = vinfo.fpsDen;
            width  = vinfo.width;
            height = vinfo.height;
        }
Beispiel #4
0
        public VSPipeInfo(string vsScriptPath)
        {
            VideoInfoJob j = new VideoInfoJob(vsScriptPath);

            IJobProcessor processor = VSPipeProcessor.NewVSPipeProcessor(j);

            processor.start();

            videoInfo = (processor as VSPipeProcessor).VideoInfo;

            UpdateVideoInfo();
        }
Beispiel #5
0
        public VSPipeProcessor(VideoInfoJob j) : base()
        {
            // 获取VSPipe路径
            executable = Initializer.Config.vspipePath;
            videoInfo  = new VSVideoInfo();

            StringBuilder sb = new StringBuilder();

            sb.Append("--info");
            foreach (string arg in j.Args)
            {
                sb.Append($" --arg \"{arg}\"");
            }
            sb.Append(" \"" + j.Input + "\"");
            sb.Append(" -");

            commandLine = sb.ToString();
        }