Created
June 26, 2022 18:50
-
-
Save lesp/fe7d0fa448b805fe610f74bc477c5df8 to your computer and use it in GitHub Desktop.
Plays a local video file at 50% volume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vlc | |
import time | |
# creating vlc media player object | |
media_player = vlc.MediaPlayer() | |
# The video that we wish to play | |
media = vlc.Media("PiCast.mp4") | |
# Loading up the video ready for playback | |
media_player.set_media(media) | |
# setting volume, this is 50% volume level | |
media_player.audio_set_volume(50) | |
# start playing video | |
media_player.play() | |
# video will play first five seconds, then end. | |
time.sleep(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment