简体   繁体   English

如果已经运行则退出VLC

[英]Quit VLC if already running

I am having a weird problem with VLC in Python. 我在Python中使用VLC遇到了一个奇怪的问题。 Using the following things. 使用以下内容。

import vlc

self.Instance = vlc.Instance()
self.List = self.Instance.media_list_new()
self.Player_d = self.Instance.media_list_player_new()

I am using self.List.add_media(address of video) to populate the media list. 我正在使用self.List.add_media(address of video)填充媒体列表。

Then self.Player_d.set_media_list(self.List) and self.Player_d.play() 然后是self.Player_d.set_media_list(self.List)self.Player_d.play()

The problem is that VLC starts in a weird (YUV something) window, without any controls. 问题是VLC在一个奇怪的窗口中启动,没有任何控件。 Then freezes after playing the list. 然后在播放列表后冻结。 I have to use Task Manager to shut it down. 我必须使用任务管理器将其关闭。

Can anybody point out the problem? 有人可以指出问题吗? I want to play the VLC with all controls. 我想用所有控件播放VLC。

Secondly, is there anyway of checking if VLC is already running, if running, then to quit and start a new instance of VLC. 第二,无论如何,是否要检查VLC是否已在运行,如果正在运行,则要退出并启动新的VLC实例。

Any help would be appreciated. 任何帮助,将不胜感激。

I don't see anything about wxPython in your question, but if you're using it with the vlc module, then that could be your problem. 在您的问题中,我没有看到有关wxPython的任何信息,但是如果您将其与vlc模块一起使用,则可能是您的问题。 I'm guessing they don't play nicely together. 我猜他们在一起玩的不好。 You probably need to run all the vlc stuff in a separate thread rather than in wx's main loop. 您可能需要在单独的线程中而不是在wx的主循环中运行所有vlc东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM