VLC Remote Control
A Python library for controlling VLC media player via its Remote Control interface.
Features
- Control playback: play, pause, stop, next, previous.
- Playlist management: add, view, clear, repeat, loop, random.
- Volume control: get and set the volume.
- Audio device management: get and set the active audio device.
- Command Line Interface (CLI) support.
Requirements
- Python 3.10+
- VLC media player with Remote Control interface enabled.
Installation
0. Install VLC media player
Download the installer at https://www.videolan.org/vlc/
1. Ensure the RC Interface is Enabled
From the VLC UI
- Open VLC and navigate to
Tools->Preferences->Show settings: All. - Under
Interface->Main Interfaces, selectRC.
From the Command Line (Optional, but Recommended)
| OS | Command |
|---|---|
| Windows | vlc --extraintf rc --rc-host=HOST:PORT |
| Linux | vlc --extraintf oldrc --rc-fake-tty --rc-host=HOST:PORT |
Note: Ensure the specified port (e.g., PORT) is open in your firewall.
For more details, refer to the VLC command-line help.
2. Install vlcrc
python -m pip install vlcrc
Usage
Python Library
from pathlib import Path
from vlcrc import VLCRemoteControl
# Create a VLCRemoteControl instance
vlc = VLCRemoteControl("127.0.0.1", 50000)
# Add a file to the playlist
vlc.add(Path("/path/to/media/file.mp4"))
# Play media
vlc.play()
# Get the current playlist
playlist = vlc.playlist()
print(playlist)
# Get and set volume
current_volume = vlc.get_volume()
print(current_volume)
vlc.set_volume(100)
# Get audio devices and set an active one
devices = vlc.get_adev()
print(devices)
vlc.set_adev(devices[0].id)
Available Commands
| Command | Description |
|---|---|
add |
Add a file to the playlist. |
playlist |
Get the current playlist. |
play |
Play the current media. |
stop |
Stop playback. |
next |
Skip to the next media in the playlist. |
prev |
Skip to the previous media. |
goto |
Go to a specific playlist index. |
repeat |
Toggle playlist item repeat. |
loop |
Toggle playlist loop. |
random |
Toggle playlist random jumping. |
clear |
Clear the playlist. |
status |
Get the current status of the player. |
pause |
Pause or resume playback. |
get_volume |
Get the current audio volume. |
set_volume |
Set the audio volume (0-320). |
get_adev |
Get a list of available audio devices. |
set_adev |
Set the active audio device. |
quit |
Quit VLC. |
Command Line Interface (CLI)
usage: vlcrc [-h] [--timeout TIMEOUT] host port {play,stop,next,prev,clear,status,pause,repeat,loop,random,playlist,quit,add,goto,volume,adev} ...
Command Line Interface for VLC Remote Control
positional arguments:
host VLC host address (e.g., 127.0.0.1, 192.168.1.100)
port VLC Remote Control interface port
{play,stop,next,prev,clear,status,pause,repeat,loop,random,playlist,quit,add,goto,volume,adev}
Commands
play play command
stop stop command
next next command
prev prev command
clear clear command
status status command
pause pause command
repeat repeat command
loop loop command
random random command
playlist playlist command
quit quit command
add Add file to playlist
goto Go to specific track
volume Get/set volume
adev Audio device control
options:
-h, --help show this help message and exit
--timeout TIMEOUT Connection timeout in seconds (default: 1.0)
Metadata
Release files for vlcrc 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vlcrc-1.1.0.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vlcrc-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / vlcrc-1.1.0.tar.gz
| Download URL | vlcrc-1.1.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cb1e33142d3881faacc4b14fac7e27b47bf34c8bce358ae108b0c87a061e0ab
|
|
BLAKE2b-256 checksum How to use checksums |
71aea62071a2ff28fa78e1fb07b03bbf54d30b1ddd3fdfa6a506f6703788df15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / vlcrc-1.1.0-py3-none-any.whl
| Download URL | vlcrc-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02c9c799d20156b93cffc276c0c07d2f1ac425e6361b6812eba9129a2c64060f
|
|
BLAKE2b-256 checksum How to use checksums |
a138e0ab21ad8abfebf3efea8d3d49c0a488e24bc3b568bbd39f9a2da687e8a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|