Page 1 of 1

set_time is not the same as next_frame

Posted: 11 Nov 2022 00:42
by engelcia
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?

Re: set_time is not the same as next_frame

Posted: 15 Nov 2022 07:26
by mfkl
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.