#5 incorrect FPS comparision

closed
nobody
None
5
2005-02-25
2005-02-24
chuan shen
No

I have a KODAK cx6430 which records mov files in a
frame rate of 13.01 fps. When I use MP4Cam2AVI to
convert multiple files, the program always argues that
"Source files have different frame rate."

I then debug into main.pas, and find that:

main.pas, line 471-481:

if (InFile.FPS <> FPS) then
err := err + 'Source files have different frame
rate. ';
======================================
The problems is that since FPS is a float number,
sometimes you will get FPS equals 13.0105345 and
sometimes It equals 13.0104987. So the program
always treat them as different FPS and stop working.

So after modify source file, it seems working now:

if (Trunc(InFile.FPS*100) <> Trunc(FPS*100)) then
err := err + 'Source files have different frame
rate. ';
=====================================

Also, I notice that the program needs the source files to
be indentical in frame size and frame rate even it is a
many mov -> many avi convertion. And the further
tracing into the program shows that the output file's
property(frame size, rame rate etc) is assigned to the
property of first file of the input list.

Anyway, this is a greate program and it will be better.
best regards

darklen

Discussion

  • Oleg Mikheev

    Oleg Mikheev - 2005-02-24

    Logged In: YES
    user_id=1150274

    Thanks for intelligent report!
    I'll fix it to the next version.

    But it's a strange thing: why so big difference in FPS
    (0.0001)? FPS in my app is calculated like FPS := FPSA /
    FPSB. Are FPSA and FPSB values the same for your
    camera?
    FPSA and FPSB are shown in file info when you click file
    name.

     
  • Oleg Mikheev

    Oleg Mikheev - 2005-02-24
    • status: open --> pending
     
  • chuan shen

    chuan shen - 2005-02-24
    • status: pending --> open
     
  • chuan shen

    chuan shen - 2005-02-24

    Logged In: YES
    user_id=915006

    In the file information section of the GUI, FPS = FPSA /
    FPSB is the same value : 13.01. However, when debug into,
    the actual value various.

    I was warned not to use comparison on float numbers for
    eauality when I was developing software using DELPHI many
    years ago.

     
  • Oleg Mikheev

    Oleg Mikheev - 2005-02-25

    Logged In: YES
    user_id=1150274

    Thanks!
    Didn't know about this issue with floats.

     
  • Oleg Mikheev

    Oleg Mikheev - 2005-02-25

    Logged In: YES
    user_id=1150274

    Bugs you talked about are already fixed in v 1.55 (coming
    soon)
    A little point - I think it's better to use Round, not Trunc,
    cause 30000 / 1000 can be 30 and 29,9999999999 - Trunc
    will give inequality.
    Bug with Many -> Many mode is also fixed, i'll upload it in few
    days.

     
  • Oleg Mikheev

    Oleg Mikheev - 2005-02-25
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks