示例#1
0
        public MkvMerge(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
            : base(jobObjectManager)
        {
            _tempFileRegistrar = tempFileRegistrar;

            var cli = new MkvMergeCLI(Arguments, tempFileRegistrar)
                      .SetOutputPath(outputMKVPath)
                      .SetSelectedTracks(playlist)
                      .NoGlobalTags()
                      .NoTrackTags()
                      .NoChapters()
                      .SetInputPath(playlist.FullPath)
                      .AttachCoverArt(job.SelectedReleaseMedium)
                      .SetMovieTitle(job)
                      .SetChapters(playlist.Chapters)
            ;

            ExePath = cli.ExePath;

            StdOut += HandleOutputLine;
            StdErr += HandleOutputLine;
            Exited += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, outputMKVPath);

//            CleanExit = false;
        }
示例#2
0
文件: FFmpeg.cs 项目: JGTM2016/bdhero
        public FFmpeg(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
            : base(jobObjectManager)
        {
            _playlistLength = playlist.Length;
            _inputM2TSPaths = playlist.StreamClips.Select(clip => clip.FileInfo.FullName).ToList();
            _selectedTracks = playlist.Tracks.Where(track => track.Keep).ToList();
            _outputMKVPath = outputMKVPath;
            _jobObjectManager = jobObjectManager;
            _tempFileRegistrar = tempFileRegistrar;

            _progressFilePath = _tempFileRegistrar.CreateTempFile(GetType(), "progress.log");
            _inputFileListPath = _tempFileRegistrar.CreateTempFile(GetType(), "inputFileList.txt");
            _indexer = new FFmpegTrackIndexer(playlist);

            VerifyInputPaths();
            VerifySelectedTracks();

            SetExePath();

            SetFFmpegLogLevel();
            RedirectProgressToFile();
            ReplaceExistingFiles();
            SetInputFiles();
            SetMovieTitle(job);
            MapSelectedTracks();
            CopyAllCodecs();
            ConvertLPCM();
            SetOutputMKVPath();

            BeforeStart += OnBeforeStart;
            StdErr += OnStdErr;
            Exited += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, _selectedTracks, outputMKVPath);

            foreach (var track in playlist.Tracks)
            {
                var index = _indexer[track];
                Logger.InfoFormat("Track w/ stream PID {0} (0x{0:x4}): index {1} => {2} ({3})",
                    track.PID, index.InputIndex, index.OutputIndex, track.Codec);
            }
        }
示例#3
0
        public FFmpeg(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
            : base(jobObjectManager)
        {
            _playlistLength    = playlist.Length;
            _inputM2TSPaths    = playlist.StreamClips.Select(clip => clip.FileInfo.FullName).ToList();
            _selectedTracks    = playlist.Tracks.Where(track => track.Keep).ToList();
            _outputMKVPath     = outputMKVPath;
            _jobObjectManager  = jobObjectManager;
            _tempFileRegistrar = tempFileRegistrar;

            _progressFilePath  = _tempFileRegistrar.CreateTempFile(GetType(), "progress.log");
            _inputFileListPath = _tempFileRegistrar.CreateTempFile(GetType(), "inputFileList.txt");
            _indexer           = new FFmpegTrackIndexer(playlist);

            VerifyInputPaths();
            VerifySelectedTracks();

            SetExePath();

            SetFFmpegLogLevel();
            RedirectProgressToFile();
            ReplaceExistingFiles();
            SetInputFiles();
            SetMovieTitle(job);
            MapSelectedTracks();
            CopyAllCodecs();
            ConvertLPCM();
            SetOutputMKVPath();

            BeforeStart += OnBeforeStart;
            StdErr      += OnStdErr;
            Exited      += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, _selectedTracks, outputMKVPath);

            foreach (var track in playlist.Tracks)
            {
                var index = _indexer[track];
                Logger.InfoFormat("Track w/ stream PID {0} (0x{0:x4}): index {1} => {2} ({3})",
                                  track.PID, index.InputIndex, index.OutputIndex, track.Codec);
            }
        }
示例#4
0
        public FFmpeg(Job job, Playlist playlist, string outputMKVPath, IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
            : base(jobObjectManager)
        {
            _jobObjectManager  = jobObjectManager;
            _tempFileRegistrar = tempFileRegistrar;

            _progressFilePath  = _tempFileRegistrar.CreateTempFile(GetType(), "progress.log");
            _inputFileListPath = _tempFileRegistrar.CreateTempFile(GetType(), "inputFileList.txt");
            _reportDumpFileDir = Path.GetDirectoryName(_progressFilePath);

            _playlistLength = playlist.Length;

            var inputM2TSPaths = playlist.StreamClips.Select(clip => clip.FileInfo.FullName).ToList();
            var selectedTracks = playlist.Tracks.Where(track => track.Keep).ToList();
            var trackIndexer   = new FFmpegTrackIndexer(playlist);

            var cli = new FFmpegCLI(Arguments)
                      .DumpLogFile()
                      .SetLogLevel(FFmpegLogLevel.Error)
                      .RedirectProgressToFile(_progressFilePath)
                      .GenPTS()
                      .ReplaceExistingFiles()
                      .SetInputPaths(inputM2TSPaths, _inputFileListPath)
                      .SetMovieTitle(job)
                      .SetSelectedTracks(selectedTracks, trackIndexer)
                      .CopyAllCodecs()
                      .ConvertLPCM()
                      .SetOutputPath(outputMKVPath)
            ;

            ExePath = cli.ExePath;

            BeforeStart += OnBeforeStart;
            StdErr      += OnStdErr;
            Exited      += (state, code, exception, time) => OnExited(state, code, job.SelectedReleaseMedium, playlist, outputMKVPath);

            CleanExit = false;
        }
示例#5
0
 public FFmpegPlugin(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
 {
     _jobObjectManager  = jobObjectManager;
     _tempFileRegistrar = tempFileRegistrar;
 }
示例#6
0
 public MkvPropEdit(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
     : base(jobObjectManager)
 {
     _tempFileRegistrar = tempFileRegistrar;
     SetExePath();
 }
示例#7
0
 public FFmpegPlugin(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
 {
     _jobObjectManager = jobObjectManager;
     _tempFileRegistrar = tempFileRegistrar;
 }
示例#8
0
 public ChapterWriterV3(ITempFileRegistrar tempFileRegistrar)
 {
     _tempFileRegistrar = tempFileRegistrar;
 }
示例#9
0
 public MkvPropEdit(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
     : base(jobObjectManager)
 {
     _tempFileRegistrar = tempFileRegistrar;
     SetExePath();
 }
示例#10
0
 public MkvMergePlugin(IJobObjectManager jobObjectManager, ITempFileRegistrar tempFileRegistrar)
 {
     _jobObjectManager  = jobObjectManager;
     _tempFileRegistrar = tempFileRegistrar;
 }
示例#11
0
 public MkvMergeCLI(ArgumentList arguments, ITempFileRegistrar tempFileRegistrar)
 {
     ExePath            = GetExePath();
     Arguments          = arguments;
     _tempFileRegistrar = tempFileRegistrar;
 }
示例#12
0
 public CoverArtResizer([NotNull] ArgumentList arguments, ITempFileRegistrar tempFileRegistrar)
 {
     _arguments         = arguments;
     _tempFileRegistrar = tempFileRegistrar;
 }