private void DoEncodeAudio(EncodeInfo job)
 {
     FfMpeg ffmpeg = new FfMpeg();
     OggEnc oggEnc = new OggEnc();
     Lame lame = new Lame();
     NeroAACEnc aacEnc = new NeroAACEnc();
     switch (job.AudioProfile.Type)
     {
         case ProfileType.AC3:
             ffmpeg.SetJob(job);
             _worker.DoWork += ffmpeg.DoEncodeAc3;
             Log.Info("ffmpeg.DoEncodeAC3()");
             break;
         case ProfileType.OGG:
             oggEnc.SetJob(job);
             _worker.DoWork += oggEnc.DoEncode;
             Log.Info("oggenc.DoEncode()");
             break;
         case ProfileType.AAC:
             aacEnc.SetJob(job);
             _worker.DoWork += aacEnc.DoEncode;
             Log.Info("NeroAacEnc.DoEncode()");
             break;
         case ProfileType.MP3:
             lame.SetJob(job);
             _worker.DoWork += lame.DoEncode;
             Log.Info("lame.DoEncode()");
             break;
         case ProfileType.Copy:
             if (job.EncodingProfile.OutFormat == OutputType.OutputDvd &&
                 !Processing.CheckAudioDvdCompatible(job.AudioStreams[job.StreamId]))
             {
                 ffmpeg.SetJob(job);
                 _worker.DoWork += ffmpeg.DoEncodeAc3;
                 Log.Info("ffmpeg.DoEncodeAC3()");
             }
             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);

            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);

            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();
        }