This project is read-only.

Usage of DVD lib

Feb 5, 2010 at 5:41 AM
Edited Feb 5, 2010 at 5:44 AM

A total noob to C#, making the transition from Visual Basic.Net.

I have an existing program that basically automates the process of getting a DVD into DVR-MS format (how I found this code was via your posts at the Bagavant forums).

I am trying to improve the process of my prob in the transition to C#, allowing titles to be selected then the correct audio track / subtitles etc to be picked for pushing to the rip / mencoder / todvrms programs. I had hoped to use .nte DVD Lib to help get the starting data, however, other than getting the tracks (as below) I cannot work out how to get other information from the DVD.


DvdLib.Ifo.Dvd d = new DvdLib.Ifo.Dvd(textBox1.Text);
label1.Text = Convert.ToString(d.Titles.Count);


The above returns the total number of tracks that is great! What I cannot work out is how to take this to the next level, ie get the track length and number and display, then after selecting a track how to get the audio streams and type, and the subtitle streams and type (fixed etc). Would it be possible to have a small implementation sample to get me started?

Thanks in advance of any advice you may have to my stoopedness!!

Feb 5, 2010 at 2:57 PM

First off, thanks for showing an interest in my library. I wrote it mostly for work purposes, but it is good to know that someone else may get some use out of it. The code is by no means complete at this point, and currently doesn't parse the audio or subpicture information since I didn't need that when I wrote it. If you could explain exactly what you need, I can work on adding support ASAP.

The playback time is currently stored per program chain (usually a chapter), which you can access with this code:


foreach (Title t in d.Titles)
    foreach (ProgramChain pgc in t.ProgramChains)
,pgc.PlaybackTime.Hour, pgc.PlaybackTime.Minute, pgc.PlaybackTime.Second));

I apparently forgot to add a .ToString() method to the DvdTime class, which is something I can do quickly if need be.