Exemplo n.º 1
0
        public bool encode(SortedList<String, String[]> fileDetails, int i, Track audio, SortedList<String, String> EncOpts)
        {
            try
            {
              ExtApplication besweet =  ToolsManager.Instance.getTool("besweet");

                MiniProcess proc = new AudioProcess(fileDetails["audLength"][0], LanguageController.Instance.getLanguageString("audioEncodingTrack") + " (ID = " + (i) + ")", fileDetails["name"][0] + "AudioEncodingProcess");
                ProcessManager.Instance.Process = proc;
                
                proc.stdErrDisabled(false);
                proc.stdOutDisabled(false);

                LogBookController.Instance.addLogLine("Encoding to vorbis", LogMessageCategories.Video);

                proc.initProcess();
                proc.setFilename(Path.Combine(besweet.getInstallPath(), "BeSweet.exe"));

                if (!besweet.isInstalled())
                    besweet.download();

                audio.encodePath = LocationManager.TempFolder + Path.GetFileNameWithoutExtension(audio.demuxPath) + "_output.ogg";
                proc.setArguments("-core( -input \"" + audio.demuxPath + "\" -output \"" + audio.encodePath + "\" ) -azid( -s stereo -c normal -L -3db ) -ota( -hybridgain ) -ogg( -b " + EncOpts["audbr"] + " )");

                int exitCode = proc.startProcess();

                LogBookController.Instance.addLogLine("Encoding audio completed", LogMessageCategories.Video);

                return ProcessManager.hasProcessExitedCorrectly(proc, exitCode);
            }
            catch (Exception error)
            {
                LogBookController.Instance.addLogLine("Error encoding audio to Vorbis. (" + error.Source + ", " + error.Message + ", " + error.Data + ", " + error.ToString() + ")", LogMessageCategories.Error);
                return false;
            }
        }
Exemplo n.º 2
0
        public bool encode(SortedList<String, String[]> fileDetails, int i, Track audio, SortedList<String, String> EncOpts)
        {
            try
            {
                ExtApplication besweet = ToolsManager.Instance.getTool("besweet");

                MiniProcess proc = new AudioProcess(fileDetails["audLength"][0], LanguageController.Instance.getLanguageString("audioEncodingTrack") + " (ID = " + (i) + ")", fileDetails["name"][0] + "AudioEncodingProcess");
                ProcessManager.Instance.Process = proc;
                
                proc.stdErrDisabled(false);
                proc.stdOutDisabled(false);

                LogBookController.Instance.addLogLine("Encoding to Nero AAC", LogMessageCategories.Video);

                proc.initProcess();


                if (!File.Exists(besweet.getInstallPath() + "neroAacEnc.exe"))
                {
                    MessageBox.Show("Due to licensing we are not allowed to put Nero AAC in the package automaticly.\r\nPlease download Nero Aac and put it in the folder about to open.('NeroAacEnc.exe' directly in Besweet folder.)");
                    Process.Start("http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php");
                    Process.Start(besweet.getInstallPath());
                }

                proc.setFilename(Path.Combine(besweet.getInstallPath(), "BeSweet.exe"));

                if (!besweet.isInstalled())
                    besweet.download();

                audio.encodePath = LocationManager.TempFolder + Path.GetFileNameWithoutExtension(audio.demuxPath) + "_output.mp4";
                proc.setArguments("-core( -input \"" + audio.demuxPath + "\" -output \"" + audio.encodePath + "\" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -abr " + EncOpts["audbr"] + " -codecquality_high ) -ota( -g max )");

                int exitCode = proc.startProcess();

                LogBookController.Instance.addLogLine("Encoding audio completed", LogMessageCategories.Video);

                return ProcessManager.hasProcessExitedCorrectly(proc, exitCode);
            }
            catch (Exception error)
            {
                LogBookController.Instance.addLogLine("Error encoding audio to Nero AAC. (" + error.Source + ", " + error.Message + ", " + error.Data + ", " + error.ToString() + ")", LogMessageCategories.Error);
                return false;
            }
        }