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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 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

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
john_siggy@yahoo.com Posted - Dec 14 2016 : 21:53:36
I see bitrate and some other options but not Frames Per Second. How are people figuring FPS?

Regards,


John
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 15 2016 : 19:00:35
Oh, I see. I don't believe that is possible.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
john_siggy@yahoo.com Posted - Dec 15 2016 : 18:50:03
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...
xequte Posted - Dec 15 2016 : 17:02:39
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
john_siggy@yahoo.com Posted - Dec 15 2016 : 12:31:12
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;

xequte Posted - Dec 14 2016 : 23:37:17
Hi John

Please see:

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


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com