set_time is not the same as next_frame

This forum is about all development around libVLC.
engelcia
New Cone
New Cone
Posts: 2
Joined: 11 Nov 2022 00:27

set_time is not the same as next_frame

Postby engelcia » 11 Nov 2022 00:42

Hi,

I want to forward the same 30.0fps video via both python methods mediaplayer.set_time() and mediaplyer.next_frame() but only the latter is working correctly.
If I'm doing it with set_time() it seems like that every second time, the video is not forwarded. Here my example code:

------
import vlc
import time

instance = vlc.Instance()
player = instance.media_player_new()
media = instance.media_new("video.mp4")
player.set_media(media)
player.play()
mspf = int(30.0)
player.pause()
t = player.get_time()
for iter in range(30):

player.set_time(player.get_time() + mspf)

if player.get_state() == 3:
player.pause()
time.sleep(0.5)

Can anybody help?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: set_time is not the same as next_frame

Postby mfkl » 15 Nov 2022 07:26

Hi,

I don't understand what you are trying to achieve. Set time is to go a specific time, next frame is to get the next frame. They are not supposed to be the same functions.
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests