public void SetChapterMetadata(ArgumentList arguments, IEnumerable <Chapter> chapters) { var firstChapterWithLanguage = chapters.FirstOrDefault(HasLanguage); var lang = firstChapterWithLanguage != null ? firstChapterWithLanguage.Language.ISO_639_2 : Language.Undetermined.ISO_639_2; arguments.AddAll("--chapter-language", lang); arguments.AddAll("--chapter-charset", Encoding.BodyName.ToUpper()); }
/// <summary> /// Saves the given <paramref name="chapters"/> in Matroska XML format to a temporary file /// and adds the necessary command line arguments to <paramref name="arguments"/> to /// add the <paramref name="chapters"/> to an MKV file using any of the supported MkvToolNix binaries. /// </summary> /// <param name="arguments"></param> /// <param name="chapters"></param> public void SetChapters(ArgumentList arguments, IEnumerable <Chapter> chapters) { var path = _tempFileRegistrar.CreateTempFile(GetType(), "chapters.xml"); SaveAsXml(chapters, path); arguments.AddAll("--chapters", path); }
public void Mux(object sender, DoWorkEventArgs e) { var inputM2TsFlags = _keepM2TsAudio ? null : "--no-audio"; var inputMkvFlags = _keepM2TsAudio ? "--no-audio" : null; var args = new ArgumentList(); // Chapter file args.AddIfAllNonEmpty("--chapters", _inputChaptersPath); // Output file args.AddAll("-o", _outputMkvPath); // Input M2TS file args.AddNonEmpty("--no-video", inputM2TsFlags, _inputM2TsPath); // If an input chapter file is specified, exclude chapters from the input MKV file if (!string.IsNullOrEmpty(_inputChaptersPath)) args.Add("--no-chapters"); // Input MKV file args.AddNonEmpty(inputMkvFlags, _inputMkvPath); Execute(args, sender, e); }
public void Mux(object sender, DoWorkEventArgs e) { var inputM2TsFlags = _keepM2TsAudio ? null : "--no-audio"; var inputMkvFlags = _keepM2TsAudio ? "--no-audio" : null; var args = new ArgumentList(); // Chapter file args.AddIfAllNonEmpty("--chapters", _inputChaptersPath); // Output file args.AddAll("-o", _outputMkvPath); // Input M2TS file args.AddNonEmpty("--no-video", inputM2TsFlags, _inputM2TsPath); // If an input chapter file is specified, exclude chapters from the input MKV file if (!string.IsNullOrEmpty(_inputChaptersPath)) { args.Add("--no-chapters"); } // Input MKV file args.AddNonEmpty(inputMkvFlags, _inputMkvPath); Execute(args, sender, e); }
public FFmpegCLI DumpLogFile() { _arguments.AddAll("-report"); return(this); }
/// <summary> /// Used by mkvmerge. /// </summary> /// <param name="attachmentFilePath"></param> private void AttachFile([NotNull] string attachmentFilePath) { _arguments.AddAll("--attach-file", attachmentFilePath); }