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
 How do I get FPS into the video format select box
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

john_siggy@yahoo.com

USA
158 Posts

Posted - Dec 14 2016 :  21:53:36  Show Profile  Reply
I see bitrate and some other options but not Frames Per Second. How are people figuring FPS?

Regards,


John

xequte

38611 Posts

Posted - Dec 14 2016 :  23:37:17  Show Profile  Reply
Hi John

Please see:

http://www.imageen.com/help/TIEDirectShow.GetAverageTimePerFrame.html


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

john_siggy@yahoo.com

USA
158 Posts

Posted - Dec 15 2016 :  12:31:12  Show Profile  Reply
Thanks, I tried to implement GetAverageTimePerFrame in your ShowVideoFormats function below. Get the same value for all formats: 3333333 Seems I must advance TIEDirectShow for each format. Dont see how to get there ??

  // fills video formats list box
  ListBox1.Clear;
  with ImageEnView1.IO.DShowParams do
    for i := 0 to VideoFormatsCount - 1 do
    begin
      with VideoFormats[i] do
        begin
          s := SysUtils.Format('%s %dx%d %.0f MB/s', [Format, BitmapWidth, BitmapHeight,    BitRate / 1048576]);   
          s := s + ' '+inttostr(10000000 div GetAverageTimePerFrame);
          ListBox1.Items.Add(s);
        end;
    end;

Go to Top of Page

xequte

38611 Posts

Posted - Dec 15 2016 :  17:02:39  Show Profile  Reply
Hi

In order to use GetAverageTimePerFrame you need to connect to the format.

Try:

function AverageTimePerFrameForFile(const Filename: string): int64;
var
  dshow: TIEDirectShow;
begin
  Result := -1;
  dshow := TIEDirectShow.Create;
  try
    dshow.FileInput := AnsiString(FileName);
    dshow.EnableSampleGrabber := true;
    dshow.Connect;
    dshow.Pause;

    dshow.TimeFormat := tfTime;
    if dshow.Duration = 0 then
      exit;
    Result := dshow.GetAverageTimePerFrame;
    dshow.Disconnect;
  finally
    FreeAndNil(dshow);
  end;
end;



Of course, this may be slow (a limitation of TIEDirectShow), so you might be better off not showing the info.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

john_siggy@yahoo.com

USA
158 Posts

Posted - Dec 15 2016 :  18:50:03  Show Profile  Reply
Thanks for your response. A file has one format which can be read. I need to get FPS for each format in a video camera's video format list. These routines seem to use the first format for GetAverageTimePerFrame. These variable names sure are descriptive. Any thoughts...
Go to Top of Page

xequte

38611 Posts

Posted - Dec 15 2016 :  19:00:35  Show Profile  Reply
Oh, I see. I don't believe that is possible.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: