我正在尝试在VLC媒体播放器中使用python脚本运行视频。我发现子过程功能可以重复打开并运行我的视频,问题是我找不到一种在运行时更改视频速度的方法。
import subprocess
speed = {1: "--rate=1.0", 2: "--rate=1.5", 3: "--rate=2.0", 4: "--rate=2.5", 5: "--rate=3.0"} # speed options
speed_selection =1 #the speed for first play
p = subprocess.Popen(["C:\Program Files\VideoLAN\VLC\Vlc.exe", # open and play vlc media player
r'''C:\Users\user\Desktop\Arduino_project\Riding_Bicycle.mp4''',
"--repeat","--fullscreen","--no-video-title",speed[speed_selection]])