예제 #1
0
        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());
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        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);
        }
예제 #4
0
파일: MkvMerge.cs 프로젝트: hessonsu/bdhero
        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);
        }
예제 #5
0
 public FFmpegCLI DumpLogFile()
 {
     _arguments.AddAll("-report");
     return(this);
 }
예제 #6
0
 /// <summary>
 ///     Used by mkvmerge.
 /// </summary>
 /// <param name="attachmentFilePath"></param>
 private void AttachFile([NotNull] string attachmentFilePath)
 {
     _arguments.AddAll("--attach-file", attachmentFilePath);
 }