通过 Python 在 VLC 中打开视频文件 [英] Open Video file in VLC through Python

查看:37
本文介绍了通过 Python 在 VLC 中打开视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

import subprocess
import os
print os.path.exists("C:/Users/Dhruv/Desktop/Motivation/RiseShine.mp4") 
p = subprocess.Popen(["C:/Program Files (x86)/VideoLAN/VLC/vlc.exe","C:/Users/Dhruv/Desktop/Motivation/RiseShine.mp4"])

上面的代码是使用python在VLC播放器中打开一个视频文件.VLC 播放器打开,但不运行视频.我检查了视频位置,它是正确的.有人能告诉我怎么做吗?

The code above is to open a video file in VLC player using python. The VLC player opens up, but does not run the video. I have checked the video location, it is correct. Can somebody tell me how to make this work?

推荐答案

这对我有用(Python 3.4):

This worked for me (Python 3.4):

p = subprocess.Popen(["C:/Program Files (x86)/VideoLAN/VLC/vlc.exe","\\E:\Movies\\" + title + '.mp4'])

测试的视频肯定是 mp4 格式,顺便说一句.

The video tested was definitely in mp4 format, btw.

这篇关于通过 Python 在 VLC 中打开视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆