/// <summary>
        /// tries to open the video source and gets the number of frames from it, or
        /// exits with an error
        /// </summary>
        /// <param name="videoSource">the AviSynth script</param>
        /// <param name="error">return parameter for all errors</param>
        /// <returns>true if the file could be opened, false if not</returns>
        protected void getInputProperties(VideoJob job)
        {
            //VapourSynthHelper vsHelper = new VapourSynthHelper();
            //vsHelper.LoadScriptFile(job.Input);
            VSPipeInfo vsHelper = new VSPipeInfo(job.Input, job.VspipeArgs);

            fps_n              = vsHelper.FpsNum;
            fps_d              = vsHelper.FpsDen;
            NumberOfFrames     = (ulong)vsHelper.TotalFreams;
            job.NumberOfFrames = NumberOfFrames;
            if (fps_n == job.FpsNum && fps_d == job.FpsDen)
            {
                return;
            }
            if (job.Vfr)
            {
                job.FpsNum = (uint)fps_n;
                job.FpsDen = (uint)fps_d;
                job.Fps    = (fps_n + 0.0) / fps_d;
                return;
            }
            OKETaskException ex = new OKETaskException(Constants.fpsMismatchSmr);

            ex.progress        = 0.0;
            ex.Data["SRC_FPS"] = ((double)job.FpsNum / job.FpsDen).ToString("F3");
            ex.Data["DST_FPS"] = ((double)fps_n / fps_d).ToString("F3");
            throw ex;
        }
示例#2
0
        /// <summary>
        /// tries to open the video source and gets the number of frames from it, or
        /// exits with an error
        /// </summary>
        /// <param name="videoSource">the AviSynth script</param>
        /// <param name="error">return parameter for all errors</param>
        /// <returns>true if the file could be opened, false if not</returns>
        protected void getInputProperties(VideoJob job)
        {
            //VapourSynthHelper vsHelper = new VapourSynthHelper();
            //vsHelper.LoadScriptFile(job.Input);
            VSPipeInfo vsHelper = new VSPipeInfo(job.Input);

            fps_n          = vsHelper.FpsNum;
            fps_d          = vsHelper.FpsDen;
            numberOfFrames = (ulong)vsHelper.TotalFreams;
            // su.ClipLength = TimeSpan.FromSeconds((double)numberOfFrames / fps);
        }
        /// <summary>
        /// tries to open the video source and gets the number of frames from it, or
        /// exits with an error
        /// </summary>
        /// <param name="videoSource">the AviSynth script</param>
        /// <param name="error">return parameter for all errors</param>
        /// <returns>true if the file could be opened, false if not</returns>
        protected void getInputProperties(VideoJob job)
        {
            //VapourSynthHelper vsHelper = new VapourSynthHelper();
            //vsHelper.LoadScriptFile(job.Input);
            VSPipeInfo vsHelper = new VSPipeInfo(job.Input, job.VspipeArgs);

            fps_n          = vsHelper.FpsNum;
            fps_d          = vsHelper.FpsDen;
            NumberOfFrames = (ulong)vsHelper.TotalFreams;
            if (fps_n != job.FpsNum || fps_d != job.FpsDen)
            {
                OKETaskException ex = new OKETaskException(Constants.fpsMismatchSmr);
                ex.progress        = 0.0;
                ex.Data["SRC_FPS"] = ((double)job.FpsNum / job.FpsDen).ToString("F3");
                ex.Data["DST_FPS"] = ((double)fps_n / fps_d).ToString("F3");
                throw ex;
            }

            // su.ClipLength = TimeSpan.FromSeconds((double)numberOfFrames / fps);
        }