vlc and powershell

Ask and answer questions related to any type of OSA scripting.
Post Reply
Posts: 115
Joined: Mon Sep 03, 2012 3:12 am

vlc and powershell

#1 Post by amz4u2nv » Sun Apr 27, 2014 2:09 am

does anyone know how to open vlc with a parameter in powershell
I'm trying to open vlc using a youtube url..
I want to write scripts to pause and play
Something like open vlc with url and play
and a pause script
and maybe something that will play from pause. Any ideas on how to do this.


Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: vlc and powershell

#2 Post by Automate » Sun Apr 27, 2014 10:44 am

Starting VLC should not be too hard. Maybe something like

Code: Select all

& "C:\VLCpath\VLC.exe" YouTubeURL
Pausing VLC and restarting it will be a little trickier since you have to communicate with the already running program.
VLC does have a RC (Remote Command) interface for doing this http://www.videolan.org/doc/play-howto/ ... l#id590986
It probably would not be too hard to write a OSA plugin to use the VLC RC interface.

EventGhost does have a VLC plugin. Without a OSA plugin this may be the easiest way so OSA > EventGhost > VLC

kherron is also working on a OSA VLC plugin http://www.opensourceautomation.com/php ... =vlc#p8542

Posts: 115
Joined: Mon Sep 03, 2012 3:12 am

Re: vlc and powershell

#3 Post by amz4u2nv » Mon Apr 28, 2014 4:29 am

thanks for that...

I got this script to work -
stop vlc process
kill -force -PassThru -processname vlc

and play youtube videos
cd ${Env:ProgramFiles(x86)}
$program = "VideoLAN\VLC\vlc.exe"
$tubeArray = "https://www.youtube.com/watch?v=W4syim4 ... WJEYSpf6hY",
"https://www.youtube.com/watch?v=cAEBM4I ... EH0AHJFdfE"
$randomNo = Get-Random -Maximum 4 -Minimum 0
$programArgs = $tubeArray[$randomNo]
Invoke-Command -ScriptBlock { & $program $programArgs }

Works great... can't pause and play where you left off, but its ok for now.

Post Reply