예제 #1
0
 public void RemuxDVD(VOBRead.ElementaryStreams streams, string path)
 {
     int outputChannels = 2;
     if (AudioChannels == "mono")
         outputChannels = 1;
     string acodec = String.Format(" -acodec mp2 -ab 192k -ar 48000 -ac {0}", outputChannels);
     RunFFMPEG(String.Format("-y -i \"{0}\" -i \"{1}\" -vcodec copy {2} \"{3}\"", streams.VideoFile, streams.AudioFile, acodec, path));
 }
예제 #2
0
파일: Form1.cs 프로젝트: trms/fixmpeg
        private void ScanDVD(string path)
        {
            int ifoIdx = 1;
            List<IFOParse> ifos = new List<IFOParse>();
            try
            {
                while (true)
                {
                    FileInfo fi = new FileInfo(path + Path.DirectorySeparatorChar + "VTS_" + ifoIdx.ToString("00") + "_0.IFO");
                    if (fi.Exists == false)
                        break;
                    ifoIdx++;
                    string name = fi.Name.ToUpper();
                    int title = Convert.ToInt32(name.Replace("VTS_", "").Replace("_0.IFO", ""));
                    IFOParse ifo = new IFOParse(fi.FullName);
                    ifos.Add(ifo);
                }
                DVDSelection dvd = new DVDSelection(ifos);
                if (dvd.ShowDialog() == DialogResult.OK)
                {
                    for (int i = 0; i < dvd.SelectedNames.Count; i++)
                    {
                        IFOParse.ProgramChain pgc = dvd.SelectedPGCs[i];
                        string outputName = dvd.SelectedNames[i];

                        VOBRead vobReader = new VOBRead();
                        ShowMessage("Reading from DVD...");
                        vobReader.Progress += new VideoProcessor.ProgressCallback(ffmpeg_Progress);
                        VOBRead.ElementaryStreams streams = vobReader.ProcessVOB(pgc, Properties.Settings.Default.TempDirectory);

                        progressBar1.Value = 0;
                        ShowMessage("Remultiplexing DVD files...");
                        VideoProcessor vp = new VideoProcessor(streams.AudioFile);
                        vp.Progress += new VideoProcessor.ProgressCallback(ffmpeg_Progress);
                        vp.RemuxDVD(streams, Path.Combine(Properties.Settings.Default.OutputDirectory, outputName + ".mpg"));

                        // clean up
                        progressBar1.Value = 0;
                        File.Delete(streams.VideoFile);
                        File.Delete(streams.AudioFile);
                        ShowMessage("Done.");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }