Please Fix MovieInfo()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Please Fix MovieInfo()

Post by fsw »

Because in PureBasic the total length of the movie can only be calculated with MovieInfo() and MovieLength(), the calculated total time is not always correct.

Here some data I collected:
(macOS Sierra)
  • example mp4 file:
    Frames: 277 per seconds (* 1000) as reported by MovieInfo()
    Length: 28228 frames as reported by MovieLength()
    QT: 18:49 min movie length as reported by QuickTime
    18 min * 60 = 1080 sec
    1080 + 49 = 1129 sec total time
    28228 / 1129 = 25.002 fps

    example mp4 file:
    Frames: 25000 per seconds (* 1000) as reported by MovieInfo()
    Length: 65143 frames as reported by MovieLength()
    QT: 43:26 min movie length as reported by QuickTime
    43 min * 60 = 2580 sec
    2580 + 26 = 2606 sec total time
    65143 / 2606 = 24.997 fps

    example mp4 file:
    Frames: 999 per seconds (* 1000) as reported by MovieInfo()
    Length: 2603 frames as reported by MovieLength()
    QT: 1:49 min movie length as reported by QuickTime
    1 min * 60 = 60 sec
    60 + 49 = 109 sec total time
    2603 / 109 = 23.880 fps

    example mp4 file:
    Frames: 29411 per seconds (* 1000) as reported by MovieInfo()
    Length: 139327 frames as reported by MovieLength()
    QT: 1:17:24 hours movie length as reported by QuickTime
    1 hour * 60 = 60 min
    60 min + 17 min = 77 min
    77 min * 60 = 4620 sec
    4620 + 24 = 4644 sec total time
    139327 / 4644 = 30.001 fps
As you can see out of these 4 examples only 2 times the FPS (* 1000) is reported correctly by MovieInfo().

QuickTime (or VLC or MPV) always report the correct length of the movie.
PureBasic's MovieLength() seems to report the correct amount of frames...
Therefore PureBasic's MovieInfo() is the culprit here.

I'll gladly help in testing the fixed library.

Thanks

I am to provide the public with beneficial shocks.
Alfred Hitshock