Macos – How to add files to a VLC playlist from the command line on OS X

command linemacosvlc-media-player

I have a Mac across the room hooked up to a big monitor. I do a lot of programming on a Linux netbook, and have lots of terminals open. It'd be nice if I could run a script called something like "add2vlc" which would take a file and push it on the end of the VLC playlist.

Is there any way of doing this?

On Windows and Linux, you can call vlc (or vlc.exe) with –playlist-enqueue. But /Applications/VLC.app/Contents/MacOS/VLC cannot be called with –playlist-enqueue.

I see that in /Applications/VLC.app/Contents/MacOS/share/lua/ there is all sorts of Lua code to script VLC, but I don't really know Lua and can't seem to find documentation that describes how I might use this code to add stuff to the playlist.

If I enable VLC's RC module, VLC doesn't start. Neither does it start with the ncurses controller. Do I need to recompile VLC to get this?

Best Answer

Just came across this old post.

I don't know about Macs but on Windows you can run the following to have a playlist:

vlc.exe file1 file2 

(You would typically need quotes on Windows. "file1")

Alternatively, create a .pls file and specify that when starting vlc.

vlc.exe --config vlcrc playlist2.pls

An example playlist file (playlist2.pls):

[playlist]

NumberOfEntries=2

File1=C:\Documents and Settings\user\My Documents\My Music\f1.mp3
Title1=f1

File2=File1=C:\Documents and Settings\user\My Documents\My Music\f2.mp3
Title2=f2
Related Question