ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Timeformat in DShowParams
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jenswahl

Germany
74 Posts

Posted - Dec 14 2017 :  09:50:46  Show Profile  Reply
Hello,

I want to get the number of frames in a video file but I get always only the value for tfTime. My code is the following:

if ievTmp.IO.DShowParams.Connected then begin
	ievTmp.IO.DShowParams.Disconnect;
end;
ievTmp.IO.DShowParams.FileInput := AnsiString(sFN);
ievTmp.IO.DShowParams.Connect;
ievTmp.IO.DShowParams.Position := 0;
ievTmp.IO.DShowParams.Pause;

ievTmp.IO.DShowParams.TimeFormat := tfTime;

//it's OK:
nxgVCM.Cells[5, iTmpRow] := secs2str(ievTmp.IO.DShowParams.Duration);
nSec := ievTmp.IO.DShowParams.Duration / 10000000;

//it's not OK:
ievTmp.IO.DShowParams.TimeFormat := tfFrame;
sFPS := IntToStr(ievTmp.IO.DShowParams.Duration);



nSec are 89 seconds = OK. sFPS is the same: the 89 seconds in 100 Nanoseconds. What is wrong?

Thank you.

Jens

xequte

39145 Posts

Posted - Dec 14 2017 :  17:24:48  Show Profile  Reply
Hi Jens

Can you step into the code of:

procedure TIEDirectShow.SetXTimeFormat(value: TIETimeFormat);

And see what result you get for fMediaSeeking.SetTimeFormat(@TIME_FORMAT_FRAME);

Presumably, it is not implemented for that filter:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd407040(v=vs.85).aspx

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Dec 15 2017 :  02:18:14  Show Profile  Reply
Hello Nigel,

Thank you for the fast answer.
It's not implemented. I'm a little bit confused because it's for the most formats (I tested with mov, mpg, mp4, mkv and avi): Only for avi I get a correct result.

But if I use the VLDSVideoPlayer component by mitov.com which bases also on DirectX than I get the correct frame count for all video formats I tested.
It's a little bit curious.

Jens
Go to Top of Page

xequte

39145 Posts

Posted - Dec 15 2017 :  16:04:27  Show Profile  Reply
Hi Jens

ImageEn is simply returning the result from the DirectShow filter, so if they have not implemented the functionality then it fails. We'll add some better error handling for the next update.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

xequte

39145 Posts

Posted - Dec 17 2017 :  20:38:41  Show Profile  Reply
Also, you should read TimeFormat after setting it to ensure the format is supported by the filter.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jenswahl

Germany
74 Posts

Posted - Dec 18 2017 :  01:40:48  Show Profile  Reply
Thank you.

www.inntalsoftware.de/en/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: