Пример #1
0
        public string ExecuteArgs()
        {
            string args = "";

            switch (overwrite)
            {
            case Libs.Overwrite.Yes:
                args += "-y";
                break;

            case Libs.Overwrite.No:
                args += "-n";
                break;

            default:
                break;
            }

            if (inputFile != null)
            {
                args += " -i \"" + inputFile.FullName + "\"";
            }
            else
            {
                args += " -i \"C:\\inputfile.avi\"";
            }

            if (vCodec != Libs.VCodec.Default)
            {
                args += " -c:v " + vCodec.ToString();
            }
            if (aCodec != Libs.ACodec.Default)
            {
                args += " -c:a " + aCodec.ToString();
            }
            if (tuner != Libs.Tune.Default)
            {
                args += " -tune " + tuner.ToString();
            }
            if (preset != Libs.Preset.Default)
            {
                args += " -preset " + preset.ToString();
            }
            if (fps != Libs.Frames.Default)
            {
                args += " -filter:v fps=fps=" + Libs.GetFramesCount(fps);
            }
            if (res != Libs.Size.Default)
            {
                args += " -s " + Libs.GetSize(res);
            }

            args += " -f " + outputExtension.ToString();

            args += " \"" + outputFolder + @"\" + outputName + "." + outputExtension + "\"";

            latestArgOutput = args;

            return(args);
        }
Пример #2
0
        public string ExecuteArgs()
        {
            string args;

            args = "-y -i ";

            if (inputMedia != null)
            {
                args += "\"" + inputMedia.FullName + "\"";
            }
            else
            {
                args += "\"C:\\inputfile.mp4\"";
            }

            if (vCodec != Libs.VCodec.Default)
            {
                args += " -c:v " + vCodec.ToString();
            }
            if (aCodec != Libs.ACodec.Default)
            {
                args += " -c:a " + aCodec.ToString();
            }
            args += " -crf " + crf;
            if (preset != Libs.Preset.Default)
            {
                args += " -preset " + preset.ToString();
            }
            args += " -ss " + timestamps.Peek().startTime;
            args += " -t " + timestamps.Peek().endTime;
            args += " -map 0";

            if (inputMedia != null)
            {
                args += " \"" + outputFolder + "\\" + Path.GetFileNameWithoutExtension(inputMedia.Name) + "_" + timestamps.Peek().id.ToString() + inputMedia.Extension + "\"";
            }
            else
            {
                args += " \"C:\\outputfolder\\outputfile_num.ext\"";
            }

            return(args);
        }
Пример #3
0
        public void SaveSettings()
        {
            try
            {
                RegistryKey key = Registry.CurrentUser.CreateSubKey(registryLocation);

                if (key != null)
                {
                    key.SetValue("ffmpeg_lastUpdate", lastUpdate.ToString(), RegistryValueKind.String);
                    key.SetValue("ffVersion", ffVersion, RegistryValueKind.String);

                    key.SetValue("ffmpeg_location", ffmpegPath, RegistryValueKind.String);
                    key.SetValue("ffplay_location", ffplayPath, RegistryValueKind.String);
                    key.SetValue("output_location", outputLocation, RegistryValueKind.String);

                    key.SetValue("overwrite", overwrite.ToString(), RegistryValueKind.String);
                    key.SetValue("vCodec", vCodec.ToString(), RegistryValueKind.String);
                    key.SetValue("aCodec", aCodec.ToString(), RegistryValueKind.String);
                    key.SetValue("quality", quality.ToString(), RegistryValueKind.String);
                    if (hideConsole)
                    {
                        key.SetValue("hideConsole", "1", RegistryValueKind.String);
                    }
                    else
                    {
                        key.SetValue("hideConsole", "0", RegistryValueKind.String);
                    }

                    key.SetValue("URIPort", URIPort.ToString(), RegistryValueKind.String);
                    if (URIautoStart)
                    {
                        key.SetValue("autoStart", "1", RegistryValueKind.String);
                    }
                    else
                    {
                        key.SetValue("autoStart", "0", RegistryValueKind.String);
                    }

                    key.Close();
                }
            }
            catch (Exception) { }
        }