# VLC Remote Control
A Python library for controlling VLC media player
via its [Remote Control interface][1].
## 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).
## Requirements
- Python 3.10+
- VLC media player with Remote Control (RC) 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
1. Open VLC and navigate to `Tools` -> `Preferences` -> `Show settings: All`.
2. Under `Interface` -> `Main Interfaces`, select `RC`.
#### 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:** Make sure the specified port (e.g., `PORT`) is open and accessible
in your firewall to allow remote control connections.
For more details, refer to the [VLC command-line help][2].
### 2. Import the library
```bash
pip install vlcrc
```
## Usage
### Python Library
```py
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)
```txt
usage: main.py [-h] 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
```
[1]:https://wiki.videolan.org/Documentation:Modules/rc
[2]:https://wiki.videolan.org/VLC_command-line_help
Raw data
{
"_id": null,
"home_page": null,
"name": "vlcrc",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "vlc, remote control, remote, rc, cli, vlc media player, media player",
"author": "Dolgii Evgenii",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/29/2b/b21e64e81e68ece20b167855d6dfed3021d24a1efecc7aede04168407e13/vlcrc-1.0.0.tar.gz",
"platform": null,
"description": "# VLC Remote Control\r\n\r\nA Python library for controlling VLC media player\r\nvia its [Remote Control interface][1].\r\n\r\n## Features\r\n\r\n- Control playback: play, pause, stop, next, previous.\r\n- Playlist management: add, view, clear, repeat, loop, random.\r\n- Volume control: get and set the volume.\r\n- Audio device management: get and set the active audio device.\r\n- Command Line Interface (CLI).\r\n\r\n## Requirements\r\n\r\n- Python 3.10+\r\n- VLC media player with Remote Control (RC) interface enabled.\r\n\r\n## Installation\r\n\r\n### 0. Install VLC media player\r\n\r\nDownload the installer at <https://www.videolan.org/vlc/>\r\n\r\n### 1. Ensure the RC Interface is Enabled\r\n\r\n#### From the VLC UI\r\n\r\n1. Open VLC and navigate to `Tools` -> `Preferences` -> `Show settings: All`.\r\n2. Under `Interface` -> `Main Interfaces`, select `RC`.\r\n\r\n#### From the Command Line (Optional, but Recommended)\r\n\r\n| OS | Command |\r\n|---------|----------------------------------------------------------|\r\n| Windows | `vlc --extraintf rc --rc-host=HOST:PORT` |\r\n| Linux | `vlc --extraintf oldrc --rc-fake-tty --rc-host=HOST:PORT`|\r\n\r\n**Note:** Make sure the specified port (e.g., `PORT`) is open and accessible\r\nin your firewall to allow remote control connections.\r\n\r\nFor more details, refer to the [VLC command-line help][2].\r\n\r\n### 2. Import the library\r\n\r\n```bash\r\npip install vlcrc\r\n```\r\n\r\n## Usage\r\n\r\n### Python Library\r\n\r\n```py\r\nfrom pathlib import Path\r\nfrom vlcrc import VLCRemoteControl\r\n\r\n# Create a VLCRemoteControl instance\r\nvlc = VLCRemoteControl('127.0.0.1', 50000)\r\n\r\n# Add a file to the playlist\r\nvlc.add(Path(\"/path/to/media/file.mp4\"))\r\n\r\n# Play media\r\nvlc.play()\r\n\r\n# Get the current playlist\r\nplaylist = vlc.playlist()\r\nprint(playlist)\r\n\r\n# Get and set volume\r\ncurrent_volume = vlc.get_volume()\r\nprint(current_volume)\r\nvlc.set_volume(100)\r\n\r\n# Get audio devices and set an active one\r\ndevices = vlc.get_adev()\r\nprint(devices)\r\nvlc.set_adev(devices[0].id)\r\n```\r\n\r\n#### Available Commands\r\n\r\n| Command | Description |\r\n|--------------|---------------------------------------------|\r\n| `add` | Add a file to the playlist. |\r\n| `playlist` | Get the current playlist. |\r\n| `play` | Play the current media. |\r\n| `stop` | Stop playback. |\r\n| `next` | Skip to the next media in the playlist. |\r\n| `prev` | Skip to the previous media. |\r\n| `goto` | Go to a specific playlist index. |\r\n| `repeat` | Toggle playlist item repeat. |\r\n| `loop` | Toggle playlist loop. |\r\n| `random` | Toggle playlist random jumping. |\r\n| `clear` | Clear the playlist. |\r\n| `status` | Get the current status of the player. |\r\n| `pause` | Pause or resume playback. |\r\n| `get_volume` | Get the current audio volume. |\r\n| `set_volume` | Set the audio volume (0-320). |\r\n| `get_adev` | Get a list of available audio devices. |\r\n| `set_adev` | Set the active audio device. |\r\n| `quit` | Quit VLC. |\r\n\r\n### Command Line Interface (CLI)\r\n\r\n```txt\r\nusage: main.py [-h] host port {play,stop,next,prev,clear,status,pause,repeat,loop,random,playlist,quit,add,goto,volume,adev} ...\r\n\r\nCommand Line Interface for VLC Remote Control\r\n\r\npositional arguments:\r\n host VLC host address (e.g., 127.0.0.1, 192.168.1.100)\r\n port VLC Remote Control interface port\r\n {play,stop,next,prev,clear,status,pause,repeat,loop,random,playlist,quit,add,goto,volume,adev}\r\n Commands\r\n play play command\r\n stop stop command\r\n next next command\r\n prev prev command\r\n clear clear command\r\n status status command\r\n pause pause command\r\n repeat repeat command\r\n loop loop command\r\n random random command\r\n playlist playlist command\r\n quit quit command\r\n add Add file to playlist\r\n goto Go to specific track\r\n volume Get/set volume\r\n adev Audio device control\r\n\r\noptions:\r\n -h, --help show this help message and exit\r\n```\r\n\r\n[1]:https://wiki.videolan.org/Documentation:Modules/rc\r\n[2]:https://wiki.videolan.org/VLC_command-line_help\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for remote control of VLC media player via its RC interface.",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/evgenii-d/vlcrc",
"Issues": "https://github.com/evgenii-d/vlcrc/issues"
},
"split_keywords": [
"vlc",
" remote control",
" remote",
" rc",
" cli",
" vlc media player",
" media player"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "df76e155f6e2504ee85cc76c95488566a58503b7e6ee081389c3cbeecb2f26a1",
"md5": "00b20461639594ff1dcff86cbf573f46",
"sha256": "fd3f23bcc3a9a841c1d63412b9614a0cad4ce4f62cbf744e0a64212f29df88d5"
},
"downloads": -1,
"filename": "vlcrc-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "00b20461639594ff1dcff86cbf573f46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7827,
"upload_time": "2024-12-20T15:19:01",
"upload_time_iso_8601": "2024-12-20T15:19:01.454087Z",
"url": "https://files.pythonhosted.org/packages/df/76/e155f6e2504ee85cc76c95488566a58503b7e6ee081389c3cbeecb2f26a1/vlcrc-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "292bb21e64e81e68ece20b167855d6dfed3021d24a1efecc7aede04168407e13",
"md5": "1959f5d3706d4f2fa1ca070332f5e3e1",
"sha256": "0a05fb240208484a13531b3e8f6aebe0d503e1e2f402c15e4efe9b77979a0612"
},
"downloads": -1,
"filename": "vlcrc-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1959f5d3706d4f2fa1ca070332f5e3e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 9038,
"upload_time": "2024-12-20T15:19:04",
"upload_time_iso_8601": "2024-12-20T15:19:04.663118Z",
"url": "https://files.pythonhosted.org/packages/29/2b/b21e64e81e68ece20b167855d6dfed3021d24a1efecc7aede04168407e13/vlcrc-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-20 15:19:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "evgenii-d",
"github_project": "vlcrc",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "vlcrc"
}