2016-04-07 31 views
3

完成视频后,以下调用会退出vlc播放器。Python - 在完成视频文件之前退出vlc

subprocess.call([vlc_path, video_path, '--play-and-exit', '--fullscreen'], shell=False) 

如果我想在1小时内退出vlc,无论视频是否完整,我该怎么做?

回答

3

一个可能的解决方案是指定--stop-time <seconds>

subprocess.call([vlc_path, video_path, '--play-and-exit', 
    '--fullscreen', '--stop-time','3600'], shell=False) 

从长远的帮助(vlc -H):

Playback control: 
    --input-repeat <integer [-2147483648 .. 2147483647]> 
          Input repetitions 
     Number of time the same input will be repeated 
    --start-time <float>  Start time 
     The stream will start at this position (in seconds). 
    --stop-time <float>  Stop time 
     The stream will stop at this position (in seconds). 
    --run-time <float>   Run time 
     The stream will run this duration (in seconds). 
+0

谢谢you.Where我看到VLC命令行的帮助? 我在终端上收到'vlc:command not found'。 – Jaydev

+0

@JaydevKalivarapu asuming您正在使用'bash':vlc通常会在安装时作为命令添加。您可以将它作为别名添加到'.bashrc'中:'alias vlc = abs_vlc_path'。如果使用Windows,则需要将vlc.exe添加到您的路径中,如[此处]所述(http://superuser.com/questions/689333/how-to-add-installed-program-to-command-prompt-in- windows) –

+0

-bash:abs_vlc_path:command not found 我在做什么明显错误? – Jaydev

相关问题