Exemple #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));
 }
Exemple #2
0
        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);
            }
        }