public double TotalDuration { get; } public:property double TotalDuration {double get();}
A value representing the total duration for the title.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public ConvertCtrlForm _form = new ConvertCtrlForm();public void UseDVDSourceExample(){// reference the convert controlConvertCtrl convertctrl = _form.ConvertCtrl;// input and output filesstring inFile = Path.Combine(LEAD_VARS.MediaDir, @"VIDEO_TS\VIDEO_TS.IFO");string outFile = Path.Combine(LEAD_VARS.MediaDir, "ConvertCtrl_UseDVDSourceExample.avi");try{DVDSource dvdSource;DVDTitle title;DVDChapter chapter;DVDSubpictureStream subpictureStream;DVDAudioStream audioStream;DVDVideoCompression comp;DVDAudioAppMode appMode;DVDAudioFormat audFormat;DVDAudioLangExt audLangExt;DVDSubpictureCoding subPicCoding;DVDSubpictureLangExt subPicLangExt;DVDSubpictureType subPicType;int i;int lCount;long lVal;bool bVal;double dVal;string strPlayList;// force to use the DVD sourceconvertctrl.UseDVDSource = true;// set the input and output filesconvertctrl.SourceFile = inFile;convertctrl.TargetFile = outFile;// reference the DVDSource objectdvdSource = (DVDSource)convertctrl.GetSubObject(ConvertObject.SourceFilter);// Select the main title on the discif ((dvdSource.Selected != DVDSourceSelectedState.MainSelected))dvdSource.Selected = DVDSourceSelectedState.MainSelected;// Get the disc durationdVal = dvdSource.TotalDuration;// Get the selected title durationdVal = dvdSource.SelectedDuration;// Get the play list settingsstrPlayList = dvdSource.PlayList;// You can save this to a file and restore the settings later// Restore the playlist settingsdvdSource.PlayList = strPlayList;// Get the title count in the disclCount = dvdSource.TitleCount;for (i = 0; (i <= (lCount - 1)); i++){// Get the title interfacetitle = dvdSource.GetTitle(i);// Get the X and Y aspectslVal = title.AspectX;lVal = title.AspectY;// Get if the title is a film mode or camera modebVal = title.IsFilmMode;// Get if there is a user data in line 21, field 1bVal = title.Line21Field1InGOP;// Get if there is a user data in line 21, field 2bVal = title.Line21Field2InGOP;// Get the compressioncomp = title.Compression;// Get the X source resolutionlVal = title.SourceResolutionX;// Get the Y source resolutionlVal = title.SourceResolutionY;// Get the Frame HeightlVal = title.FrameHeight;// Get the Frame RatelVal = title.FrameRate;// Get if the source is a letter boxedbVal = title.IsSourceLetterboxed;// Get if the picture can be shown as letterboxbVal = title.LetterboxPermitted;// Get if the picture can be shown as pan-scanbVal = title.PanscanPermitted;// Get the title durationdVal = title.TotalDuration;// Select all title chaptersif ((title.Selected != DVDTitleSelectedState.Selected))title.Selected = DVDTitleSelectedState.Selected;// Get the selected chapter durationdVal = title.SelectedDuration;// Get the audio stream count in the titleif ((title.AudioStreamCount > 0)){// Select the first audio streamif ((title.SelectedAudioStream == -1))title.SelectedAudioStream = 0;// Get the first audio streamaudioStream = title.GetAudioStream(0);// Select the audio streamif ((audioStream.Selected == false))audioStream.Selected = true;// Get the application modeappMode = audioStream.AppMode;// Get the application mode datalVal = audioStream.AppModeData;// Get the auido formataudFormat = audioStream.AudioFormat;// Get the number of channelslVal = audioStream.Channels;// Get the frequencylVal = audioStream.Frequency;// Get the languagelVal = audioStream.Language;// Get the language extensionaudLangExt = audioStream.LanguageExtension;// Get the quantizationlVal = audioStream.Quantization;if ((title.SubpictureStreamCount > 0)){// Select the first subpicture streamif ((title.SelectedSubpictureStream == -1))title.SelectedSubpictureStream = 0;// Get the first subpicture streamsubpictureStream = title.GetSubpictureStream(0);// Select the subpicture streamif ((subpictureStream.Selected == false))subpictureStream.Selected = true;// Get the coding modesubPicCoding = subpictureStream.CodingMode;// Get the langaugelVal = subpictureStream.Language;// Get the language extensionsubPicLangExt = subpictureStream.LanguageExtension;// Get the typesubPicType = subpictureStream.Type;}// Get the chapter countif ((title.ChapterCount > 0)){// Get the first chapterchapter = title.GetChapter(0);// Get the chapter durationdVal = chapter.Duration;// Get if the chapter is selectedif ((chapter.Selected == false))chapter.Selected = true;}}}}catch (COMException){_result = false;}catch (Exception){_result = false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (convertctrl.State == ConvertState.Running)Application.DoEvents();}static class LEAD_VARS{public const string MediaDir = @"C:\LEADTOOLS23\Media";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
