Python - 在完成视频文件之前退出vlc

时间:2016-04-07 06:46:15

标签: python vlc

完成视频后,以下呼叫退出vlc播放器。

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

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

1 个答案:

答案 0 :(得分: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).