Использование libvlc
версия 2.2:
import vlc
Instance = vlc.Instance()
player = Instance.media_player_new()
Media = Instance.media_new('Test.avi')
player.set_media(Media)
player.play() # ← your code doesn't have this
player.video_set_subtitle_file('Test.srt')
Использование libvlc
версия 3:
player.video_set_subtitle_file()
устарело - использование
add_slave()
import vlc
Instance = vlc.Instance()
player = Instance.media_player_new()
Media = Instance.media_new('Test.avi')
Sub = player.add_slave(player,'Test.srt', True)
player.set_media(Media)
player.play()
Дополнительно:
def video_set_subtitle_file(self, psz_subtitle):
'''Set new video subtitle file.
\deprecated Use L{add_slave}() instead.
@param psz_subtitle: new video subtitle file.
@return: the success status (boolean).
'''
return libvlc_video_set_subtitle_file(self, str_to_bytes(psz_subtitle))