python-vlc icon indicating copy to clipboard operation
python-vlc copied to clipboard

Setting time duration

Open cgvirus opened this issue 6 years ago • 1 comments

Hello, is their any way to do this: https://wiki.videolan.org/VLC_HowTo/Jump_to_a_certain_time/ in python? I want to do it before initiating python just like we do in command-line. Thanks for your advice.

cgvirus avatar Jun 16 '19 23:06 cgvirus

Seems we can do something like this:

import vlc
import time


start_frame = 10
end_frame = 20
length = end_frame - start_frame

player = vlc.MediaPlayer("/home/smile.wav")

player.play()
player.set_time((start_frame*1000))
print(player.get_time())
player.play()
time.sleep(length)

Is there are more functions?

cgvirus avatar Jun 17 '19 01:06 cgvirus