Controlling VLC videoplayer from the command line
VideoLan’s VLC player offers a vast range of command line switches for optimal control. A recent task was to setup VLC as a presentation tool for looping a set of videos. The list of requirements was:
- load in fullscreen
- disable OSD
- disable sound
- loop videos from a folder
- restart VLC each day in the morning
- target system Windows 7 Pro x64
The final solution was based on three batch scripts: start_vlc_playlist.bat:
@echo off start /min start_vlc_playlist_proc.bat
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --playlist-autostart --loop --fullscreen --no-osd --no-audio --volume=0 --playlist-tree c:\playlist\
@echo off taskkill.exe /IM vlc.exe /F
start_vlc_playlist.bat and stop_vlc_playlist.bat can be used to meet the requirement to start and stop VLC externally, i.e. by using Windows’ Task Scheduler. So, simply create a job that restarts VLC each day in the morning. The other requirements from the list above can be met by starting VLC using the corresponding command line switches.
Hint: I’ve split the starting commands into two separate scripts so that it’s possible to easily create start-and-stop script in the future.