Log in

View Full Version : Get stream size from DVD


TCA
19th January 2006, 16:43
Hi! I am looking for some piece of code that reads the streams size from DVD like DVDShrink does. I want to know the audio stream's size. I'm using delphi, however C code also would be great. Code for getting the movie's length (DVD format) would be nice too.
THX

celyo
20th January 2006, 09:52
Hi take a look of this:


function GetDuration: Int64;
var
aTime : TDVDHMSFTimeCode;
aFlags : Cardinal;
aRet : HRESULT;
begin
// Default result in case of interface not supported
Result := 0;

if Assigned(dsDvdInfo) then
begin
aRet := dsDvdInfo.GetTotalTitleTime(aTime,aFlags);
if not Failed(aRet) then
begin
Result := aTime.bHours * 3600 + aTime.bMinutes * 60 + aTime.bSeconds;
end;
end;
end;


Oops I forgot to tell you how to get dsDVDInfo interface

You should invoke GetDvdInterface(IID_IDvdInfo2, dsDvdInfo) method of IDVDGraphBuilder after you RenderVolume

Amnon82
20th January 2006, 21:36
... btw it is Delphi.

TCA
21st January 2006, 01:38
... btw it is Delphi.
I know.... I recognize delphi code :D

What packages do I need to use this code maybe DSPack?
And what other variables do I need to define to compile these lines?

Sorry for these n00b questions but this will be my first app messing with directx things.

THX for your replies.

celyo
23rd January 2006, 12:43
Hi, I use DirectX headers from http://www.clootie.ru/

About the variables ... hmm ... it's a difficult to explain. May be you should get DirectX documentation and examples and to see how exactly to render DVD volume.

Take a look at this link : http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/directx9_c_summer_03/directx/htm/writingadvdapplicationinc.asp

Then examples are in C++ but types have full implementation in DirectX headers.