0

I use the vlc-qt lib and try to access the frames per second information of an openend video file.

The player:

_instance = new VlcInstance(VlcCommon::args(), this);
_player = new VlcMediaPlayer(_instance);
_media = new VlcMedia(file, true, _instance);
_player->openOnly(_media);

the player has a public function playbackRate() but it gives only the current playback ration, so it is 1 if no slowmotion is applied.

float playbackRate = _player->playbackRate();

I also tried to get it over the codec, but the codec itself is not a class but only an enum with possible codecnames.

How can I access the fps, so get back something like 30 frames per second?

Paul S
  • 89
  • 12

1 Answers1

0

Using python vlc.py:
Where self.player is:

self.Instance = vlc.Instance()
self.player = self.Instance.media_player_new()

It has a function get_fps()

def mspf(self):# Milliseconds per frame.
    return int(1000 // (self.player.get_fps() or 25))

EDIT: Having dug deeper, there appears to be no reference to fps in the vlc-qt sources, except where it offers fps as an experimental input to the Media::duplicate and Media::record functions within VlcMedia.cpp although fps is available within vlc

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60