0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Python-VLC の使い方

Posted at

Ubuntu 22.04 でライブラリーのインストール

sudo apt install python3-vlc
replay_mp4.py
#! /usr/bin/python
#
import sys
import vlc
import time

sys.stderr.write("*** start ***\n") 
file_mp4 = "./sample-5s.mp4"
media = vlc.MediaPlayer(file_mp4)
 
# start playing video
media.play()

loop_forever = True
while loop_forever:
	try:
		time.sleep(5)
	except KeyboardInterrupt:
		loop_forever = False
		sys.stderr.write("*** interrupted ***\n") 
#
sys.stderr.write("*** end ***\n") 

mp4 ファイルはこちらからサンプルをダウンロードできます。
Sample MP4 video files

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?