Пример #1
0
        private void DoProcessSubtitle(EncodeInfo job)
        {
            BdSup2SubTool         subtool   = new BdSup2SubTool();
            TextSubtitleConverter converter = new TextSubtitleConverter();

            switch (job.EncodingProfile.OutFormat)
            {
            case OutputType.OutputMp4:
                converter.SetJob(job);
                _worker.DoWork += converter.DoProcess;
                Log.Info("TextSubtitleConverter.DoProcess()");
                break;

            default:
                subtool.SetJob(job);
                _worker.DoWork += subtool.DoProcess;
                Log.Info("BDSup2SubTool.DoProcess()");
                break;
            }
        }
Пример #2
0
        public static void GetAppVersions(string encPath = "", string javaPath = "")
        {
            if (String.IsNullOrEmpty(encPath))
            {
                encPath = AppSettings.ToolsPath;
            }
            if (String.IsNullOrEmpty(javaPath))
            {
                javaPath = AppSettings.JavaInstallPath;
            }

            X264 x264Enc = new X264();

            AppSettings.Lastx264Ver = x264Enc.GetVersionInfo(encPath, false);

            if (Environment.Is64BitOperatingSystem)
            {
                AppSettings.Lastx26464Ver = x264Enc.GetVersionInfo(encPath, true);
            }

            FfMpeg ffmpeg = new FfMpeg();

            AppSettings.LastffmpegVer = ffmpeg.GetVersionInfo(encPath, false);

            if (Environment.Is64BitOperatingSystem)
            {
                AppSettings.Lastffmpeg64Ver = ffmpeg.GetVersionInfo(encPath, true);
            }

            Eac3To eac3To = new Eac3To();

            AppSettings.Lasteac3ToVer = eac3To.GetVersionInfo(encPath);

            LsDvd lsdvd = new LsDvd();

            AppSettings.LastlsdvdVer = lsdvd.GetVersionInfo(encPath);

            MkvMerge mkvMerge = new MkvMerge();

            AppSettings.LastMKVMergeVer = mkvMerge.GetVersionInfo(encPath);

            MPlayer mplayer = new MPlayer();

            AppSettings.LastMplayerVer = mplayer.GetVersionInfo(encPath);

            TsMuxeR tsmuxer = new TsMuxeR();

            AppSettings.LastTSMuxerVer = tsmuxer.GetVersionInfo(encPath);

            MJpeg mjpeg = new MJpeg();

            AppSettings.LastMJPEGToolsVer = mjpeg.GetVersionInfo(encPath);

            DvdAuthor dvdauthor = new DvdAuthor();

            AppSettings.LastDVDAuthorVer = dvdauthor.GetVersionInfo(encPath);

            MP4Box mp4Box = new MP4Box();

            AppSettings.LastMp4BoxVer = mp4Box.GetVersionInfo(encPath);

            HcEnc hcenc = new HcEnc();

            AppSettings.LastHcEncVer = hcenc.GetVersionInfo(encPath);

            OggEnc ogg = new OggEnc();

            AppSettings.LastOggEncVer = ogg.GetVersionInfo(encPath, false);

            if (AppSettings.UseOptimizedEncoders)
            {
                AppSettings.LastOggEncLancerVer = ogg.GetVersionInfo(encPath, true);
            }

            NeroAACEnc aac = new NeroAACEnc();

            AppSettings.LastNeroAacEncVer = aac.GetVersionInfo(encPath);

            Lame lame = new Lame();

            AppSettings.LastLameVer = lame.GetVersionInfo(encPath);

            VpxEnc vpxEnc = new VpxEnc();

            AppSettings.LastVpxEncVer = vpxEnc.GetVersionInfo(encPath);

            XvidEnc xvidEnc = new XvidEnc();
            string  myVer   = xvidEnc.GetVersionInfo(encPath);

            if (!String.IsNullOrEmpty(javaPath))
            {
                BdSup2SubTool bdSup2Sub = new BdSup2SubTool();
                AppSettings.LastBDSup2SubVer = bdSup2Sub.GetVersionInfo(encPath, javaPath);
            }

            #region Get AviSynth Version

            IGraphBuilder graphBuilder = (IGraphBuilder) new FilterGraph();

            string avsFile = AviSynthGenerator.GenerateTestFile();

            int result = graphBuilder.RenderFile(avsFile, null);

            Log.DebugFormat("RenderFile Result: {0}", result);

            if (result < 0)
            {
                Log.Debug("AviSynth is not installed");
            }
            else
            {
                FileVersionInfo ver    = FileVersionInfo.GetVersionInfo(Path.Combine(Environment.SystemDirectory, "avisynth.dll"));
                string          appVer = String.Format("{0:g}.{1:g}.{2:g}.{3:g}", ver.FileMajorPart, ver.FileMinorPart,
                                                       ver.FileBuildPart, ver.FilePrivatePart);
                Log.DebugFormat("Avisynth version {0:s} installed", appVer);
                AppSettings.LastAviSynthVer = appVer;
            }

            File.Delete(avsFile);
            #endregion

            GetAviSynthPluginsVer();
            GetUpdaterVersion();

            AppSettings.UpdateVersions = false;
            AppSettings.SaveSettings();
        }