I am using the package python-vlc for video play in the user-defined start and end time. I use player.get_length() and player.get_time() function for computing the video length and the current time of playing the video. I am using Tkinter GUI and want to play the loaded video by defining my own start and end time. Is there any solution. Any help will be thankful for me.
Here is my some sample code:
import vlc, time
# VLC player controls
Instance = vlc.Instance()
media_path = "C:/Users/YASH/Desktop/MP4_Test/HPY_EXT_LLT(13).wav"
player = Instance.media_player_new()
Media = Instance.media_new(str(media_path))
player.set_media(Media)
player.play()
playing = set([1])
time.sleep(1.5) # startup time.
song_lenseconds = int(player.get_length()/1000) # to seconds
song_lenminute = int((player.get_time()/1000)/60)
print ("Current song is : ", media_path, "Length:", "%02d:%02d" % (song_lenminute,song_lenseconds))